/*
 * blog-index.css — BVNEMBA Blog Index Styles
 * ─────────────────────────────────────────────────────
 * Scoped to .bvn-blog-index — zero bleed to other pages.
 * Loaded via wp_enqueue_style in functions.php, is_home() only.
 *
 * Layout zones:
 *   1. Page header          .bvn-blog-index__header
 *   2. Hero post            .bvn-hero-post
 *   3. Card grid            .bvn-post-grid / .bvn-post-card
 *   4. Pagination           .bvn-blog-pagination
 *
 * Brand tokens (matching blog-single.css and style.css):
 *   Deep Slate   #252E37    hero overlay, card hover
 *   Slate        #38434E    header, borders
 *   Body Text    #3A3530    paragraph copy
 *   Muted        #5C5550    meta, date
 *   Ember        #E97132    accent rules, decorative
 *   Ember Dim    #C4561A    text links (WCAG AA: 5.74:1 on white)
 *   Forest       #184045    (reserved, not used here)
 *   Cream        #F6F2EF    card placeholder bg
 *   Neutral      #E8E1DE    borders, separators
 *   White        #FFFFFF    card bg, hero text
 *
 * WCAG 2.2 AA:
 *   White text on hero overlay (#252E37 @ 70% opacity): verified ✓
 *   Body text #3A3530 on white: 9.2:1 ✓
 *   Ember Dim #C4561A on white: 5.74:1 ✓
 *   All touch targets ≥ 44×44px on mobile
 *
 * File version: 1.0.0
 * ─────────────────────────────────────────────────────
 */


/* ============================================================
   TOKENS — local to .bvn-blog-index
   ============================================================ */

.bvn-blog-index {
    --bi-slate-deep:    #252E37;
    --bi-slate:         #38434E;
    --bi-body:          #3A3530;
    --bi-muted:         #5C5550;
    --bi-ember:         #E97132;
    --bi-ember-dim:     #C4561A;
    --bi-cream:         #F6F2EF;
    --bi-neutral:       #E8E1DE;
    --bi-white:         #FFFFFF;
    --bi-font-heading:  'Work Sans', Arial, sans-serif;
    --bi-font-body:     'Karla', Georgia, Arial, sans-serif;
    --bi-radius:        4px;
    --bi-radius-lg:     8px;
    --bi-max-width:     1080px;
    --bi-side-pad:      1.25rem;
}


/* ============================================================
   SHELL
   ============================================================ */

.bvn-blog-index {
    background: var(--bi-white);
    overflow-x: hidden;
}


/* ============================================================
   ZONE 1: PAGE HEADER
   ============================================================ */

.bvn-blog-index__header {
    background: var(--bi-slate-deep);
    padding: 4rem var(--bi-side-pad) 3.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle ember glow — decorative, aria-hidden via CSS only */
.bvn-blog-index__header::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 180px;
    background: radial-gradient(ellipse, rgba(233,113,50,0.15) 0%, transparent 70%);
    pointer-events: none;
}

.bvn-blog-index__header-eyebrow {
    font-family: var(--bi-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--bi-ember);
    margin-bottom: 0.75rem;
}

.bvn-blog-index__header-title {
    font-family: var(--bi-font-heading) !important;
    font-size: clamp(2rem, 5vw, 3rem) !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    color: var(--bi-white) !important;
    letter-spacing: -0.02em;
    margin-bottom: 1rem !important;
}

.bvn-blog-index__header-sub {
    font-family: var(--bi-font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.6);
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
}


/* ============================================================
   ZONE 2: HERO POST
   ============================================================ */

.bvn-hero-post {
    position: relative;
    background: var(--bi-slate-deep);
    overflow: hidden;
}

.bvn-hero-post__article {
    position: relative;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

@media (min-width: 768px) {
    .bvn-hero-post__article {
        min-height: 600px;
    }
}

@media (min-width: 1280px) {
    .bvn-hero-post__article {
        min-height: 680px;
    }
}

/* ── Hero image ────────────────────────────────────────────── */

.bvn-hero-post__image-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bvn-hero-post__image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.bvn-hero-post__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s ease;
}

.bvn-hero-post__article:hover .bvn-hero-post__image {
    transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
    .bvn-hero-post__article:hover .bvn-hero-post__image {
        transform: none;
    }
}

/* ── Gradient overlay — text legibility ────────────────────── */

.bvn-hero-post__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(37, 46, 55, 0.92) 0%,
        rgba(37, 46, 55, 0.55) 45%,
        rgba(37, 46, 55, 0.10) 100%
    );
    pointer-events: none;
}

/* ── Hero content ──────────────────────────────────────────── */

.bvn-hero-post__content {
    position: relative;
    z-index: 2;
    padding: 2.5rem var(--bi-side-pad) 3rem;
    max-width: calc(var(--bi-max-width) + 2 * var(--bi-side-pad));
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .bvn-hero-post__content {
        padding: 3rem 2rem 3.5rem;
        max-width: 860px;
    }
}

/* ── Hero category label ───────────────────────────────────── */

.bvn-hero-post__cat {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.bvn-hero-post__cat a {
    font-family: var(--bi-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bi-ember);
    text-decoration: none;
    border-bottom: 1px solid rgba(233, 113, 50, 0.5);
    padding-bottom: 2px;
    transition: border-color 0.2s;
}

.bvn-hero-post__cat a:hover,
.bvn-hero-post__cat a:focus {
    border-bottom-color: var(--bi-ember);
}

/* ── Hero title ────────────────────────────────────────────── */

.bvn-hero-post__title {
    font-family: var(--bi-font-heading) !important;
    font-size: clamp(1.625rem, 4.5vw, 2.75rem) !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
    color: var(--bi-white) !important;
    letter-spacing: -0.02em;
    margin-bottom: 1rem !important;
}

.bvn-hero-post__title a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.bvn-hero-post__title a:hover,
.bvn-hero-post__title a:focus {
    opacity: 0.85;
}

/* ── Hero excerpt ──────────────────────────────────────────── */

.bvn-hero-post__excerpt {
    font-family: var(--bi-font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 1.5rem;
    max-width: 640px;
}

/* ── Hero meta bar ─────────────────────────────────────────── */

.bvn-hero-post__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
}

.bvn-hero-post__date {
    font-family: var(--bi-font-body);
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
}

.bvn-hero-post__cta {
    font-family: var(--bi-font-heading);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--bi-ember);
    text-decoration: none;
    border-bottom: 1px solid rgba(233, 113, 50, 0.4);
    padding-bottom: 2px;
    transition: border-color 0.2s, color 0.2s;
    min-height: 44px;           /* WCAG touch target */
    display: inline-flex;
    align-items: center;
}

.bvn-hero-post__cta:hover,
.bvn-hero-post__cta:focus {
    color: var(--bi-white);
    border-bottom-color: var(--bi-white);
}


/* ============================================================
   ZONE 3: CARD GRID
   ============================================================ */

.bvn-post-grid {
    padding: 3.5rem var(--bi-side-pad) 4rem;
}

.bvn-post-grid__inner {
    max-width: var(--bi-max-width);
    margin-left: auto;
    margin-right: auto;
}

/* ── Grid layout: mobile-first ─────────────────────────────── */

.bvn-post-grid__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 600px) {
    .bvn-post-grid__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .bvn-post-grid__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Individual card ───────────────────────────────────────── */

.bvn-post-card {
    background: var(--bi-white);
    border: 1px solid var(--bi-neutral);
    border-radius: var(--bi-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.bvn-post-card:hover {
    box-shadow: 0 6px 28px rgba(37, 46, 55, 0.12);
    transform: translateY(-3px);
}

@media (prefers-reduced-motion: reduce) {
    .bvn-post-card {
        transition: none;
    }
    .bvn-post-card:hover {
        transform: none;
    }
}

/* ── Card image ────────────────────────────────────────────── */

.bvn-post-card__img-link {
    display: block;
    overflow: hidden;
}

.bvn-post-card__img-wrap {
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--bi-neutral);
}

.bvn-post-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.bvn-post-card:hover .bvn-post-card__img {
    transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
    .bvn-post-card:hover .bvn-post-card__img {
        transform: none;
    }
}

/* Placeholder when no featured image */
.bvn-post-card__img-placeholder {
    aspect-ratio: 3 / 2;
    background: var(--bi-cream);
    border-bottom: 1px solid var(--bi-neutral);
    position: relative;
}

.bvn-post-card__img-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(196, 185, 168, 0.15) 8px,
        rgba(196, 185, 168, 0.15) 9px
    );
}

/* ── Card body ─────────────────────────────────────────────── */

.bvn-post-card__body {
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Card category ─────────────────────────────────────────── */

.bvn-post-card__cat {
    display: block;
    margin-bottom: 0.4rem;
}

.bvn-post-card__cat a {
    font-family: var(--bi-font-heading);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bi-ember-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.bvn-post-card__cat a:hover,
.bvn-post-card__cat a:focus {
    color: var(--bi-ember);
}

/* ── Card title ────────────────────────────────────────────── */

.bvn-post-card__title {
    font-family: var(--bi-font-heading) !important;
    font-size: 1.0rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: var(--bi-slate-deep) !important;
    margin-bottom: 0.6rem !important;
    flex: 1;
}

.bvn-post-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.bvn-post-card__title a:hover,
.bvn-post-card__title a:focus {
    color: var(--bi-ember-dim);
}

.bvn-post-card__title a:focus {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Card excerpt ──────────────────────────────────────────── */

.bvn-post-card__excerpt {
    font-family: var(--bi-font-body);
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--bi-body);
    margin-bottom: 1rem;

    /* Clamp to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Card footer ───────────────────────────────────────────── */

.bvn-post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bi-neutral);
}

.bvn-post-card__date {
    font-family: var(--bi-font-body);
    font-size: 0.75rem;
    color: var(--bi-muted);
}

.bvn-post-card__read-more {
    font-family: var(--bi-font-heading);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--bi-ember-dim);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 1px;
    transition: border-color 0.2s, color 0.2s;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.bvn-post-card__read-more:hover,
.bvn-post-card__read-more:focus {
    color: var(--bi-ember);
    border-bottom-color: var(--bi-ember);
}


/* ============================================================
   ZONE 4: PAGINATION
   ============================================================ */

.bvn-blog-pagination {
    padding: 0 var(--bi-side-pad) 4rem;
}

.bvn-blog-pagination__inner {
    max-width: var(--bi-max-width);
    margin-left: auto;
    margin-right: auto;
    border-top: 1px solid var(--bi-neutral);
    padding-top: 2rem;
}

/* Paginate links outputs a <ul> when type='list' */
.bvn-blog-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.bvn-blog-pagination .page-numbers li {
    margin: 0;
}

.bvn-blog-pagination .page-numbers a,
.bvn-blog-pagination .page-numbers span {
    font-family: var(--bi-font-heading);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bi-slate-deep);
    text-decoration: none;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--bi-neutral);
    border-radius: var(--bi-radius);
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.bvn-blog-pagination .page-numbers a:hover,
.bvn-blog-pagination .page-numbers a:focus {
    background: var(--bi-slate-deep);
    border-color: var(--bi-slate-deep);
    color: var(--bi-white);
}

.bvn-blog-pagination .page-numbers .current {
    background: var(--bi-ember);
    border-color: var(--bi-ember);
    color: var(--bi-white);
}

.bvn-blog-pagination .page-numbers .prev,
.bvn-blog-pagination .page-numbers .next {
    font-weight: 700;
    letter-spacing: 0.04em;
}


/* ============================================================
   EMPTY STATE
   ============================================================ */

.bvn-blog-empty {
    padding: 5rem var(--bi-side-pad);
    text-align: center;
    font-family: var(--bi-font-body);
    font-size: 1rem;
    color: var(--bi-muted);
}


/* ============================================================
   RESPONSIVE — LAYOUT REFINEMENTS
   ============================================================ */
@media (min-width: 1024px) {

    .bvn-blog-index__header {
        padding: 5rem 2rem 4rem;
    }

    .bvn-post-grid {
        padding: 4rem 0 5rem;
    }

    .bvn-blog-pagination {
        padding: 0 0 5rem;
    }

    .bvn-hero-post__content {
        padding: 3.5rem 2.5rem 4rem;
        max-width: var(--bi-max-width);
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1280px) {

    .bvn-hero-post__article {
        min-height: 720px;
    }

    .bvn-hero-post__title {
        font-size: 3rem !important;
    }

    .bvn-hero-post__excerpt {
        font-size: 1.0625rem;
    }
}
