/* ==================== Child Theme - Blog Archive Page Styles ==================== */
/* 
 * Purpose: Blog list/archive page specific styles and overrides
 * 
 * Rules:
 * - Scope everything to body.blog, body.archive (for posts) to avoid cross-page impact
 * - Only define styles that are specific to blog archive pages
 */

/* Base styles for blog archive pages - no specific styles needed at body level */

/* ==================== Blog / Category Header ==================== */
body.blog .blog-header,
body.archive.post-type-archive-post .blog-header,
body.category .blog-category-header,
.blog-category-page .blog-category-header {
  margin-bottom: 0;
}

body.category .blog-category-title {
  margin-bottom: 20px;
}

body.category .blog-category-tabs,
.blog-category-page .blog-category-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 10px;
  margin-bottom: 30px;
}

body.category .blog-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #f5f5f5;
  color: var(--body-text-color, #333);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

body.category .blog-category-tab:hover {
  background: #e0e0e0;
}

body.category .blog-category-tab--active {
  background: var(--accent-color, #FF9933);
  color: #fff;
}

body.category .blog-category-tab__count {
  opacity: 0.8;
}

/* ==================== Blog Posts Grid ==================== */
body.blog .blog-posts-grid,
body.archive.post-type-archive-post .blog-posts-grid,
body.archive .blog-posts-grid,
body.category .blog-posts-grid,
.blog-category-page .blog-posts-grid,
.archive-page .blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  margin-top: 80px;
  margin-bottom: 40px;
}

body.blog .blog-post-card,
body.archive.post-type-archive-post .blog-post-card,
body.archive .blog-post-card,
body.category .blog-post-card,
.blog-category-page .blog-post-card,
.archive-page .blog-post-card {
  padding: 0;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

body.blog .blog-post-card:hover,
body.archive.post-type-archive-post .blog-post-card:hover,
body.archive .blog-post-card:hover,
body.category .blog-post-card:hover,
.blog-category-page .blog-post-card:hover,
.archive-page .blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

body.blog .blog-post-card__thumbnail,
body.archive.post-type-archive-post .blog-post-card__thumbnail,
body.archive .blog-post-card__thumbnail,
body.category .blog-post-card__thumbnail,
.blog-category-page .blog-post-card__thumbnail,
.archive-page .blog-post-card__thumbnail {
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #f5f5f5;
}

body.blog .blog-post-card__thumbnail a,
body.archive.post-type-archive-post .blog-post-card__thumbnail a,
body.archive .blog-post-card__thumbnail a,
body.category .blog-post-card__thumbnail a,
.blog-category-page .blog-post-card__thumbnail a,
.archive-page .blog-post-card__thumbnail a {
  display: block;
  width: 100%;
  height: 100%;
}

body.blog .blog-post-card__image,
body.archive.post-type-archive-post .blog-post-card__image,
body.archive .blog-post-card__image,
body.category .blog-post-card__image,
.blog-category-page .blog-post-card__image,
.archive-page .blog-post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

body.blog .blog-post-card__placeholder,
body.archive.post-type-archive-post .blog-post-card__placeholder,
body.archive .blog-post-card__placeholder,
body.category .blog-post-card__placeholder,
.blog-category-page .blog-post-card__placeholder,
.archive-page .blog-post-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--body-text-color, #999);
  font-size: 14px;
  background-color: #f5f5f5;
}

body.blog .blog-post-card__placeholder,
body.archive.post-type-archive-post .blog-post-card__placeholder,
body.archive .blog-post-card__placeholder,
body.category .blog-post-card__placeholder,
.blog-category-page .blog-post-card__placeholder,
.archive-page .blog-post-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--body-text-color, #999);
  font-size: 14px;
  background-color: #f5f5f5;
}

body.blog .blog-post-card:hover .blog-post-card__image,
body.archive.post-type-archive-post:hover .blog-post-card__image,
body.archive .blog-post-card:hover .blog-post-card__image,
body.category .blog-post-card:hover .blog-post-card__image,
.blog-category-page .blog-post-card:hover .blog-post-card__image,
.archive-page .blog-post-card:hover .blog-post-card__image {
  transform: scale(1.05);
}

body.blog .blog-post-card__body,
body.archive.post-type-archive-post .blog-post-card__body,
body.archive .blog-post-card__body,
body.category .blog-post-card__body,
.blog-category-page .blog-post-card__body,
.archive-page .blog-post-card__body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

body.blog .blog-post-card__categories,
body.archive.post-type-archive-post .blog-post-card__categories,
body.archive .blog-post-card__categories,
body.category .blog-post-card__categories,
.blog-category-page .blog-post-card__categories,
.archive-page .blog-post-card__categories {
  margin-bottom: 10px;
}

body.blog .blog-post-card__category,
body.archive.post-type-archive-post .blog-post-card__category,
body.archive .blog-post-card__category,
body.category .blog-post-card__category,
.blog-category-page .blog-post-card__category,
.archive-page .blog-post-card__category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e3f2fd;
  color: #1976d2;
  font-size: 11px;
  margin-right: 6px;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

body.blog .blog-post-card__title,
body.archive.post-type-archive-post .blog-post-card__title,
body.archive .blog-post-card__title,
body.category .blog-post-card__title,
.blog-category-page .blog-post-card__title,
.archive-page .blog-post-card__title {
  font-size: 18px;
  line-height: 1.4;
  margin: 8px 0 12px;
  font-weight: 700;
}

body.blog .blog-post-card__title a,
body.archive.post-type-archive-post .blog-post-card__title a,
body.archive .blog-post-card__title a,
body.category .blog-post-card__title a,
.blog-category-page .blog-post-card__title a,
.archive-page .blog-post-card__title a {
  color: var(--heading-primary-color, #1B3A5F);
  text-decoration: none;
}

body.blog .blog-post-card__title a:hover,
body.archive.post-type-archive-post .blog-post-card__title a:hover,
body.archive .blog-post-card__title a:hover,
body.category .blog-post-card__title a:hover,
.blog-category-page .blog-post-card__title a:hover,
.archive-page .blog-post-card__title a:hover {
  color: var(--accent-color, #FF9933);
}

body.blog .blog-post-card__excerpt,
body.archive.post-type-archive-post .blog-post-card__excerpt,
body.archive .blog-post-card__excerpt,
body.category .blog-post-card__excerpt,
.blog-category-page .blog-post-card__excerpt,
.archive-page .blog-post-card__excerpt {
  font-size: 14px;
  color: var(--body-text-color, #666);
  line-height: 1.6;
  margin-bottom: 12px;
  flex: 1;
}

/* ==================== Blog Post Meta ==================== */
body.blog .post-meta,
body.archive.post-type-archive-post .post-meta,
body.archive .post-meta,
body.category .post-meta,
.blog-category-page .post-meta,
.archive-page .post-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: auto;
  font-size: 14px;
  color: var(--body-text-color, #666);
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.blog .post-date,
body.archive.post-type-archive-post .post-date,
body.archive .post-date,
body.category .post-date,
.blog-category-page .post-date,
.archive-page .post-date {
  color: var(--body-text-color, #666);
}

body.blog .post-author,
body.archive.post-type-archive-post .post-author,
body.archive .post-author,
body.category .post-author,
.blog-category-page .post-author,
.archive-page .post-author {
  color: var(--body-text-color, #666);
}

body.blog .post-category,
body.archive.post-type-archive-post .post-category,
body.archive .post-category {
  color: var(--accent-color, #FF9933);
}

/* ==================== Blog Sidebar ==================== */
body.blog .blog-sidebar,
body.archive.post-type-archive-post .blog-sidebar {
  margin-top: 40px;
}

/* ==================== Archive Header ==================== */
.archive-page .archive-header {
  margin-bottom: 40px;
}

.archive-page .archive-title {
  margin-bottom: 20px;
}

.archive-page .archive-description {
  color: var(--body-text-color, #666);
  line-height: 1.6;
}

/* ==================== Blog Pagination ==================== */
.blog-pagination,
body.category .blog-pagination,
.archive-page .blog-pagination {
  margin-top: 40px;
  text-align: center;
  display: flex;
  justify-content: center;
  width: 100%;
}

.blog-pagination ul,
body.category .blog-pagination ul,
.archive-page .blog-pagination ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.blog-pagination li,
body.category .blog-pagination li,
.archive-page .blog-pagination li {
  display: inline-block;
}

.blog-pagination a,
.blog-pagination span,
body.category .blog-pagination a,
body.category .blog-pagination span,
.archive-page .blog-pagination a,
.archive-page .blog-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 4px;
  background: #f5f5f5;
  color: var(--body-text-color, #333);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.blog-pagination a:hover,
.archive-page .blog-pagination a:hover {
  background: var(--accent-color, #FF9933);
  color: #fff;
}

.blog-pagination .current,
body.category .blog-pagination .current,
.archive-page .blog-pagination .current {
  background: var(--accent-color, #FF9933);
  color: #fff;
}

body.category .blog-category-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--body-text-color, #777);
}

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
  body.blog .blog-posts-grid,
  body.archive.post-type-archive-post .blog-posts-grid,
  body.archive .blog-posts-grid,
  body.category .blog-posts-grid,
  .blog-category-page .blog-posts-grid,
  .archive-page .blog-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body.blog .blog-posts-grid,
  body.archive.post-type-archive-post .blog-posts-grid,
  body.archive .blog-posts-grid,
  body.category .blog-posts-grid,
  .blog-category-page .blog-posts-grid,
  .archive-page .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
