/* ===== Eastfield Blog — Editorial Prose Styles ===== */
/* Loaded after style.css. Scopes to .blog-page so it doesn't bleed onto the marketing site. */

.blog-page {
    background: var(--cream);
}

/* Force the header into its "solid" state from the start on blog pages
   (no dark hero behind it, so the white logo would be invisible) */
.blog-page .header {
    background: rgba(249, 246, 241, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
}

.blog-page .header .logo-mark-white { opacity: 0; }
.blog-page .header .logo-mark-color { opacity: 1; }
.blog-page .header .logo-name { color: var(--text); }
.blog-page .header .logo-sub { color: var(--text-muted); }

.blog-page .header .nav-cta {
    color: var(--text);
    border-color: var(--border);
}

.blog-page .header .nav-cta:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ===== Article layout ===== */
.article-page {
    padding-top: 140px;
    padding-bottom: 80px;
}

.article-container,
.hub-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 28px;
}

/* ===== Hub (/blog/) page ===== */
.hub-page {
    padding-top: 160px;
    padding-bottom: 100px;
}

.hub-hero {
    margin-bottom: 72px;
    padding-bottom: 56px;
    border-bottom: 1px solid var(--border-light);
}

.hub-eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 28px;
}

.hub-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4.6vw, 3.25rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--primary-deep);
    margin: 0 0 24px;
}

.hub-subtitle {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 300;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
    max-width: 580px;
}

.hub-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.hub-card {
    position: relative;
}

.hub-card-link {
    display: block;
    background: var(--cream-dark);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    text-decoration: none;
    color: inherit;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.hub-card-link:hover {
    background: var(--cream);
    border-color: var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    text-decoration: none;
}

.hub-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.hub-card-topic {
    color: var(--accent);
}

.hub-card-dot {
    color: var(--teal-muted);
    font-size: 0.9rem;
}

.hub-card-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.6vw, 1.9rem);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--primary-deep);
    margin: 0 0 16px;
}

.hub-card-link:hover .hub-card-title {
    color: var(--primary);
}

.hub-card-excerpt {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0 0 22px;
}

.hub-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
}

.hub-card-cta-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

.hub-card-link:hover .hub-card-cta-arrow {
    transform: translateX(4px);
}

.hub-coming-soon {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--text-muted);
    text-align: center;
}

.hub-coming-soon a {
    color: var(--primary-mid);
    text-decoration: underline;
    text-decoration-color: var(--teal-muted);
    text-underline-offset: 3px;
}

.hub-coming-soon a:hover {
    color: var(--accent);
}

@media (max-width: 720px) {
    .hub-page {
        padding-top: 120px;
        padding-bottom: 64px;
    }
    .hub-hero {
        margin-bottom: 48px;
        padding-bottom: 40px;
    }
    .hub-card-link {
        padding: 28px 24px;
    }
}


/* ===== Hero ===== */
.article-hero {
    margin-bottom: 56px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border-light);
}

.article-eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 28px;
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4.8vw, 3.5rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--primary-deep);
    margin: 0 0 24px;
}

.article-subtitle {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-style: italic;
    font-weight: 300;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0 0 32px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.article-meta-byline {
    color: var(--text-secondary);
}

.article-meta-dot {
    color: var(--teal-muted);
    font-size: 0.875rem;
}

.article-meta-updated {
    color: var(--primary-mid);
}

/* ===== TOC ===== */
.article-toc {
    background: var(--cream-dark);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 18px 28px;
    margin-bottom: 56px;
}

.article-toc summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--primary-deep);
}

.article-toc summary::-webkit-details-marker { display: none; }

.article-toc-icon {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--accent);
    line-height: 1;
    transition: transform 0.25s ease;
}

.article-toc[open] .article-toc-icon { transform: rotate(45deg); }

.article-toc nav {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.article-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-toc li {
    margin: 8px 0;
}

.article-toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.15s ease;
}

.article-toc a:hover {
    color: var(--accent);
}

.article-toc ul ul {
    margin-left: 16px;
    margin-top: 4px;
    font-size: 0.9rem;
}

/* ===== Article body — prose foundation ===== */
.article-body {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.78;
    color: var(--text);
}

.article-body > p,
.article-body > ul,
.article-body > ol,
.article-body > blockquote,
.article-body > pre,
.article-body > table {
    margin: 0 0 1.4em;
}

/* Drop cap on the first paragraph */
.article-body > p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 4.5rem;
    line-height: 0.85;
    float: left;
    color: var(--primary-deep);
    padding: 0.18em 0.12em 0 0;
    margin: 0;
}

/* ===== Headings inside article ===== */
.article-body h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--primary-deep);
    margin: 4rem 0 1.25rem;
    scroll-margin-top: 100px;
}

.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.35;
    color: var(--primary-deep);
    margin: 2.5rem 0 0.9rem;
    text-transform: none;
}

/* KPI section headers — eyebrow number + title */
.article-body h2.kpi-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5rem;
    padding-top: 1rem;
}

.article-body h2.kpi-heading .kpi-num {
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

.article-body h2.kpi-heading .kpi-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--primary-deep);
}

/* Subheading directly under KPI heading (the "Difficulty: ..." line) */
.article-body h2.kpi-heading + p em {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--text-secondary);
}

/* ===== Inline text ===== */
.article-body p {
    margin-bottom: 1.4em;
}

.article-body strong {
    font-weight: 600;
    color: var(--primary-deep);
}

.article-body em {
    font-style: italic;
}

.article-body a {
    color: var(--primary-mid);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: var(--teal-muted);
    transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.article-body a:hover {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* ===== Lists ===== */
.article-body ul,
.article-body ol {
    padding-left: 1.5em;
    margin: 0 0 1.4em;
}

.article-body li {
    margin: 0.5em 0;
}

.article-body ul > li::marker {
    color: var(--accent);
}

.article-body ol > li::marker {
    color: var(--accent);
    font-weight: 600;
}

/* ===== Blockquote ===== */
.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 4px 0 4px 24px;
    margin: 2em 0;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 300;
    font-size: 1.25rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

.article-body blockquote p:last-child { margin-bottom: 0; }

/* ===== Formulas (fenced code blocks) — styled as callouts, not dev code ===== */
.article-body pre {
    background: var(--cream-dark);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 22px 26px 22px 26px;
    margin: 2em 0;
    position: relative;
    overflow-x: auto;
}

.article-body pre::before {
    content: "Formula";
    display: block;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--primary-mid);
    margin-bottom: 10px;
}

.article-body pre code {
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.95rem;
    color: var(--primary-deep);
    background: transparent;
    padding: 0;
    line-height: 1.6;
    white-space: pre-wrap;
}

.article-body p code,
.article-body li code {
    font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 0.88em;
    background: var(--cream-dark);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-deep);
}

/* ===== Horizontal rule — replaced visually with three dots ===== */
.article-body hr {
    border: none;
    height: 32px;
    margin: 3.5rem 0;
    background: none;
    position: relative;
}

.article-body hr::after {
    content: "· · ·";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--accent);
    letter-spacing: 0.3em;
}

/* ===== Tables ===== */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    border-top: 1px solid var(--primary);
    border-bottom: 1px solid var(--primary);
    margin: 2em 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.article-body thead {
    border-bottom: 1px solid var(--border);
    background: var(--cream-dark);
}

.article-body th {
    text-align: left;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--primary-deep);
    line-height: 1.3;
}

.article-body td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
    color: var(--text);
    line-height: 1.55;
}

.article-body tbody tr:last-child td {
    border-bottom: none;
}

/* First column gets a slightly different treatment — feels like "row label" */
.article-body td:first-child {
    font-weight: 500;
    color: var(--primary-deep);
}

/* Compact two-col benchmark tables (target/warning/intervention) feel like reference cards */
.article-body table.bench {
    max-width: 480px;
}

/* ===== Footnotes (auto-generated by Python-Markdown's footnotes extension) ===== */
.article-body sup {
    font-size: 0.7em;
    line-height: 1;
    vertical-align: super;
}

.article-body sup a,
.article-body .footnote-ref a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 0 2px;
}

.article-body sup a:hover,
.article-body .footnote-ref a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.article-body .footnote {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.article-body .footnote::before {
    content: "Notes & References";
    display: block;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary-deep);
    margin-bottom: 1.2rem;
}

.article-body .footnote hr { display: none; }

.article-body .footnote ol {
    padding-left: 1.5em;
}

.article-body .footnote li {
    margin: 0.85em 0;
}

.article-body .footnote li p {
    margin-bottom: 0;
    display: inline;
}

.article-body .footnote-backref {
    text-decoration: none;
    color: var(--teal-muted);
    margin-left: 6px;
    font-size: 1rem;
}

.article-body .footnote-backref:hover {
    color: var(--accent);
}

/* ===== Mobile ===== */
@media (max-width: 720px) {
    .article-page {
        padding-top: 110px;
        padding-bottom: 60px;
    }

    .article-container {
        padding: 0 22px;
    }

    .article-hero {
        margin-bottom: 40px;
        padding-bottom: 36px;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.72;
    }

    .article-body > p:first-of-type::first-letter {
        font-size: 3.6rem;
    }

    .article-body h2,
    .article-body h2.kpi-heading .kpi-title {
        font-size: 1.65rem;
    }

    .article-body h2.kpi-heading {
        margin-top: 3.5rem;
    }

    .article-body pre {
        padding: 18px 20px;
    }

    .article-body pre code {
        font-size: 0.85rem;
    }

    /* Tables: allow horizontal scroll on narrow screens */
    .article-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .article-body th,
    .article-body td {
        padding: 12px 14px;
        font-size: 0.875rem;
    }

    .site-nav { gap: 18px; }
    .site-nav-link { font-size: 0.875rem; }
}

/* ===== Print (article should print cleanly) ===== */
@media print {
    .header, .footer, .article-toc, .site-nav { display: none; }
    .article-page { padding-top: 0; }
    .article-body { font-size: 11pt; line-height: 1.5; }
    .article-body a { color: var(--text); text-decoration: none; }
}
