/* ============================================
   BLOG ARCHIVE - FIGMA MATCH v3.0
   Font & Color Migration
   Dev: Paul .Y 20260202

   v3.0: Roboto → Afacad Flux, all colors → Figma tokens
         Tab active: #928572 (bg-Primary)
         Pagination: #928572 (Primary)
         Card text: #2A2A2A (Dark-Text)
   v2.1: Centered tabs, fixed image height
   v2.0: Initial Figma match
   ============================================ */


/* ===================================
   CSS VARIABLES (Figma Design Tokens)
   =================================== */

:root {
    --blog-dark-text: #2A2A2A;   /* Dark-Text — titles, body, badges */
    --blog-light-text: #666666;  /* Light-Text — date, excerpt, secondary */
    --blog-primary: #928572;     /* Primary — tabs, pagination, interactive */
    --blog-600: #928A80;         /* text-600 — inactive tab text */
    --blog-400: #CCC8C0;         /* outline-400 — dividers */
    --blog-200: #EFEDEB;         /* bg-200 — tab bg, breadcrumb bg */
    --blog-100: #FAF9F7;         /* bg-100 — light bg sections */
    --blog-white: #FFFFFF;
}


/* ===================================
   PAGE HEADER (Beige Background)
   Title + Description
   =================================== */

.blog-archive-header {
    background: var(--blog-200);
    padding: 60px 0 30px 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.blog-header-container {
    max-width: 1440px;
    width: 100%;
    padding: 0 101px;
}

.blog-page-title {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 36px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--blog-dark-text);
    margin: 0 0 10px 0;
}

.blog-page-description {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--blog-light-text);
    margin: 0;
    max-width: 731px;
}


/* ===================================
   PILL-STYLE CATEGORY TABS
   Figma: inline-flex gap-2.5 (10px), centered
   Active: bg-Primary text-White
   Inactive: bg-200 text-600
   =================================== */

.blog-filter-section {
    background: var(--blog-white);
    padding: 30px 0 40px 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.blog-filter-container {
    max-width: 1440px;
    width: 100%;
    padding: 0 101px;
    display: flex;
    justify-content: center;
}

.blog-category-filters {
    display: flex;
    gap: 10px;  /* gap-2.5 */
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

/* Pill Tab Base — Afacad Flux 14px 400, bg-200, text-600 */
.category-filter-tab {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;  /* text-sm */
    font-weight: 400;  /* font-normal */
    color: var(--blog-600);  /* text-600 #928A80 */
    text-decoration: none;
    text-transform: capitalize;
    padding: 10px 20px;  /* px-5 py-2.5 */
    background: var(--blog-200);  /* bg-200 */
    border-radius: 50px;  /* rounded-[50px] */
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

/* Pill Tab Hover */
.category-filter-tab:hover {
    background: #E0DDD8;
    color: #2A2A2A;
}

/* Pill Tab Active — bg-Primary + text-White */
.category-filter-tab.active {
    background: var(--blog-primary);  /* #928572 */
    color: var(--blog-white);
    font-weight: 400;
}

.category-filter-tab.active:hover {
    background: #7A7062;
    color: var(--blog-white);
}


/* ===================================
   BLOG POSTS SECTION (White Background)
   =================================== */

.blog-posts-section {
    background: var(--blog-white);
    padding: 80px 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.blog-posts-container {
    max-width: 1440px;
    width: 100%;
    padding: 0 80px;
}


/* ===================================
   BLOG POSTS GRID
   Figma: w-[1280px] gap-7 (28px) rows, gap-5 (20px) cols
   =================================== */

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 400px);
    gap: 28px 20px;  /* gap-7 gap-5 */
    margin-bottom: 60px;
    justify-content: center;
}


/* ===================================
   BLOG CARD
   Figma: w-96 gap-7 (28px) between content & image
   =================================== */

.blog-card {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: 28px;  /* gap-7 */
    position: relative;
}

/* Vertical Divider Lines — outline-400 (#CCC8C0) */
.blog-card:nth-child(3n+2)::before,
.blog-card:nth-child(3n)::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--blog-400);
}

/* Card Content Section (TOP) — gap-2.5 (10px) */
.blog-card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;  /* gap-2.5 */
    order: 1;
}

/* Meta Row: Date (left) + Category Tag (right) */
.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Date — Afacad Flux 14px 300 Light-Text */
.blog-card-date {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;  /* text-sm */
    font-weight: 300;  /* font-light */
    color: var(--blog-light-text);  /* #666666 */
    font-style: normal;
}

/* Category Tag — Afacad Flux 12px 400 Dark-Text, border Dark-Text */
.blog-card-category {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;  /* text-xs */
    font-weight: 400;  /* font-normal */
    color: var(--blog-dark-text);  /* #2A2A2A */
    padding: 5px 10px;  /* py-[5px] px-2.5 */
    border: 0.5px solid var(--blog-dark-text);  /* outline-Dark-Text */
    border-radius: 0;
    background: transparent;
    white-space: nowrap;
}

/* Title & Excerpt — gap-[5px] (5px) */
.blog-card-title-section {
    display: flex;
    flex-direction: column;
    gap: 5px;  /* gap-[5px] */
}

/* Post Title — Afacad Flux 24px 400 Dark-Text capitalize */
.blog-card-title {
    margin: 0;
}

.blog-card-title a {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 24px;  /* text-2xl */
    font-weight: 400;  /* font-normal */
    line-height: 1.3;
    color: var(--blog-dark-text);  /* #2A2A2A */
    text-decoration: none;
    text-transform: capitalize;
    transition: color 0.3s ease;
    display: block;
}

.blog-card-title a:hover {
    color: var(--blog-light-text);
}

/* Excerpt — Afacad Flux 18px 300 Light-Text */
.blog-card-excerpt {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;  /* text-lg */
    font-weight: 300;  /* font-light */
    line-height: 1.3;
    color: var(--blog-light-text);  /* #666666 */
    margin: 0;
}


/* ===================================
   BLOG CARD IMAGE (BOTTOM)
   Figma: self-stretch h-80 (320px)
   Using 350px to match current crop size
   =================================== */

.blog-card-image {
    width: 400px !important;
    height: 350px !important;
    min-height: 350px !important;
    max-height: 350px !important;
    overflow: hidden !important;
    order: 2;
    flex-shrink: 0;
    position: relative;
}

.blog-card-image a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* Override Elementor img rules */
.blog-archive-shortcode .blog-card-image img,
.blog-archive-shortcode .blog-card-image img.blog-card-thumbnail,
.blog-card-image img,
.blog-card-image img.blog-card-thumbnail,
.blog-card-thumbnail,
.elementor .blog-card-image img,
.elementor-widget-container .blog-card-image img {
    width: 100% !important;
    height: 100% !important;
    min-height: 350px !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Hover zoom effect */
.blog-card:hover .blog-card-thumbnail {
    transform: scale(1.05);
}

.blog-card-image img {
    transition: transform 0.3s ease;
}


/* ===================================
   NO POSTS MESSAGE
   =================================== */

.no-blog-posts {
    text-align: center;
    padding: 80px 20px;
}

.no-blog-posts p {
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    color: var(--blog-light-text);
}


/* ===================================
   PAGINATION
   Figma: Afacad Flux 20px 400
   Active: bg-Primary text-White
   Inactive: outline-Primary text-Primary
   =================================== */

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

.blog-pagination .page-numbers {
    display: flex;
    gap: 10px;  /* gap-2.5 */
    list-style: none;
    padding: 0;
    margin: 0;
    align-items: center;
}

.blog-pagination .page-numbers li {
    list-style: none;
}

/* Pagination buttons — Afacad Flux 20px 400 */
.blog-pagination .page-numbers a,
.blog-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;  /* w-10 */
    height: 40px;  /* h-10 */
    padding: 6px 14px;  /* px-3.5 py-1.5 */
    font-family: 'Afacad Flux', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 20px;  /* text-xl */
    font-weight: 400;  /* font-normal */
    color: var(--blog-primary);  /* text-Primary #928572 */
    text-decoration: none;
    border: 1px solid var(--blog-primary);  /* outline-Primary */
    border-radius: 0;
    background: transparent;
    transition: all 0.3s ease;
}

.blog-pagination .page-numbers a:hover {
    background: var(--blog-primary);
    color: var(--blog-white);
}

/* Current/Active Page — bg-Primary text-White */
.blog-pagination .page-numbers .current {
    background: var(--blog-primary);
    color: var(--blog-white);
}

/* Dots (...) */
.blog-pagination .page-numbers .dots {
    border: none;
    min-width: auto;
    padding: 0;
    color: var(--blog-primary);
}

/* Prev/Next Arrows */
.blog-pagination .material-symbols-outlined {
    font-size: 20px;
}


/* ===================================
   RESPONSIVE: Tablet (1024px - 1279px)
   =================================== */

@media (max-width: 1279px) {
    .blog-header-container,
    .blog-filter-container,
    .blog-posts-container {
        padding: 0 60px;
    }

    .blog-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px 20px;
    }

    .blog-card {
        width: 100%;
    }

    .blog-card-image,
    .blog-archive-shortcode .blog-card-image {
        width: 100% !important;
        height: 300px !important;
        min-height: 300px !important;
        max-height: 300px !important;
    }

    .blog-archive-shortcode .blog-card-image img,
    .blog-card-image img {
        min-height: 300px !important;
    }
}


/* ===================================
   RESPONSIVE: Tablet Portrait (768px - 1023px)
   2 columns
   =================================== */

@media (max-width: 1023px) {
    .blog-header-container,
    .blog-filter-container,
    .blog-posts-container {
        padding: 0 40px;
    }

    .blog-page-title {
        font-size: 32px;
    }

    .blog-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px 20px;
    }

    .blog-card {
        width: 100%;
    }

    .blog-card-image,
    .blog-archive-shortcode .blog-card-image {
        width: 100% !important;
        height: 280px !important;
        min-height: 280px !important;
        max-height: 280px !important;
    }

    .blog-archive-shortcode .blog-card-image img,
    .blog-card-image img {
        min-height: 280px !important;
    }

    /* Remove 3-column dividers, add 2-column dividers */
    .blog-card:nth-child(3n+2)::before,
    .blog-card:nth-child(3n)::before {
        display: none;
    }

    .blog-card:nth-child(2n)::before {
        content: '';
        position: absolute;
        left: -10px;
        top: 0;
        bottom: 0;
        width: 1px;
        background: var(--blog-400);
    }
}


/* ===================================
   RESPONSIVE: Mobile (≤767px)
   1 column, no dividers
   =================================== */

@media (max-width: 767px) {
    .blog-archive-header {
        padding: 40px 0 20px 0;
    }

    .blog-header-container,
    .blog-filter-container,
    .blog-posts-container {
        padding: 0 20px;
    }

    .blog-page-title {
        font-size: 28px;
        margin-bottom: 10px;
    }

    .blog-page-description {
        font-size: 16px;
    }

    .blog-filter-section {
        padding: 20px 0 30px 0;
    }

    /* Horizontal scroll for tabs on mobile */
    .blog-category-filters {
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .category-filter-tab {
        font-size: 14px;
        padding: 8px 16px;
        flex-shrink: 0;
    }

    .blog-posts-section {
        padding: 50px 0;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        margin-bottom: 40px;
    }

    .blog-card {
        width: 100%;
    }

    .blog-card-image,
    .blog-archive-shortcode .blog-card-image {
        width: 100% !important;
        height: auto !important;
        min-height: unset !important;
        max-height: unset !important;
        aspect-ratio: 400 / 350;
    }

    .blog-archive-shortcode .blog-card-image img,
    .blog-card-image img {
        min-height: unset !important;
        height: 100% !important;
    }

    /* No dividers on mobile */
    .blog-card::before,
    .blog-card:nth-child(2n)::before,
    .blog-card:nth-child(3n)::before,
    .blog-card:nth-child(3n+2)::before {
        display: none !important;
    }

    .blog-card-content {
        gap: 10px;
    }

    .blog-card-title a {
        font-size: 20px;
    }

    .blog-card-excerpt {
        font-size: 16px;
    }

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

    .blog-pagination .page-numbers {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .blog-pagination .page-numbers a,
    .blog-pagination .page-numbers span {
        min-width: 36px;
        height: 36px;
        font-size: 16px;
        padding: 5px 10px;
    }
}


/* ===================================
   RESPONSIVE: Small Mobile (≤480px)
   =================================== */

@media (max-width: 480px) {
    .blog-page-title {
        font-size: 24px;
    }

    .blog-page-description {
        font-size: 14px;
    }

    .blog-card-title a {
        font-size: 18px;
    }

    .blog-card-excerpt {
        font-size: 14px;
    }

    .blog-card-date {
        font-size: 12px;
    }

    .blog-card-category {
        font-size: 11px;
        padding: 4px 8px;
    }
}


/* ===================================
   UTILITY: Hide Read More (if exists)
   =================================== */

.blog-card-read-more {
    display: none !important;
}


/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    .blog-filter-section {
        display: none;
    }

    .blog-pagination {
        display: none;
    }

    .blog-card-image {
        break-inside: avoid;
    }
}