

/* Blog listing page styles */
.blog-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px; /* Normal padding, will scroll naturally */
  position: relative;
  z-index: 1; /* Below header (which is z-index: 100) */
}

.blog-header {
  text-align: center;
  margin-bottom: 60px;
  padding-top: var(--header-height, 6rem); /* Use same height as sticky header */
  position: relative; /* Ensure it's not sticky */
  z-index: 1; /* Below header (which is z-index: 100) */
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.blog-card {
  background: white;
  border-radius: 12px;
  overflow: visible; /* Allow Featured badge to show */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e5e7eb;
  position: relative; /* For positioning Featured badge */
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
}

.blog-card h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #1a1a1a;
  line-height: 1.3;
}

.blog-card h3 a {
  text-decoration: none;
  color: inherit;
}

.blog-card h3 a:hover {
  color: #4f46e5;
}

.blog-card .card-content {
  padding: 24px;
}

.blog-card .card-excerpt {
  color: #555;
  line-height: 1.6;
  margin-bottom: 16px;
}

.blog-meta {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.blog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.blog-tag {
  background: #f3f4f6;
  color: #6b7280;
  padding: 3px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none; /* Remove borders for cleaner look */
}

.blog-tag:hover {
  background: #e5e7eb;
  color: #4b5563;
}

.read-more {
  display: inline-block;
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid #4f46e5;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.read-more:hover {
  background: #4f46e5;
  color: white;
}

/* Featured blog card styles */
.blog-card.featured {
  border: 2px solid #4f46e5;
}

.blog-card.featured::before {
  content: "Featured";
  position: absolute;
  top: -10px;
  right: 20px;
  background: #4f46e5;
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}

/* Table of Contents Styles */
.table-of-contents {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px 20px;
  margin: 24px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.table-of-contents h3 {
  margin: 0 0 12px 0;
  color: #1a1a1a;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 2px solid #4f46e5;
  padding-bottom: 6px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin: 0;
  padding: 0;
}

.toc-list a {
  display: block;
  color: #4f46e5;
  text-decoration: none;
  padding: 4px 0;
  border-left: 3px solid transparent;
  padding-left: 12px;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.4;
}

.toc-list a:hover {
  color: #3f37c9;
  border-left-color: #4f46e5;
  background: rgba(79, 70, 229, 0.05);
  padding-left: 16px;
}

/* Indentation for different heading levels */
.toc-level-2 a {
  font-size: 0.9rem;
  margin-left: 0;
  font-weight: 500;
}

.toc-level-3 a {
  font-size: 0.85rem;
  margin-left: 16px;
  color: #666;
  font-weight: 400;
}

.toc-level-3 a:hover {
  color: #4f46e5;
}

@media (max-width: 768px) {
  .table-of-contents {
    padding: 12px 16px;
    margin: 16px 0;
  }
  
  .toc-level-2 a {
    font-size: 0.85rem;
    padding: 3px 0;
  }
  
  .toc-level-3 a {
    font-size: 0.8rem;
    padding: 3px 0;
    margin-left: 12px;
  }
}

/* Pagination Styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 60px 0 40px 0;
  flex-wrap: wrap;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn,
.pagination-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  text-decoration: none;
  color: #4f46e5;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: 44px;
  height: 44px;
}

.pagination-btn:hover,
.pagination-number:hover {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

.pagination-number.active {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

.pagination-ellipsis {
  padding: 10px 8px;
  color: #666;
  font-weight: 500;
}

@media (max-width: 768px) {
  .pagination {
    flex-direction: column;
    gap: 12px;
  }
  
  .pagination-numbers {
    order: 2;
  }
  
  .pagination-prev {
    order: 1;
  }
  
  .pagination-next {
    order: 3;
  }
}

@media (max-width: 768px) {
  .blog-page {
    padding: 20px 15px; /* Normal mobile padding */
  }
  .blog-header {
    padding-top: var(--header-height, 6rem); /* Use same spacing on mobile */
  }
}

/* Blog Widget Styles - for sidebar/footer widgets on other pages */
.blog-widget {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 24px;
  margin: 60px auto 40px auto; /* Center the widget and add spacing */
  border: 1px solid #e5e7eb;
  max-width: 1200px; /* Match page container width */
}

.blog-widget h3 {
  color: #1a1a1a;
  margin-bottom: 20px;
  font-size: 1.3rem;
  font-weight: 600;
}

.blog-widget-posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-widget-post {
  background: white;
  padding: 16px;
  border-radius: 6px;
  border-left: 4px solid #4f46e5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.blog-widget-post:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.blog-widget-post h4 {
  margin: 0 0 8px 0;
  font-size: 1rem;
  line-height: 1.3;
}

.blog-widget-post h4 a {
  text-decoration: none;
  color: #1a1a1a;
}

.blog-widget-post h4 a:hover {
  color: #4f46e5;
}

.blog-widget-meta {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 8px;
}

.blog-widget-excerpt {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
  margin-bottom: 8px;
}

.blog-widget-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.blog-widget-tag {
  background: #f3f4f6;
  color: #6b7280;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: lowercase;
}

.blog-widget-more {
  text-align: center;
  margin-top: 20px;
}

.blog-widget-more a {
  display: inline-block;
  background: #4f46e5;
  color: white;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease;
}

.blog-widget-more a:hover {
  background: #3f37c9;
}

/* Ensure no white backgrounds or borders in blog area */
.blog-post,
.blog-post-header,
.blog-post-meta,
.blog-post-content,
.blog-post-tags,
article.blog-post {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Aggressively remove any borders from blog header area */
.blog-post-header *,
.blog-post-header,
.blog-post-meta *,
.blog-post-meta,
.blog-post-tags *,
.blog-post-tags,
header.blog-post-header {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Remove any pseudo-element borders */
.blog-post-header *::before,
.blog-post-header *::after,
.blog-post-meta *::before,
.blog-post-meta *::after,
.blog-post-tags *::before,
.blog-post-tags *::after {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Individual Blog Post Styles */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding: 0; /* Remove padding that might create frame effect */
  position: relative;
  z-index: 1; /* Below header (which is z-index: 100) */
  border: none; /* Ensure no borders */
  box-shadow: none; /* Ensure no shadows */
}

.blog-post-header {
  text-align: left;
  margin-bottom: 32px;
  padding: 40px 20px 0 20px; /* Add padding to header for spacing */
  border-bottom: none;
  position: relative; /* Ensure it scrolls naturally, not sticky */
  z-index: 1; /* Below header (which is z-index: 100) */
  background: transparent !important; /* Force no white background */
}

.blog-post-header h1 {
  font-size: 2rem;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.3;
  font-weight: 700;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.blog-post-meta .date,
.blog-post-meta .author {
  display: flex;
  align-items: center;
  gap: 6px;
}

.blog-post-meta .date::before {
  content: "";
}

.blog-post-meta .author::before {
  content: "";
}

.blog-post-meta .date::after {
  content: "•";
  margin-left: 8px;
  color: #d1d5db;
}

.blog-post-tags {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
  border: none !important;
  background: transparent !important;
  padding: 0;
}

.blog-post-content {
  line-height: 1.7;
  font-size: 1.1rem;
  color: #333;
  padding: 0 20px 40px 20px; /* Add padding to content for spacing */
}

.blog-post-content h2 {
  color: #1a1a1a;
  margin-top: 40px;
  margin-bottom: 16px;
  font-size: 1.8rem;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 8px;
}

.blog-post-content hr {
  border: none;
  border-bottom: 2px solid #f0f0f0;
  margin: 32px 0;
  background: none;
}

.blog-post-content h3 {
  color: #1a1a1a;
  margin-top: 32px;
  margin-bottom: 12px;
  font-size: 1.4rem;
}

.blog-post-content h4 {
  color: #1a1a1a;
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.blog-post-content p {
  margin-bottom: 20px;
}

.blog-post-content ul, 
.blog-post-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.blog-post-content li {
  margin-bottom: 8px;
}

.blog-post-content pre {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 20px 0;
  font-size: 0.9rem;
}

.blog-post-content code {
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Monaco', 'Consolas', 'SF Mono', monospace;
  font-size: 0.9em;
  color: #d73a49;
}

.blog-post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.blog-post-content blockquote {
  border-left: 4px solid #4f46e5;
  padding-left: 20px;
  margin: 24px 0;
  font-style: italic;
  color: #555;
  background: #f8f9fb;
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
}

.blog-post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.95rem;
}

.blog-post-content table th,
.blog-post-content table td {
  border: 1px solid #e5e7eb;
  padding: 12px;
  text-align: left;
}

.blog-post-content table th {
  background: #f8f9fa;
  font-weight: 600;
}

.blog-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 30px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.blog-post-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 30px rgba(0,0,0,0.15);
}

/* Image captions from alt text */
.blog-post-content img[title]:after {
  content: attr(title);
  display: block;
  text-align: center;
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Figure styling for images with captions */
.blog-post-content figure {
  margin: 30px 0;
  text-align: center;
}

.blog-post-content figure img {
  margin: 0;
}

.blog-post-content figcaption {
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
  margin-top: 12px;
  line-height: 1.4;
}

/* Image galleries */
.blog-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.blog-image-gallery img {
  margin: 0;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 16/10;
}

/* Responsive image adjustments */
@media (max-width: 768px) {
  .blog-post-content img {
    margin: 20px 0;
    border-radius: 6px;
  }
  
  .blog-image-gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }
}

.blog-post-content a {
  color: #4f46e5;
  text-decoration: none;
}

.blog-post-content a:hover {
  text-decoration: underline;
}

/* Blog Navigation */
.blog-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 40px 0;
  padding: 20px 20px 0 20px; /* Add horizontal padding to match content */
  border-top: none; /* Remove border to match clean design */
}

.blog-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4f46e5;
  text-decoration: none;
  font-weight: 500;
}

.blog-nav-link:hover {
  text-decoration: underline;
}

.blog-nav-prev::before {
  content: "←";
}

.blog-nav-next::after {
  content: "→";
}

/* Highlight.js theme override */
.hljs {
  background: #f8f9fa !important;
  color: #333 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-post {
    padding: 20px 15px; /* Normal mobile padding */
  }
  
  .blog-post-header h1 {
    font-size: 1.75rem;
    line-height: 1.25;
  }
  
  .blog-post-meta {
    flex-direction: row;
    gap: 8px;
    font-size: 0.8rem;
  }
  
  .blog-widget {
    margin: 20px auto;
    padding: 16px;
    max-width: calc(100vw - 40px); /* Respect mobile margins */
  }
  
  .blog-post-content {
    font-size: 1rem;
  }
  
  .blog-post-content h2 {
    font-size: 1.5rem;
  }
  
  .blog-post-content h3 {
    font-size: 1.2rem;
  }
  
  .blog-post-content pre {
    padding: 12px;
    font-size: 0.85rem;
  }
  
  .blog-navigation {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .blog-post-content ul,
  .blog-post-content ol {
    padding-left: 16px;
  }
  
  .blog-post-content table {
    font-size: 0.8rem;
  }
  
  .blog-post-content table th,
  .blog-post-content table td {
    padding: 8px;
  }
}

/* Print styles */
@media print {
  .blog-widget,
  .blog-navigation {
    display: none;
  }
  
  .blog-post {
    padding: 0;
    max-width: none;
  }
  
  .blog-post-content {
    font-size: 12pt;
    line-height: 1.5;
  }
  
  .blog-post-content a {
    color: #000;
    text-decoration: underline;
  }
} 