/* Root tokens */
:root {
    --ink: #0f1117;
    --ink-muted: #4a4e5a;
    --ink-faint: #8a8f9e;
    --rule: #d8dae0;
    --rule-heavy: #0f1117;
    --cream: #faf9f7;
    --navy: #0d2240;
    --gold: #b8882a;
    --gold-light: #f5efe0;

    /* Ghost admin "Theme typography" overrides — fall back to brand defaults
       if not set in admin. This exposes the brand fonts to Ghost's settings UI. */
    --gh-font-heading: 'Libre Baskerville', Georgia, serif;
    --gh-font-body: 'Source Serif 4', Georgia, serif;
}

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--cream); color: var(--ink); font-family: 'DM Sans', sans-serif; }

/* Masthead — editorial publication pattern (NYT, Atlantic, FT).
   Row 1: brand block (flush left) + Subscribe CTA (flush right).
   Row 2: horizontal navigation strip beneath the brand, with a hairline
   border-bottom that visually unifies both rows above a single rule. */
.masthead { padding: 24px 0 0; }
.masthead-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Row 1 — brand + CTA */
.masthead-brand-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 16px;
}

.masthead-brand { display: flex; flex-direction: column; }
.masthead-brand .eyebrow {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 6px;
}
.masthead-brand .pub-name {
    display: block;
    font-family: 'Libre Baskerville', serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
    text-decoration: none;
}
.masthead-brand .pub-tagline {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.3;
}

/* CTA pushed up so its bottom aligns with the publication-name baseline,
   not with the bottom of the tagline. The padding-bottom equals roughly
   the tagline height (12px) plus its margin (4px). */
.masthead-cta {
    flex: 0 0 auto;
    padding-bottom: 16px;
}
.subscribe-btn {
    display: inline-block;
    background: var(--gold);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 2px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.15s ease;
}
.subscribe-btn:hover { background: var(--navy); color: #ffffff; }

/* Row 2 — the nav element itself IS the row. Gold-rule unification
   sits as the border-bottom on this nav, so brand + nav read as one
   masthead block above a single hairline. */
.masthead-nav {
    display: flex;
    gap: 32px;
    padding: 4px 0 12px;
    border-bottom: 0.5px solid var(--rule);
    align-items: center;
}
.masthead-nav a {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}
.masthead-nav a:hover { color: var(--navy); }
.masthead-nav a.active {
    color: var(--navy);
    border-bottom: 2px solid var(--navy);
    padding-bottom: 8px;
}

/* Content wrapper — same outer width as masthead-inner (1200px) so every
   header element (brand, nav, CTA, eyebrow, headline, deck, byline, body
   prose) shares a single left-edge alignment baseline. */
.content { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Featured section (home page only — scoped to avoid colliding with Ghost's
   automatic `featured` body class on featured posts, which would otherwise
   apply this grid layout to the post body itself). */
.home-template .featured { padding: 36px 0 28px; border-bottom: 0.5px solid var(--rule); display: grid; grid-template-columns: 1fr 220px; gap: 48px; align-items: start; }

/* Brief label (eyebrow) — shared base; .article-label gets extra breathing
   room to the headline below it. */
.brief-label, .card-tag, .sidebar-item-tag, .article-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--gold); font-weight: 500; margin-bottom: 12px;
}
.article-label { margin-bottom: 22px; }

/* Headlines */
.brief-headline, .card-title, .article-headline {
    font-family: 'Libre Baskerville', serif; color: var(--navy);
}
.brief-headline { font-size: 22px; font-weight: 700; line-height: 1.35; margin-bottom: 10px; }
.brief-headline a { color: var(--navy); text-decoration: none; }
.article-headline { font-size: 26px; font-weight: 700; line-height: 1.3; margin-bottom: 14px; }
.card-title { font-size: 14px; line-height: 1.45; margin-bottom: 8px; }
.card-title a { color: var(--navy); text-decoration: none; }
.brief-sub { font-family: 'Source Serif 4', serif; font-style: italic; font-size: 14px; color: var(--ink-muted); line-height: 1.6; margin-bottom: 16px; }
.brief-meta { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.04em; }
.brief-meta strong { color: var(--ink-muted); font-weight: 500; }

/* Read button */
.read-btn { display: inline-block; margin-top: 16px; font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500; color: var(--navy); text-decoration: none; padding-bottom: 2px; border-bottom: 1.5px solid var(--navy); }

/* Article header — hairline rule under byline matches the masthead-nav rule weight */
.article-header { padding: 40px 0 32px; border-bottom: 0.5px solid var(--rule); }

/* Article body — left-aligned at 680px reading width, anchored to the same
   left-edge baseline as the masthead, eyebrow, headline, deck, and byline.
   The right gutter is intentional (matches editorial layouts at DWT, etc.). */
.article-body { padding: 32px 0; max-width: 680px; margin-left: 0; margin-right: auto; }
.article-body p { font-family: 'Source Serif 4', serif; font-size: 15px; line-height: 1.85; color: var(--ink); margin-bottom: 1.4em; }
.article-body h2 { font-family: 'Libre Baskerville', serif; font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.3; margin: 3em 0 0.9em; padding-top: 2em; border-top: 3px solid var(--rule-heavy); }
.article-body h3 { font-family: 'Libre Baskerville', serif; font-size: 16px; font-weight: 700; color: var(--navy); margin: 2em 0 0.8em; padding-top: 1.5em; border-top: 0.5px solid var(--rule); }
.article-body em { font-style: italic; }
.article-body strong { font-weight: 700; color: var(--ink); }
.article-body ul, .article-body ol { font-family: 'Source Serif 4', serif; font-size: 15px; line-height: 1.85; color: var(--ink); margin: 1em 0 1.4em 1.4em; }
.article-body li { margin-bottom: 0.4em; }
.article-body a { color: var(--navy); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.article-body a:hover { text-decoration-color: var(--navy); }

/* Article deck — italic pull-quote with gold left border. Extra bottom margin
   creates clear separation from the byline strip below. */
.article-deck { font-family: 'Source Serif 4', serif; font-style: italic; font-size: 15px; color: var(--ink-muted); line-height: 1.7; margin-bottom: 28px; border-left: 2px solid var(--gold); padding-left: 16px; }

/* Byline — horizontal metadata strip, three pairs in a row, tight label/value
   pairs. Visible label-to-value gap is dominated by line-height, so both lines
   are clamped to 1 (with the val sitting just under its label). */
.article-byline { font-family: 'DM Sans', sans-serif; font-size: 11px; color: var(--ink-muted); display: flex; gap: 36px; flex-wrap: wrap; align-items: flex-start; }
.article-byline .byline-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.article-byline .label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); line-height: 1; margin: 0; }
.article-byline .val { font-weight: 500; color: var(--ink); line-height: 1.1; margin: 0; }

/* Takeaways block — ordered list with CSS counters for robust numeral positioning.
   Higher specificity (.article-body .takeaways h3) overrides the default
   .article-body h3 rule-treatment so the eyebrow heading inside takeaways
   stays clean. */
.takeaways { background: var(--gold-light); border-left: 3px solid var(--gold); padding: 22px 26px; margin: 2em 0; }
.article-body .takeaways h3 { font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px 0; padding: 0; border: none; font-weight: 500; line-height: 1; }
.takeaways ol { list-style: none; counter-reset: takeaway; padding: 0; margin: 0; font-family: 'Source Serif 4', serif; font-size: 14px; line-height: 1.6; color: var(--ink); }
.takeaways ol li { counter-increment: takeaway; position: relative; padding-left: 32px; margin-bottom: 14px; }
.takeaways ol li:last-child { margin-bottom: 0; }
.takeaways ol li::before { content: counter(takeaway); position: absolute; left: 0; top: 0; font-family: 'Libre Baskerville', serif; font-weight: 700; color: var(--gold); font-size: 14px; line-height: 1.6; min-width: 20px; }

/* Sidebar (home page only) */
.home-template .featured-sidebar { padding-top: 4px; }
.sidebar-label { font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 12px; border-bottom: 0.5px solid var(--rule); padding-bottom: 8px; }
.sidebar-item { display: block; padding: 12px 0; border-bottom: 0.5px solid var(--rule); text-decoration: none; }
.sidebar-item-title { font-family: 'Libre Baskerville', serif; font-size: 13px; line-height: 1.4; color: var(--navy); margin-bottom: 4px; }
.sidebar-item-date { font-family: 'DM Sans', sans-serif; font-size: 10px; color: var(--ink-faint); }

/* Section header */
.section-header { display: flex; align-items: baseline; justify-content: space-between; padding: 28px 0 16px; border-bottom: 0.5px solid var(--rule); }
.section-title { font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-muted); font-weight: 500; }
.section-all { font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); text-decoration: none; }

/* Brief grid */
.briefs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.brief-card { padding: 20px 24px 20px 0; border-bottom: 0.5px solid var(--rule); }
.brief-card:not(:nth-child(3n)) { border-right: 0.5px solid var(--rule); }
.brief-card:nth-child(3n) { padding-right: 0; }
.brief-card:nth-child(3n+2), .brief-card:nth-child(3n+3) { padding-left: 24px; }
.card-excerpt { font-size: 12px; color: var(--ink-muted); line-height: 1.6; margin-bottom: 10px; font-family: 'Source Serif 4', serif; }
.card-meta { font-family: 'DM Sans', sans-serif; font-size: 10px; color: var(--ink-faint); }

/* Koenig editor card widths — wide images break out of 680px body to 1140px content,
   full images extend to viewport edge. Required by gscan. */
.article-body .kg-width-wide,
.article-body figure.kg-width-wide {
    max-width: 1140px;
    width: calc(100vw - 64px);
    margin-left: 50%;
    transform: translateX(-50%);
}
.article-body .kg-width-full,
.article-body figure.kg-width-full {
    max-width: 100vw;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.article-body figure img,
.article-body .kg-width-wide img,
.article-body .kg-width-full img {
    width: 100%;
    height: auto;
    display: block;
}
.article-body figure figcaption {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    color: var(--ink-faint);
    letter-spacing: 0.04em;
    text-align: center;
    margin-top: 8px;
    line-height: 1.5;
}

/* Article footer — each statement on its own line for readable disclosure */
.article-footer { border-top: 0.5px solid var(--rule); padding: 20px 0; font-size: 11px; color: var(--ink-faint); font-family: 'Source Serif 4', serif; font-style: italic; line-height: 1.7; }
.article-footer p { margin: 0 0 0.6em 0; }
.article-footer p:last-child { margin-bottom: 0; }

/* Publication footer */
.pub-footer { border-top: 2px solid var(--rule-heavy); margin-top: 40px; padding: 24px 0 32px; }
.pub-footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.footer-pub { font-family: 'Libre Baskerville', serif; font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.footer-desc { font-family: 'Source Serif 4', serif; font-size: 11px; color: var(--ink-faint); max-width: 360px; line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.footer-links a { font-family: 'DM Sans', sans-serif; font-size: 11px; color: var(--ink-muted); text-decoration: none; letter-spacing: 0.04em; }
.footer-disclaimer { max-width: 1200px; margin: 12px auto 0; padding: 12px 24px 0; border-top: 0.5px solid var(--rule); font-family: 'Source Serif 4', serif; font-size: 10px; font-style: italic; color: var(--ink-faint); line-height: 1.7; }
.footer-disclaimer p { margin: 0 0 4px 0; }
.footer-disclaimer p:last-child { margin-bottom: 0; }

/* Pagination (used by tag/author templates) */
.pagination { padding: 24px 0; font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); display: flex; justify-content: space-between; align-items: center; }
.pagination a { color: var(--navy); text-decoration: none; }

/* Mobile (≤768px) — brand row stacks (brand block above, Subscribe full-width
   below); nav row wraps if needed. Article body stretches to full container. */
@media (max-width: 768px) {
    .masthead-inner { padding: 0 16px; }
    .masthead-brand-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 12px;
    }
    .masthead-brand .pub-name { font-size: 22px; }
    .masthead-cta { padding-bottom: 0; }
    .subscribe-btn {
        display: block;
        text-align: center;
        padding: 12px 20px;
    }
    .masthead-nav {
        flex-wrap: wrap;
        gap: 14px 24px;
        padding: 4px 0 10px;
    }

    .content { padding: 0 16px; }
    .article-body { max-width: none; }
    .article-headline { font-size: 20px; }
    .article-body p { font-size: 14px; }
    .article-byline { gap: 20px; }

    .home-template .featured { grid-template-columns: 1fr; gap: 24px; }
    .home-template .featured-sidebar { display: none; }
    .briefs-grid { grid-template-columns: 1fr; }
    .brief-card { padding: 20px 0; border-right: none; }
    .brief-card:not(:nth-child(3n)) { border-right: none; }
    .brief-card:nth-child(3n+2), .brief-card:nth-child(3n+3) { padding-left: 0; }

    .pub-footer-inner { padding: 0 16px; flex-direction: column; }
    .footer-disclaimer { padding: 12px 16px 0; }
    .footer-links { text-align: left; }
}
