/* ==========================================================================
   BLOG INDEX & ARCHIVE STYLES (index.php & archive.php)
   ========================================================================== */

.blog-index-page {
  background: #fff;
}

.blog-index-section {
  padding: 60px 0 100px;
}

.blog-index-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 60px;
  align-items: start;
}

/* Left Sidebar - Category Filter */
.blog-filter-sidebar {
  position: sticky;
  top: 100px;
}

.filter-sticky-wrapper {
  display: flex;
  flex-direction: column;
}

.category-filter-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-link {
  padding: 10px 16px;
  color: #999;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.3s ease;
  display: block;
}

.filter-link:hover {
  color: #333;
  background: #f8f9fa;
}

.filter-link.active {
  color: #39a63d;
  font-weight: 600;
  background: rgba(162, 212, 94, 0.05);
}

/* Blog Posts Area */
.blog-posts-area {
  min-width: 0;
}

/* Featured Post (First Post - Large) */
.blog-post-featured {
  margin-bottom: 50px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post-featured:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.post-featured-image {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #f0f0f0;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-post-featured:hover .post-featured-image img {
  transform: scale(1.05);
}

.post-featured-content {
  padding: 35px 40px;
}

.post-featured-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 15px 0;
}

.post-featured-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-featured-title a:hover {
  color: #39a63d;
}

.post-featured-excerpt {
  font-size: 16px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 20px 0;
}

.post-featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #999;
}

.post-featured-meta .meta-separator {
  color: #ddd;
}

.meta-reading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: #39a63d;
}

.reading-indicator {
  width: 8px;
  height: 8px;
  background: #39a63d;
  border-radius: 50%;
  display: inline-block;
}

/* Blog Posts Grid (3 columns) */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.blog-post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.post-card-image {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #f0f0f0;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.blog-post-card:hover .post-card-image img {
  transform: scale(1.05);
}

.post-card-content {
  padding: 25px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px 0;
}

.post-card-title a {
  color: #1a1a1a;
  text-decoration: none;
  transition: color 0.3s ease;
}

.post-card-title a:hover {
  color: #39a63d;
}

.post-card-excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 20px 0;
  flex: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #999;
  margin-top: auto;
}

.post-card-meta .meta-separator {
  color: #ddd;
}

/* Blog Index Header */
.blog-index-header {
  margin-bottom: 48px;
}

.blog-index-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 12px;
  line-height: 1.2;
}

.blog-index-subtitle {
  font-size: 17px;
  color: #666;
  line-height: 1.6;
  margin: 0;
  max-width: 560px;
}

/* Archive Title Inline */
.archive-header-inline {
  margin-bottom: 40px;
}

.archive-title-inline {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  padding-bottom: 15px;
  border-bottom: 2px solid #39a63d;
  display: inline-block;
}

/* Pagination */
.blog-index-pagination {
  margin-top: 60px;
  display: flex;
  justify-content: center;
}

.blog-index-pagination .page-numbers {
  display: flex;
  justify-content: center;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-index-pagination .page-numbers li {
  display: inline-block;
}

.blog-index-pagination a.page-numbers,
.blog-index-pagination span.page-numbers {
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-block;
}

.blog-index-pagination a.page-numbers {
  background: #fff;
  color: #1a1a1a;
  border: 2px solid #e5e7eb;
}

.blog-index-pagination a.page-numbers:hover {
  background: #39a63d;
  color: #fff;
  border-color: #39a63d;
  transform: translateY(-2px);
}

.blog-index-pagination span.current {
  background: #39a63d;
  color: #fff;
  border: 2px solid #39a63d;
}

/* No Posts Found */
.no-posts-found {
  text-align: center;
  padding: 80px 20px;
}

.no-posts-found p {
  font-size: 18px;
  color: #666;
}

/* Responsive */
@media (max-width: 1200px) {
  .blog-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .blog-index-section {
    padding: 40px 0 80px;
  }

  .blog-index-layout {
    grid-template-columns: 150px 1fr;
    gap: 40px;
  }

  .filter-link {
    font-size: 14px;
    padding: 8px 12px;
  }

  .post-featured-title {
    font-size: 24px;
  }

  .post-featured-content {
    padding: 25px 30px;
  }

  .post-card-content {
    padding: 20px;
  }

  .category-filter-nav {
    gap: 6px;
  }

  .filter-link {
    font-size: 13px;
    padding: 6px 12px;
  }

  .blog-index-pagination a.page-numbers,
  .blog-index-pagination span.page-numbers {
    padding: 8px 14px;
    font-size: 13px;
  }

  .archive-title-inline {
    font-size: 28px;
  }
}

/* TABLET BREAKPOINT */
@media (max-width: 768px) {
  .blog-index-section {
    padding: 30px 0 60px;
  }

  /* Stack sidebar on top */
  .blog-index-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .blog-filter-sidebar {
    position: static;
    top: 0;
  }

  /* Make category filter horizontal on tablet */
  .category-filter-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .filter-link {
    font-size: 13px;
    padding: 8px 16px;
  }

  /* Single column grid for cards */
  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  /* Adjust featured post */
  .blog-post-featured {
    margin-bottom: 40px;
  }

  .post-featured-content {
    padding: 20px 25px;
  }

  .post-featured-title {
    font-size: 22px;
    margin-bottom: 12px;
  }

  .post-featured-excerpt {
    font-size: 15px;
    margin-bottom: 15px;
  }

  .post-featured-meta {
    font-size: 13px;
    gap: 10px;
  }

  .meta-reading {
    margin-left: 0;
  }

  /* Archive header */
  .blog-index-header {
    margin-bottom: 36px;
  }

  .blog-index-subtitle {
    font-size: 15px;
  }

  .archive-header-inline {
    margin-bottom: 30px;
  }

  .archive-title-inline {
    font-size: 26px;
    padding-bottom: 12px;
  }

  /* Pagination */
  .blog-index-pagination {
    margin-top: 40px;
  }

  .blog-index-pagination a.page-numbers,
  .blog-index-pagination span.page-numbers {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* MOBILE BREAKPOINT */
@media (max-width: 480px) {
  .blog-index-section {
    padding: 20px 0 40px;
  }

  .blog-index-layout {
    gap: 20px;
  }

  /* Category filter mobile */
  .category-filter-nav {
    gap: 6px;
  }

  .filter-link {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Featured post mobile */
  .blog-post-featured {
    margin-bottom: 30px;
    border-radius: 12px;
  }

  .post-featured-image {
    aspect-ratio: 16/10;
  }

  .post-featured-content {
    padding: 18px 20px;
  }

  .post-featured-title {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .post-featured-excerpt {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .post-featured-meta {
    font-size: 12px;
    gap: 8px;
  }

  /* Card grid */
  .blog-posts-grid {
    gap: 20px;
  }

  .post-card-content {
    padding: 18px;
  }

  .post-card-title {
    font-size: 17px;
    margin-bottom: 10px;
  }

  .post-card-excerpt {
    font-size: 13px;
    margin-bottom: 15px;
  }

  .post-card-meta {
    font-size: 12px;
    gap: 6px;
  }

  /* Archive title */
  .blog-index-header {
    margin-bottom: 28px;
  }

  .blog-index-subtitle {
    font-size: 14px;
  }

  .archive-header-inline {
    margin-bottom: 25px;
  }

  .archive-title-inline {
    font-size: 24px;
    padding-bottom: 10px;
  }

  /* Pagination mobile */
  .blog-index-pagination {
    margin-top: 30px;
  }

  .blog-index-pagination .page-numbers {
    gap: 6px;
  }

  .blog-index-pagination a.page-numbers,
  .blog-index-pagination span.page-numbers {
    padding: 8px 10px;
    font-size: 12px;
    min-width: 36px;
    text-align: center;
  }

  /* No posts message */
  .no-posts-found {
    padding: 60px 15px;
  }

  .no-posts-found p {
    font-size: 16px;
  }
}