/* ============================================================================
   Lumivara — Journal styles for lumivara.ai/blog
   ----------------------------------------------------------------------------
   Editorial-tech. Dense, image-led, restrained. Inherits the landing shell's
   sans ("Google Sans"/Montserrat) for body/UI and pairs it with Geist (self-
   hosted variable) for ALL display type — headings, card titles, the hero
   wordmark. Theme custom properties drive light/dark automatically; the accent
   is purple in light, lime in dark, used as punctuation never as a flood.

   Every card has a cover: a real og_image when present, otherwise one of six
   deterministic gradient compositions cycling through the grid.
   ========================================================================== */

/* ----- Geist (self-hosted variable, display only — body stays Montserrat) - */
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/blog/fonts/geist-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
        U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
        U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/blog/fonts/geist-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,
        U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
        U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
        U+A720-A7FF;
}

/* --------------------------------- tokens --------------------------------- */
.blog-wrap {
    --ink:        var(--text-primary);
    --muted:      var(--text-secondary);
    --line:       color-mix(in oklab, var(--text-primary) 10%, transparent);
    --line-soft:  color-mix(in oklab, var(--text-primary) 5%, transparent);
    --paper:      var(--bg-primary);
    --raise:      color-mix(in oklab, var(--text-primary) 2.5%, var(--bg-primary));
    --raise-2:    color-mix(in oklab, var(--text-primary) 5%,   var(--bg-primary));
    --cover-base: color-mix(in oklab, var(--text-primary) 6%,   var(--bg-primary));
    --accent-ink: color-mix(in oklab, var(--accent) 72%, var(--text-primary));
    --accent-soft: color-mix(in oklab, var(--accent) 20%, transparent);

    --mono:    ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
    --display: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
    .blog-wrap {
        --accent-ink: color-mix(in oklab, var(--accent) 82%, #ffffff);
        --cover-base: color-mix(in oklab, var(--text-primary) 8%, var(--bg-primary));
    }
}

/* --------------------------------- layout --------------------------------- */
.blog-wrap {
    max-width: 1240px;
    margin: 0 auto;
    padding: 108px 32px 96px;
    font-feature-settings: "ss01", "cv11";
}
.blog-narrow { max-width: 1240px; }

/* Pin the footer to the viewport bottom on short blog pages (category hubs
   with one article, empty states). Scoped via :has() so the rest of the
   marketing site is unaffected. The fixed nav and PWA banner are position:
   fixed and stay out of the flex flow. */
body:has(.blog-wrap) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body:has(.blog-wrap) .blog-wrap {
    flex: 1 0 auto;
    width: 100%;
}
body:has(.blog-wrap) > footer {
    flex-shrink: 0;
}

/* the landing shell styles the bare <header> ELEMENT as a fixed nav bar.
   In-page <header>s must opt out or they get yanked to the viewport top. */
.blog-hero, .article-header {
    position: relative; inset: auto; z-index: auto;
    background: none; border-bottom: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
}

/* ------------------------------- breadcrumbs ------------------------------ */
.blog-crumbs {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 24px;
    display: flex; flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.blog-crumbs a { color: var(--muted); transition: color 0.14s ease; }
.blog-crumbs a:hover { color: var(--accent-ink); }
.blog-crumbs span.sep { opacity: 0.4; }
.blog-crumbs > span:last-child { color: var(--ink); }

/* ---------------------------------- hero ---------------------------------- */
.blog-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 32px;
    margin-bottom: 56px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--line);
}
.blog-hero__lead { max-width: 720px; }
.blog-hero__eyebrow {
    display: inline-flex; align-items: center; gap: 9px;
    font-family: var(--mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 24px;
}
.blog-hero__eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 25%, transparent);
}
.blog-hero__title {
    font-family: var(--display);
    font-size: clamp(48px, 7vw, 84px);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 0.96;
    color: var(--ink);
    margin: 0 0 16px;
}
.blog-hero__text {
    font-size: 16.5px;
    line-height: 1.55;
    color: var(--muted);
    max-width: 56ch;
}
.blog-hero__counter {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    line-height: 1.5;
    white-space: nowrap;
}
.blog-hero__counter strong {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* ------------------------------- topic chips ------------------------------ */
.blog-topics {
    display: flex; flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 48px;
}
.blog-chip {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: transparent;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    transition: all 0.14s ease;
}
.blog-chip:hover {
    border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
    color: var(--accent-ink);
}
.blog-chip--active {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}
.blog-chip--active:hover { color: var(--paper); }

/* ================================== grid ================================= */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 44px 28px;
    counter-reset: art;
}

/* ------------------------------- generic card ----------------------------- */
.blog-card {
    counter-increment: art;
    display: flex; flex-direction: column;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}
.blog-card__cover {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 6px;
    background: var(--cover-base);
    isolation: isolate;
}
.blog-card__cover img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.5s cubic-bezier(0.2,0.7,0.2,1);
}
.blog-card:hover .blog-card__cover img { transform: scale(1.04); }

/* tiny corner artifact: article number, monospace, top-left */
.blog-card__num {
    position: absolute;
    top: 12px; left: 14px;
    z-index: 2;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: color-mix(in oklab, var(--text-primary) 80%, transparent);
    mix-blend-mode: difference;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 0 1px rgba(0,0,0,0.3);
}

.blog-card__body {
    display: flex; flex-direction: column;
    gap: 8px;
    padding: 2px 2px 0;
}
.blog-card__cat {
    display: inline-flex; align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-ink);
}
.blog-card__cat::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
}
.blog-card__title {
    font-family: var(--display);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1.2;
    color: var(--ink);
    text-wrap: balance;
    transition: opacity 0.14s ease;
}
.blog-card:hover .blog-card__title { opacity: 0.78; }
.blog-card__excerpt {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
}
.blog-card__meta {
    margin-top: 6px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.blog-card__meta span.sep {
    width: 2px; height: 2px; border-radius: 50%;
    background: currentColor; opacity: 0.5;
}

/* ====================== GENERATED COVERS (six variants) =====================
   Six gradient compositions cycle across the grid via :nth-child. Each one is
   keyed to --accent (re-resolves per colour scheme) and laid over --cover-base.
   A faint dither overlay sits on top of every variant for a tactile finish. */
.blog-card--noimage .blog-card__cover::before {
    /* dither / dot grain */
    content: "";
    position: absolute; inset: 0;
    z-index: 1;
    background-image: radial-gradient(circle at 1px 1px,
        color-mix(in oklab, var(--text-primary) 18%, transparent) 0.6px,
        transparent 1.1px);
    background-size: 4px 4px;
    opacity: 0.18;
    mix-blend-mode: multiply;
    pointer-events: none;
}
@media (prefers-color-scheme: dark) {
    .blog-card--noimage .blog-card__cover::before {
        background-image: radial-gradient(circle at 1px 1px,
            color-mix(in oklab, #ffffff 14%, transparent) 0.6px,
            transparent 1.1px);
        opacity: 0.22;
        mix-blend-mode: screen;
    }
}

/* Variant A — Aurora: diagonal base + two soft radial highlights */
.blog-card--noimage:nth-child(6n+1) .blog-card__cover {
    background:
        radial-gradient(70% 55% at 92% 8%,
            color-mix(in oklab, var(--accent) 55%, transparent), transparent 62%),
        radial-gradient(65% 50% at 8% 100%,
            color-mix(in oklab, var(--accent) 26%, transparent), transparent 60%),
        linear-gradient(135deg,
            color-mix(in oklab, var(--accent) 9%, var(--cover-base)),
            var(--cover-base) 70%);
}
/* Variant B — Bands: vertical gradient bands, sunset-style */
.blog-card--noimage:nth-child(6n+2) .blog-card__cover {
    background:
        linear-gradient(180deg,
            color-mix(in oklab, var(--accent) 42%, transparent) 0%,
            color-mix(in oklab, var(--accent) 24%, transparent) 22%,
            color-mix(in oklab, var(--accent) 10%, transparent) 55%,
            transparent 100%),
        var(--cover-base);
}
/* Variant C — Spotlight: warm central glow */
.blog-card--noimage:nth-child(6n+3) .blog-card__cover {
    background:
        radial-gradient(46% 64% at 32% 62%,
            color-mix(in oklab, var(--accent) 58%, transparent),
            color-mix(in oklab, var(--accent) 14%, transparent) 60%,
            transparent 78%),
        var(--cover-base);
}
/* Variant D — Mesh: four-corner mesh */
.blog-card--noimage:nth-child(6n+4) .blog-card__cover {
    background:
        radial-gradient(42% 52% at 0% 0%,
            color-mix(in oklab, var(--accent) 40%, transparent), transparent 60%),
        radial-gradient(38% 48% at 100% 0%,
            color-mix(in oklab, var(--accent) 22%, transparent), transparent 60%),
        radial-gradient(42% 52% at 100% 100%,
            color-mix(in oklab, var(--accent) 34%, transparent), transparent 60%),
        radial-gradient(38% 48% at 0% 100%,
            color-mix(in oklab, var(--accent) 18%, transparent), transparent 60%),
        var(--cover-base);
}
/* Variant E — Slab: sharp diagonal split */
.blog-card--noimage:nth-child(6n+5) .blog-card__cover {
    background:
        linear-gradient(118deg,
            color-mix(in oklab, var(--accent) 38%, transparent) 0%,
            color-mix(in oklab, var(--accent) 38%, transparent) 44%,
            color-mix(in oklab, var(--accent) 8%, transparent) 44.4%,
            color-mix(in oklab, var(--accent) 8%, transparent) 100%),
        var(--cover-base);
}
/* Variant F — Conic: soft spiral wash */
.blog-card--noimage:nth-child(6n+6) .blog-card__cover {
    background:
        conic-gradient(from 220deg at 70% 30%,
            color-mix(in oklab, var(--accent) 40%, transparent),
            color-mix(in oklab, var(--accent) 8%, transparent) 50%,
            color-mix(in oklab, var(--accent) 32%, transparent) 100%),
        var(--cover-base);
}

/* ============================ FEATURED LEAD CARD ===========================
   Asymmetric 7/5 split. Cover left, content right. Magazine cover energy. */
.blog-card--featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    margin-bottom: 8px;
    counter-increment: art;
    align-items: stretch;
}
.blog-card--featured .blog-card__cover {
    aspect-ratio: auto;
    min-height: 420px;
    border-radius: 10px;
}
.blog-card--featured .blog-card__body {
    padding: 28px 8px 12px;
    justify-content: space-between;
    gap: 28px;
}
.blog-card--featured .blog-card__feat-label {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
}
.blog-card--featured .blog-card__feat-label::before {
    content: "";
    width: 24px; height: 1px;
    background: var(--accent);
}
.blog-card--featured .blog-card__head {
    display: flex; flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}
.blog-card--featured .blog-card__cat { font-size: 11px; }
.blog-card--featured .blog-card__title {
    font-family: var(--display);
    font-size: clamp(30px, 3.4vw, 46px);
    font-weight: 600;
    letter-spacing: -0.034em;
    line-height: 1.02;
    margin-top: -2px;
}
.blog-card--featured .blog-card__excerpt {
    font-size: 15.5px;
    line-height: 1.6;
    -webkit-line-clamp: 4;
    max-width: 42ch;
}
.blog-card--featured .blog-card__meta {
    font-size: 11px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    margin-top: 0;
}

/* subtle staggered entrance — present but not draw-attention */
@media (prefers-reduced-motion: no-preference) {
    .blog-grid .blog-card {
        opacity: 0;
        transform: translateY(8px);
        animation: blog-rise 0.45s ease forwards;
    }
    .blog-grid .blog-card:nth-child(1) { animation-delay: 0.02s; }
    .blog-grid .blog-card:nth-child(2) { animation-delay: 0.06s; }
    .blog-grid .blog-card:nth-child(3) { animation-delay: 0.10s; }
    .blog-grid .blog-card:nth-child(4) { animation-delay: 0.14s; }
    .blog-grid .blog-card:nth-child(5) { animation-delay: 0.18s; }
    .blog-grid .blog-card:nth-child(6) { animation-delay: 0.22s; }
    .blog-grid .blog-card:nth-child(n+7) { animation-delay: 0.26s; }
}
@keyframes blog-rise { to { opacity: 1; transform: translateY(0); } }

/* ------------------------------- empty state ------------------------------ */
.blog-empty {
    padding: 80px 4px 60px;
    color: var(--muted);
    font-size: 15px;
    border-top: 1px solid var(--line);
}

/* ------------------------------- pagination ------------------------------- */
.blog-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.blog-pagination a, .blog-pagination span {
    padding: 0;
    color: var(--ink);
    transition: color 0.14s ease;
}
.blog-pagination a:hover { color: var(--accent-ink); }
.blog-pagination .disabled { opacity: 0.32; pointer-events: none; }
.blog-pagination .status {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ============================ ARTICLE DETAIL ============================== */

.read-progress {
    position: fixed; top: 0; left: 0;
    height: 2px; width: 100%;
    transform: scaleX(0); transform-origin: 0 50%;
    background: var(--accent);
    z-index: 1200; pointer-events: none;
}

/* Asymmetric reading layout: body left, slim sticky sidebar right on wide. */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 720px) minmax(180px, 240px);
    gap: 80px;
    align-items: start;
    margin: 0 auto;
    max-width: 1080px;
}
.article-shell { min-width: 0; }
.article-aside {
    position: sticky;
    top: 96px;
    padding-top: 4px;
    font-family: var(--mono);
    font-size: 11.5px;
}
.article-aside__label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.article-aside__toc { list-style: none; padding: 0; margin: 0; }
.article-aside__toc li { padding: 7px 0; }
.article-aside__toc a {
    color: var(--muted);
    line-height: 1.4;
    display: block;
    transition: color 0.14s ease;
    font-family: 'Google Sans', sans-serif;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
}
.article-aside__toc a:hover { color: var(--ink); }
.article-aside__toc a.is-active { color: var(--accent-ink); }
.article-aside__toc li.is-h3 a { padding-left: 14px; font-size: 12px; }

.article-header { margin-bottom: 28px; }
.article-header__cat {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-ink);
    margin-bottom: 20px;
}
.article-header__cat::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
}
.article-header__title {
    font-family: var(--display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    letter-spacing: -0.036em;
    line-height: 1.02;
    color: var(--ink);
    margin-bottom: 24px;
    text-wrap: balance;
}
.article-header__meta {
    font-family: var(--mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    display: flex; flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}
.article-header__meta span.sep {
    width: 2px; height: 2px; border-radius: 50%;
    background: currentColor; opacity: 0.5;
}

.article-cover {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 36px;
}

/* --- key facts / standfirst: marginal label, hairline-ruled facts --- */
.article-keyfacts {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 0 32px;
    margin: 0 0 40px;
    padding: 24px 0 4px;
    border-top: 1.5px solid var(--ink);
}
.article-keyfacts h2 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin: 2px 0 0;
}
.article-keyfacts ul { margin: 0; padding: 0; list-style: none; }
.article-keyfacts li {
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    padding: 11px 0;
    border-top: 1px solid var(--line-soft);
}
.article-keyfacts li:first-child { padding-top: 0; border-top: none; }
.article-keyfacts li:last-child { padding-bottom: 20px; }

/* ----------------------------- body typography ---------------------------- */
.article-body {
    font-size: 16px;
    line-height: 1.72;
    color: var(--ink);
}
.article-body > *:first-child { margin-top: 0; }
.article-body h2 {
    font-family: var(--display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.026em;
    line-height: 1.2;
    margin: 44px 0 14px;
    scroll-margin-top: 96px;
}
.article-body h3 {
    font-family: var(--display);
    font-size: 18.5px;
    font-weight: 600;
    letter-spacing: -0.016em;
    margin: 32px 0 10px;
    scroll-margin-top: 96px;
}
.article-body p { margin: 0 0 20px; }
.article-body a {
    color: var(--accent-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
    transition: text-decoration-color 0.14s ease;
}
.article-body a:hover { text-decoration-color: currentColor; }
.article-body strong { font-weight: 600; }
.article-body ul, .article-body ol { margin: 0 0 22px; padding-left: 0; list-style: none; }
.article-body li { position: relative; margin-bottom: 8px; padding-left: 22px; }
.article-body ul > li::before {
    content: "";
    position: absolute;
    left: 4px; top: 0.72em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: color-mix(in oklab, var(--accent) 60%, var(--text-primary));
}
.article-body ol { counter-reset: li; }
.article-body ol > li { counter-increment: li; }
.article-body ol > li::before {
    content: counter(li);
    position: absolute;
    left: 0; top: 0;
    font-family: var(--mono);
    font-size: 0.78em;
    font-weight: 600;
    color: var(--accent-ink);
    line-height: 1.85;
}
.article-body blockquote {
    margin: 32px 0;
    padding: 0;
    border: none;
    font-size: 1.32em;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.article-body blockquote::before {
    content: "";
    display: block;
    width: 32px; height: 2px;
    background: var(--accent);
    margin-bottom: 18px;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body img {
    max-width: 100%; height: auto;
    border-radius: 8px;
    margin: 28px 0;
}
.article-body hr {
    border: none; height: 1px;
    background: var(--line);
    margin: 40px 0;
}
.article-body pre {
    background: var(--raise-2);
    border-radius: 8px;
    padding: 16px 18px;
    overflow-x: auto;
    margin: 0 0 22px;
}
.article-body code {
    font-family: var(--mono);
    font-size: 0.85em;
    background: var(--raise-2);
    padding: 2px 6px;
    border-radius: 4px;
}
.article-body pre code { background: none; padding: 0; font-size: 13px; }
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 24px;
    font-size: 14px;
}
.article-body th, .article-body td {
    border-bottom: 1px solid var(--line-soft);
    padding: 11px 14px;
    text-align: left;
}
.article-body th {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-bottom-color: var(--line);
}
.article-body tr:last-child td { border-bottom: none; }

/* shared section heads in article */
.article-faq h2, .article-sources h2, .article-related h2 {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.026em;
    margin-bottom: 20px;
    color: var(--ink);
}

/* --- FAQ accordion --- */
.article-faq { margin: 52px 0; }
.article-faq details { border-bottom: 1px solid var(--line); }
.article-faq details:first-of-type { border-top: 1px solid var(--line); }
.article-faq summary {
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: var(--ink);
    list-style: none;
    padding: 18px 36px 18px 0;
    position: relative;
    transition: color 0.14s ease;
}
.article-faq summary:hover { color: var(--accent-ink); }
.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary::after {
    content: "";
    position: absolute;
    right: 4px; top: 50%;
    width: 11px; height: 11px;
    margin-top: -5.5px;
    background: var(--accent-ink);
    -webkit-mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
            mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    transition: transform 0.22s ease;
}
.article-faq details[open] summary::after { transform: rotate(135deg); }
.article-faq p {
    margin: 0 0 18px;
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--muted);
}

/* --- sources: hanging numbers, no badges --- */
.article-sources { margin: 52px 0; }
.article-sources ol { padding: 0; margin: 0; list-style: none; counter-reset: src; }
.article-sources li {
    counter-increment: src;
    position: relative;
    padding: 13px 0 13px 30px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14.5px;
    color: var(--muted);
}
.article-sources li::before {
    content: counter(src);
    position: absolute;
    left: 0; top: 14px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-ink);
    font-variant-numeric: tabular-nums;
}
.article-sources a {
    color: var(--accent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
    word-break: break-word;
}
.article-sources a:hover { text-decoration-color: currentColor; }

/* --- author byline: text only --- */
.article-author {
    display: flex; flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin: 48px 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.article-author__label {
    font-family: var(--mono);
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--muted);
}
.article-author__name { font-weight: 600; color: var(--ink); font-size: 15px; }
.article-author__sep { color: var(--muted); opacity: 0.5; }
.article-author__role { font-size: 14px; color: var(--muted); }

/* --- related --- */
.article-related {
    margin: 64px 0 0;
    padding-top: 44px;
    border-top: 1px solid var(--line);
}
.article-related .blog-grid { grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
.article-related .blog-card__title { font-size: 15.5px; }
.article-related .blog-card__excerpt { -webkit-line-clamp: 2; }

/* --------------------------------- CTA ------------------------------------ */
.blog-cta {
    margin: 72px 0 0;
    padding-top: 40px;
    border-top: 2px solid var(--ink);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}
.blog-cta__content { max-width: 56ch; }
.blog-cta h2 {
    font-family: var(--display);
    font-size: clamp(24px, 3.2vw, 30px);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin-bottom: 8px;
    color: var(--ink);
}
.blog-cta p {
    font-size: 15px;
    color: var(--muted);
    margin: 0;
    line-height: 1.55;
}
.blog-cta a {
    flex-shrink: 0;
    display: inline-flex; align-items: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: transform 0.16s ease;
}
.blog-cta a::after { content: "→"; transition: transform 0.18s ease; }
.blog-cta a:hover { transform: translateY(-1px); }
.blog-cta a:hover::after { transform: translateX(3px); }

/* ------------------------------- responsive ------------------------------- */
@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        max-width: 720px;
    }
    .article-aside { display: none; }
}
@media (max-width: 980px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .article-related .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-card--featured { grid-template-columns: 1fr; }
    .blog-card--featured .blog-card__cover { min-height: 0; aspect-ratio: 16 / 10; }
    .blog-card--featured .blog-card__body { padding: 4px 0; gap: 18px; }
}
@media (max-width: 640px) {
    .blog-wrap { padding: 96px 20px 72px; }
    .blog-grid, .article-related .blog-grid { grid-template-columns: 1fr; gap: 36px; }
    .blog-hero {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 40px;
    }
    .blog-hero__counter { text-align: left; }
    .article-keyfacts {
        grid-template-columns: 1fr;
        gap: 14px 0;
        padding-top: 20px;
    }
    .blog-cta {
        flex-direction: column;
        align-items: flex-start;
        gap: 22px;
    }
}
