/* blog.css - Complete styles for blog pages */
:root {
  --primary: #0c4b7d;
  --primary-dark: #08305c;
  --primary-light: #1a6ca6;
  --secondary: #f8b739;
  --accent: #2b9348;
  --text: #333333;
  --text-light: #666666;
  --text-lighter: #888888;
  --background: #ffffff;
  --background-alt: #f8f9fa;
  --background-dark: #1a1a1a;
  --border: #e0e0e0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --transition: all 0.3s ease;
  
  /* Additional variables for compatibility */
  --primary-color: #0c4b7d;
  --secondary-color: #f8b739;
  --text-dark: #333333;
}

/* Fix container spacing issues */
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

.blog-header {
  padding: 150px 0 80px;
  background: var(--background-alt);
  text-align: center;
}

.blog-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.blog-header p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

.blog-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 10px 20px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
  width: 100%;
  position: relative;
  min-height: 500px;
}

.blog-page {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  width: 100%;
}

.blog-page.active {
  display: grid;
  animation: fadeIn 0.5s ease;
}

.empty-page-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-page-message h3 {
  margin-bottom: 15px;
  color: var(--primary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.blog-post {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.blog-post:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.blog-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.blog-post:hover .blog-image img {
  transform: scale(1.05);
}

.blog-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--primary);
  color: white;
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
}

.blog-content {
  padding: 25px;
}

.blog-content h2 {
  margin-bottom: 15px;
}

.blog-content h2 a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.blog-content h2 a:hover {
  color: var(--primary-dark);
}

.read-more {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-top: 15px;
  transition: var(--transition);
}

.read-more:hover {
  color: var(--primary-dark);
  gap: 5px;
}

.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 15px;
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid var(--border);
  font-weight: 500;
}

.page-link.prev,
.page-link.next {
  padding: 0 20px;
}

.page-link:hover,
.page-link.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.page-link.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Blog Post Styles */
.blog-post-header {
  padding: 150px 0 60px;
  background: var(--background-alt);
}

.breadcrumb {
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb span {
  color: var(--text-light);
}

.blog-post-header h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.author {
  display: flex;
  align-items: center;
  gap: 15px;
}

.author img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.author div {
  display: flex;
  flex-direction: column;
}

.author span:first-child {
  font-weight: 600;
}

.author span:last-child {
  font-size: 0.9rem;
  color: var(--text-light);
}

.share-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.share-buttons a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: var(--transition);
}

.share-buttons a:hover {
  background: var(--primary-dark);
  transform: translateY(-3px);
}

.blog-post-content {
  padding: 60px 0;
  width: 100%;
}

.blog-post-content .container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

.blog-post-image {
  margin-bottom: 40px;
}

.blog-post-image img {
  width: 100%;
  border-radius: var(--radius);
}

.content {
  min-width: 0; /* Prevents overflow issues */
  width: 100%;
}

.content h2 {
  margin: 40px 0 20px;
}

.content ul {
  margin-bottom: 20px;
  padding-left: 20px;
}

.content li {
  margin-bottom: 10px;
}

.conclusion {
  background: var(--background-alt);
  padding: 30px;
  border-radius: var(--radius);
  margin: 40px 0;
}

.blog-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 40px 0;
}

.blog-tags a {
  padding: 5px 15px;
  background: var(--background-alt);
  color: var(--text);
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.blog-tags a:hover {
  background: var(--primary);
  color: white;
}

.blog-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 40px 0;
}

.blog-navigation a {
  padding: 20px;
  background: var(--background-alt);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
  border: 1px solid transparent;
}

.blog-navigation a:hover {
  background: white;
  border-color: var(--primary);
  transform: translateY(-3px);
}

.blog-navigation .prev,
.blog-navigation .next {
  display: flex;
  flex-direction: column;
}

.blog-navigation .next {
  align-items: flex-end;
  text-align: right;
}

.blog-navigation span {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 5px;
}

.blog-navigation h3 {
  font-size: 1.2rem;
  margin: 0;
  color: var(--primary);
}

.sidebar {
  position: sticky;
  top: 100px;
  width: 300px;
}

.sidebar-widget {
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
}

.sidebar-widget h3 {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.author-bio {
  text-align: center;
}

.author-bio img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
}

.author-bio h4 {
  margin-bottom: 10px;
}

.author-bio p {
  font-size: 0.9rem;
  color: var(--text-light);
}

.sidebar-widget ul {
  list-style: none;
}

.sidebar-widget ul li {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.sidebar-widget ul li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sidebar-widget ul li a {
  display: flex;
  justify-content: space-between;
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.sidebar-widget ul li a:hover {
  color: var(--primary);
}

.sidebar-widget ul li a span {
  color: var(--text-light);
}

.popular-articles article {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.popular-articles article:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.popular-articles article img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius);
}

.popular-articles article div {
  flex: 1;
}

.popular-articles article h4 {
  font-size: 1rem;
  margin-bottom: 5px;
}

.popular-articles article h4 a {
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.popular-articles article h4 a:hover {
  color: var(--primary);
}

.popular-articles article span {
  font-size: 0.8rem;
  color: var(--text-light);
}

.cta-widget {
  text-align: center;
  background: var(--primary);
  color: white;
}

.cta-widget h3 {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.cta-widget p {
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.cta-widget .btn {
  background: white;
  color: var(--primary);
}

.cta-widget .btn:hover {
  background: var(--secondary);
}

/* Blog enhancements - Additional styles */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: var(--primary-color);
  z-index: 9999;
  transition: width 0.2s ease;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  color: white;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  z-index: 10000;
  max-width: 300px;
}

.notification.show {
  opacity: 1;
  transform: translateX(0);
}

.notification.success {
  background: #4CAF50;
}

.notification.error {
  background: #F44336;
}

.table-of-contents {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 5px;
  margin-bottom: 30px;
  border-left: 4px solid var(--primary-color);
}

.table-of-contents h3 {
  margin-top: 0;
  color: var(--primary-color);
}

.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.table-of-contents li {
  margin-bottom: 10px;
}

.table-of-contents a {
  text-decoration: none;
  color: var(--text-dark);
  transition: color 0.3s ease;
  display: block;
  padding: 5px 0;
}

.table-of-contents a:hover {
  color: var(--primary-color);
}

.table-of-contents a.h2 {
  font-weight: 600;
  padding-left: 0;
}

.table-of-contents a.h3 {
  font-weight: 500;
  padding-left: 15px;
  font-size: 0.9em;
}

.reading-time {
  display: flex;
  align-items: center;
  margin-top: 10px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.reading-time i {
  margin-right: 8px;
  color: var(--primary-color);
}

/* Responsive Design for Blog */
@media (max-width: 992px) {
  .blog-post-content .container {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .sidebar {
    position: relative;
    top: 0;
    width: 100%;
    order: -1;
  }
}

@media (max-width: 768px) {
  .blog-header {
    padding: 120px 0 60px;
  }
  
  .blog-header h1 {
    font-size: 2.5rem;
  }
  
  .blog-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .blog-navigation {
    grid-template-columns: 1fr;
  }
  
  .blog-pagination {
    gap: 5px;
  }
  
  .page-link {
    min-width: 35px;
    height: 35px;
    padding: 0 10px;
    font-size: 0.9rem;
  }
  
  .page-link.prev,
  .page-link.next {
    padding: 0 15px;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .blog-header h1 {
    font-size: 2rem;
  }
  
  .blog-post-header h1 {
    font-size: 2rem;
  }
  
  .blog-filters {
    flex-direction: column;
    align-items: center;
  }
  
  .filter-btn {
    width: 100%;
    text-align: center;
  }
  
  .blog-grid,
  .blog-page {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .blog-pagination {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 10px;
  }
  
  .blog-pagination::-webkit-scrollbar {
    height: 5px;
  }
  
  .blog-pagination::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
  }
}