/*
 * Blog styles.
 *
 * Same design tokens as the landing page (views/home.php) so the two read as
 * one site, but written as plain CSS: the landing is a scroll-snap single page
 * with `overflow: hidden` on the body, and the blog needs an ordinary
 * document that scrolls.
 */

:root {
    --l2-gold: #d4af37;
    --l2-blue: #009dff;
    --l2-red: #ff3c00;
    --l2-purple: #a855f7;
    --l2-green: #22c55e;
    --surface: #050507;
    --surface-raised: #101014;
    --surface-variant: rgba(20, 20, 25, 0.85);
    --outline: #3a3a40;
    --text: #d1d1d6;
    --text-dim: #a1a1aa;
    --text-faint: #71717a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.blog-body {
    margin: 0;
    background-color: var(--surface);
    color: var(--text);
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    /*
     * `clip`, not `hidden`. overflow-x: hidden turns the body into a scroll
     * container, and every `position: sticky` inside it silently stops working —
     * which is exactly what killed the side rails. `clip` prevents sideways
     * scrolling without creating that container.
     */
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--l2-gold); }

img { max-width: 100%; height: auto; }

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* ============================ Shell ============================ */

.lang-flags { display: flex; gap: 8px; align-items: center; }
.lang-flags a { font-size: 18px; opacity: 0.45; transition: opacity 0.2s; text-decoration: none; }
.lang-flags a:hover { opacity: 1; }
.lang-flags a.active { opacity: 1; filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.8)); }
.lang-flags span { font-size: 18px; opacity: 0.15; cursor: not-allowed; }

.l2-button-primary {
    display: inline-block;
    background: linear-gradient(to bottom, #8a6d2d, #4a3d1d);
    border: 1px solid var(--l2-gold);
    color: #fff;
    text-decoration: none;
    padding: 0.65rem 1.5rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: transform 0.15s, filter 0.15s;
}
.l2-button-primary:hover { transform: translateY(-1px); filter: brightness(1.15); }

/*
 * Width scales with the viewport instead of stopping at a fixed cap. The
 * article column and the rails both grow, so a 2560px monitor is not mostly
 * empty margin — but the prose column is bounded further down so line length
 * stays readable rather than running to 200 characters.
 */
.blog-main {
    width: 100%;
    max-width: 2200px;
    margin: 0 auto;
    padding: 2.5rem clamp(1.5rem, 3vw, 3.5rem) 4rem;
}

/* ========================= Listing ============================= */

.blog-hero { text-align: center; margin-bottom: 2.5rem; }
.blog-hero h1 {
    font-family: 'Noto Serif', serif;
    font-style: italic;
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 0 0 0.5rem;
    color: #fff;
}
.blog-hero p { color: var(--text-dim); max-width: 72ch; margin: 0 auto; }

.pillar-nav { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 1.75rem 0 2.5rem; }
.pillar-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--outline);
    background: rgba(0, 0, 0, 0.3);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s;
}
.pillar-nav a:hover { border-color: var(--l2-gold); color: var(--l2-gold); }
.pillar-nav a.active { border-color: var(--l2-gold); color: var(--l2-gold); background: rgba(212, 175, 55, 0.08); }

/* auto-fill, so a wide monitor gets more cards rather than wider ones. */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

@media (min-width: 1500px) {
    .card-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.75rem; }
}

.blog-card {
    display: flex;
    flex-direction: column;
    background: var(--surface-raised);
    border: 1px solid var(--outline);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s;
    overflow: hidden;
}
.blog-card:hover { border-color: var(--l2-gold); transform: translateY(-2px); }
.blog-card-image { aspect-ratio: 40 / 21; background-size: cover; background-position: center; background-color: #0b0b0f; }
.blog-card-body { padding: 1.1rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.blog-card-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.blog-card-meta .pillar { color: var(--l2-gold); }
.blog-card h2, .blog-card h3 {
    font-family: 'Noto Serif', serif;
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0;
    color: #fff;
}
.blog-card p { margin: 0; font-size: 0.875rem; color: var(--text-dim); line-height: 1.6; }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-faint); }

.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 2.5rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--outline);
    text-decoration: none;
    color: var(--text-dim);
    font-size: 13px;
}
.pagination .current { border-color: var(--l2-gold); color: var(--l2-gold); }

/* ========================= Article ============================= */

/*
 * Three columns on a wide screen: banners | article | table of contents.
 * The rails collapse into normal flow below 1024px, where a sticky sidebar
 * would just eat the viewport.
 */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "right" "left";
    gap: 2.5rem;
}
.article-rail-left  { grid-area: left; }
.article-rail-right { grid-area: right; }
.article-layout > article { grid-area: main; }

@media (min-width: 1024px) {
    .article-layout {
        grid-template-columns: minmax(0, 1fr) 264px;
        grid-template-areas: "main right" "left left";
        align-items: start;
        gap: 2.5rem 2rem;
    }
}

@media (min-width: 1360px) {
    .article-layout {
        grid-template-columns: 210px minmax(0, 1fr) 232px;
        grid-template-areas: "left main right";
    }
}

/*
 * The article takes the width; the rails stay narrow. The banners are text,
 * an icon and the logo, so they read fine in 220-300px, and the reading column
 * gets everything that is left. The grid centres once the article hits its cap.
 */
@media (min-width: 1500px) {
    .article-layout {
        grid-template-columns:
            minmax(260px, 380px)
            minmax(0, 860px)
            minmax(270px, 390px);
        justify-content: center;
        gap: 2.5rem 2.75rem;
    }

    /* Slightly larger type: the column is wider, the line count per screen
       stays the same, and it reads better on a big monitor. */
    .article-body { font-size: 1.06rem; }
    .article-title { font-size: clamp(2.2rem, 3vw, 3rem); }
}

.article-rail { display: flex; flex-direction: column; gap: 1.25rem; }
.article-rail-inner { display: flex; flex-direction: column; gap: 1.25rem; }

/* Below the three-column layout the right rail still follows the scroll. */
@media (max-width: 1359px) {
    .article-rail-right .article-rail-inner { position: sticky; top: 90px; }
}

@media (min-width: 1360px) {
    /*
     * The rail is a full-height container carrying the backdrop; the inner
     * wrapper is what sticks. Keeping them separate is what lets the artwork
     * cover the whole aside however long the article runs, while the cards
     * still ride the scroll.
     *
     * Block, not flex: as a flex item the inner wrapper would be stretched to
     * the container's height and sticky would have nowhere to travel.
     */
    .article-rail {
        display: block;
        align-self: stretch;
    }

    .article-rail-inner {
        position: sticky;
        top: 90px;
        z-index: 1;
    }

    .article-rail[style*='--rail-bg'] {
        position: relative;
        padding: 1.1rem 0.9rem;
        border: 1px solid rgba(255, 255, 255, 0.07);
    }

    /*
     * The artwork, at full strength — the darkening is the separate layer below,
     * so the two can be tuned independently.
     *
     * `100% auto` + `repeat-y` rather than a fixed attachment. With
     * `background-attachment: fixed` the image is sized and placed against the
     * VIEWPORT, not the rail: scaled to viewport height it came out narrower
     * than the rail, which left a black strip down one edge. Sizing to 100% of
     * the element guarantees the full width is covered whatever the rail is,
     * and repeating vertically covers the whole aside however long the article
     * runs — without the sixfold zoom that `cover` would produce on a column
     * twenty screens tall.
     */
    .article-rail[style*='--rail-bg']::before {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0;
        background-image: var(--rail-bg);
        background-size: 100% auto;
        background-position: center top;
        background-repeat: repeat-y;
        pointer-events: none;
    }

    /* Veil: tune the darkening without touching the image layer. */
    .article-rail[style*='--rail-bg']::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0;
        background: linear-gradient(to bottom, rgba(5, 5, 7, 0.42), rgba(5, 5, 7, 0.58));
        pointer-events: none;
    }

    /*
     * z-index only — NOT position: relative.
     *
     * This selector is more specific than .article-rail-inner, so declaring
     * `position: relative` here silently overrode the `position: sticky` on the
     * inner wrapper and the banners stopped following the scroll. Sticky is
     * already a positioned value, so z-index applies to it on its own.
     */
    .article-rail[style*='--rail-bg'] > * { z-index: 1; }
}

/* Flat black behind the prose, deliberately. */
.article-layout > article { background: transparent; }

.article-breadcrumb {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 1.25rem;
}
.article-breadcrumb a { color: var(--text-dim); text-decoration: none; }
.article-breadcrumb a:hover { color: var(--l2-gold); }

.article-title {
    font-family: 'Noto Serif', serif;
    font-style: italic;
    font-size: clamp(1.8rem, 4.2vw, 2.7rem);
    line-height: 1.2;
    margin: 0 0 1rem;
    color: #fff;
}
.article-subtitle { font-size: 1.05rem; color: var(--text-dim); margin: 0 0 1.5rem; }

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
    padding: 1rem 0;
    border-top: 1px solid var(--outline);
    border-bottom: 1px solid var(--outline);
    margin-bottom: 2rem;
    font-size: 13px;
    color: var(--text-faint);
}
.article-meta img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; object-position: top center; }
.article-meta a { color: var(--text); text-decoration: none; font-weight: 600; }
.article-meta a:hover { color: var(--l2-gold); }

.article-figure { margin: 0 0 2rem; }
.article-figure img { width: 100%; display: block; border: 1px solid var(--outline); }
.article-figure figcaption { font-size: 12px; color: var(--text-faint); padding-top: 0.5rem; font-style: italic; }

.article-body { font-size: 1.02rem; }
.article-body p { margin: 0 0 1.25rem; }
.article-body p.article-intro { font-size: 1.1rem; color: #e4e4e7; }
.article-body h2 {
    font-family: 'Noto Serif', serif;
    font-size: 1.6rem;
    color: #fff;
    margin: 2.5rem 0 1rem;
    padding-top: 0.5rem;
    scroll-margin-top: 90px;
}
.article-body h3 {
    font-family: 'Noto Serif', serif;
    font-size: 1.2rem;
    color: var(--l2-gold);
    margin: 1.75rem 0 0.75rem;
    scroll-margin-top: 90px;
}
.article-body a.article-link {
    color: var(--l2-blue);
    text-decoration: underline;
    text-decoration-color: rgba(0, 157, 255, 0.4);
    text-underline-offset: 3px;
}
.article-body a.article-link:hover { text-decoration-color: var(--l2-blue); }

/* ------------------------ Table of contents -------------------- */

.article-toc {
    border-left: 1px solid var(--outline);
    padding-left: 1rem;
}
.article-toc h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 0.75rem;
}
.article-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.article-toc li { counter-increment: toc; margin-bottom: 0.55rem; }
.article-toc a { color: var(--text-dim); text-decoration: none; font-size: 13px; line-height: 1.4; display: block; }
.article-toc a::before { content: counter(toc, decimal-leading-zero) '. '; color: var(--l2-gold); opacity: 0.6; }
.article-toc a:hover { color: var(--l2-gold); }

/* --------------------------- CTAs ------------------------------ */

.article-cta {
    margin: 2.5rem 0;
    border: 1px solid var(--outline);
    background: var(--surface-variant);
    position: relative;
    overflow: hidden;
}
.article-cta-hero::before,
.article-cta-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--cta-image);
    background-size: cover;
    background-position: center;
    opacity: 0.18;
}
.article-cta-body { position: relative; padding: 1.75rem; }
.article-cta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}
.article-cta-badge .material-symbols-outlined { font-size: 16px; }
.article-cta-title { font-family: 'Noto Serif', serif; font-size: 1.35rem; color: #fff; margin: 0 0 0.5rem; }
.article-cta-desc { color: var(--text-dim); margin: 0 0 1.25rem; font-size: 0.94rem; }
.article-cta-button { margin-top: 0.25rem; }

.article-cta-inline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    flex-wrap: wrap;
    background: rgba(212, 175, 55, 0.05);
    border-left: 3px solid var(--l2-gold);
}
.article-cta-inline .article-cta-line { margin: 0; flex: 1; min-width: 200px; font-size: 0.95rem; color: #e4e4e7; }
.article-cta-icon { font-size: 22px; }

.text-l2-gold { color: var(--l2-gold); }
.text-l2-blue { color: var(--l2-blue); }
.text-l2-red { color: var(--l2-red); }
.text-l2-green { color: var(--l2-green); }
.text-l2-purple { color: var(--l2-purple); }

/* ---------------------------- FAQs ----------------------------- */

.article-faqs { margin: 3rem 0; }
.article-faqs > h2 { font-family: 'Noto Serif', serif; font-size: 1.6rem; color: #fff; margin-bottom: 1.25rem; }
.article-faqs details {
    border: 1px solid var(--outline);
    background: var(--surface-raised);
    margin-bottom: 0.6rem;
}
.article-faqs summary {
    cursor: pointer;
    padding: 0.9rem 1.1rem;
    font-weight: 600;
    color: #fff;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.article-faqs summary::-webkit-details-marker { display: none; }
.article-faqs summary::after { content: '+'; color: var(--l2-gold); font-size: 1.2rem; line-height: 1; }
.article-faqs details[open] summary::after { content: '−'; }
.article-faqs details p { margin: 0; padding: 0 1.1rem 1.1rem; color: var(--text-dim); font-size: 0.94rem; }

/* --------------------------- Sources --------------------------- */

.article-sources { margin: 3rem 0; border-top: 1px solid var(--outline); padding-top: 1.5rem; }
.article-sources h2 { font-family: 'Noto Serif', serif; font-size: 1.25rem; color: #fff; margin: 0 0 0.4rem; }
.article-sources-note { font-size: 12px; color: var(--text-faint); margin: 0 0 1rem; }
.article-sources ol { margin: 0; padding-left: 1.2rem; }
.article-sources li { margin-bottom: 0.7rem; font-size: 0.9rem; }
.article-sources a { color: var(--l2-blue); }
.article-sources-host { display: block; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.article-sources-supports { display: block; font-size: 12px; color: var(--text-dim); font-style: italic; }

/* -------------------------- Disclaimer ------------------------- */

.article-disclaimer {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin: 2rem 0;
    padding: 1rem 1.1rem;
    border: 1px solid var(--outline);
    background: rgba(0, 0, 0, 0.35);
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.6;
}
.article-disclaimer .material-symbols-outlined { font-size: 18px; color: var(--text-dim); flex-shrink: 0; }
.article-disclaimer p { margin: 0; }
.article-disclaimer a { color: var(--text-dim); }

/* --------------------------- Author ---------------------------- */

.author-box {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin: 3rem 0;
    padding: 1.5rem;
    border: 1px solid var(--outline);
    background: var(--surface-raised);
}
.author-box img { width: 76px; height: 76px; object-fit: cover; object-position: top center; border: 1px solid var(--outline); flex-shrink: 0; }
.author-box h2 { font-family: 'Noto Serif', serif; font-size: 1.15rem; margin: 0 0 0.35rem; color: #fff; }
.author-box p { margin: 0; font-size: 0.9rem; color: var(--text-dim); }
.author-box .persona-note { font-size: 11px; color: var(--text-faint); margin-top: 0.5rem; font-style: italic; }

.author-hero { display: flex; gap: 1.5rem; align-items: center; margin-bottom: 2.5rem; flex-wrap: wrap; }
.author-hero img { width: 110px; height: 110px; object-fit: cover; object-position: top center; border: 1px solid var(--outline); }
.author-hero h1 { font-family: 'Noto Serif', serif; font-style: italic; font-size: 2rem; margin: 0 0 0.5rem; color: #fff; }

/* -------------------------- Comments --------------------------- */

.comments { margin: 3rem 0 0; }
.comments > h2 { font-family: 'Noto Serif', serif; font-size: 1.5rem; color: #fff; margin-bottom: 1.25rem; }
.comment { border-left: 2px solid var(--outline); padding: 0.25rem 0 0.25rem 1rem; margin-bottom: 1.5rem; }
.comment-head { font-size: 12px; color: var(--text-faint); margin-bottom: 0.35rem; }
.comment-head strong { color: var(--l2-gold); font-weight: 600; }
.comment p { margin: 0; font-size: 0.94rem; white-space: pre-line; }

.comment-form { margin-top: 2rem; border: 1px solid var(--outline); padding: 1.5rem; background: var(--surface-raised); }
.comment-form label { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.35rem; }
.comment-form input, .comment-form textarea {
    width: 100%;
    background: #0a0a0c;
    border: 1px solid var(--outline);
    color: var(--text);
    padding: 0.65rem 0.8rem;
    font-family: inherit;
    font-size: 0.94rem;
    margin-bottom: 1rem;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--l2-gold); }
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form .hp { position: absolute; left: -9999px; opacity: 0; }
.comment-form .form-note { font-size: 11px; color: var(--text-faint); margin: 0 0 1rem; }
.form-flash { padding: 0.75rem 1rem; border: 1px solid var(--outline); margin-bottom: 1.25rem; font-size: 0.9rem; }
.form-flash.ok { border-color: var(--l2-green); color: var(--l2-green); }
.form-flash.error { border-color: var(--l2-red); color: var(--l2-red); }

/* --------------------------- Related --------------------------- */

.related { margin: 3rem 0 0; }
.related > h2 { font-family: 'Noto Serif', serif; font-size: 1.4rem; color: #fff; margin-bottom: 1.25rem; }

/* ---------------------------- Legal ---------------------------- */

.legal-page { max-width: 760px; margin: 0 auto; }
.legal-page h1 { font-family: 'Noto Serif', serif; font-style: italic; font-size: 2.2rem; color: #fff; margin-bottom: 0.5rem; }
.legal-page h2 { font-family: 'Noto Serif', serif; font-size: 1.25rem; color: var(--l2-gold); margin: 2rem 0 0.75rem; }
.legal-page p, .legal-page li { color: var(--text-dim); font-size: 0.96rem; }
.legal-page .updated { font-size: 12px; color: var(--text-faint); margin-bottom: 2rem; }

/* ---------------------------- Admin ---------------------------- */

.admin-shell { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.admin-nav { display: flex; gap: 1rem; border-bottom: 1px solid var(--outline); padding-bottom: 1rem; margin-bottom: 2rem; flex-wrap: wrap; align-items: center; }
.admin-nav a { color: var(--text-dim); text-decoration: none; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; }
.admin-nav a.active, .admin-nav a:hover { color: var(--l2-gold); }
.admin-nav .badge { background: var(--l2-red); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; color: var(--text-faint); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.08em; padding: 0.5rem; border-bottom: 1px solid var(--outline); }
.admin-table td { padding: 0.7rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
.admin-table .status-draft { color: var(--l2-red); }
.admin-table .status-published { color: var(--l2-green); }
.admin-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-actions button {
    background: transparent;
    border: 1px solid var(--outline);
    color: var(--text-dim);
    padding: 0.25rem 0.6rem;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.admin-actions button:hover { border-color: var(--l2-gold); color: var(--l2-gold); }
.admin-actions button.danger:hover { border-color: var(--l2-red); color: var(--l2-red); }
.admin-login { max-width: 340px; margin: 6rem auto; }
.admin-login input { width: 100%; background: #0a0a0c; border: 1px solid var(--outline); color: var(--text); padding: 0.7rem 0.9rem; margin-bottom: 1rem; font-family: inherit; }
.admin-card { border: 1px solid var(--outline); padding: 1.25rem; margin-bottom: 1rem; background: var(--surface-raised); }
.admin-card .meta { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.admin-card blockquote { margin: 0 0 1rem; padding-left: 1rem; border-left: 2px solid var(--outline); white-space: pre-line; font-size: 0.92rem; }
.admin-form-field { margin-bottom: 1.25rem; }
.admin-form-field label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); margin-bottom: 0.35rem; }
.admin-form-field input, .admin-form-field textarea, .admin-form-field select {
    width: 100%; background: #0a0a0c; border: 1px solid var(--outline); color: var(--text);
    padding: 0.6rem 0.8rem; font-family: inherit; font-size: 0.92rem;
}
.admin-form-field textarea { min-height: 420px; resize: vertical; font-family: 'Courier New', monospace; font-size: 0.82rem; line-height: 1.5; }

/* ------------------- Inline (secondary) article image ------------------ */
/*
 * Deliberately narrower than the featured image and without the border
 * treatment of the hero figure: it breaks up the middle of a long read without
 * competing with the image at the top.
 */
.article-figure-inline {
    margin: 2.25rem auto;
    max-width: 82%;
}
.article-figure-inline img {
    width: 100%;
    display: block;
    border: 1px solid var(--outline);
    opacity: 0.92;
}
@media (max-width: 640px) {
    .article-figure-inline { max-width: 100%; }
}

/* --------------------------- Link variants ----------------------------- */

/* Links into the landing page's own sections. */
.article-body a.article-link-site {
    color: var(--l2-gold);
    text-decoration-color: rgba(212, 175, 55, 0.4);
}
.article-body a.article-link-site:hover { text-decoration-color: var(--l2-gold); }

/* Outbound editorial links, marked with a small external-link glyph. */
.article-body a.article-link-out {
    color: var(--l2-blue);
    text-decoration-color: rgba(0, 157, 255, 0.35);
}
.article-body a.article-link-out::after {
    content: '↗';
    font-size: 0.75em;
    margin-left: 2px;
    opacity: 0.65;
    text-decoration: none;
    display: inline-block;
}

/* ---------------- Explore: navigation into the landing page ------------- */
/*
 * Deliberately presented as navigation rather than as links buried in the
 * prose. In-text section links only appear when the article actually uses the
 * phrase; this row guarantees the page is never a dead end.
 */
.article-explore {
    margin: 2.5rem 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--outline);
    background: rgba(212, 175, 55, 0.03);
}
.article-explore h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 0.75rem;
}
.article-explore ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.article-explore a {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--l2-gold);
    text-decoration: none;
    font-size: 0.92rem;
}
.article-explore a:hover { text-decoration: underline; }
.article-explore .material-symbols-outlined { font-size: 16px; opacity: 0.7; }

/* -------------------- Structured blocks inside the body ---------------- */
/*
 * Lists, comparison tables and callouts. Wall-to-wall prose is harder to scan
 * and gives a search engine nothing to lift into a featured snippet.
 */

.article-body .block-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--l2-gold);
    margin: 1.75rem 0 0.6rem;
}

.article-body ul.article-list,
.article-body ol.article-list {
    margin: 0 0 1.5rem;
    padding-left: 1.35rem;
}
.article-body ul.article-list li,
.article-body ol.article-list li {
    margin-bottom: 0.55rem;
    padding-left: 0.25rem;
}
.article-body ul.article-list li::marker { color: var(--l2-gold); }
.article-body ol.article-list li::marker { color: var(--l2-gold); font-weight: 700; }

/* Tables scroll inside their own container so a wide comparison never forces
   the page itself to scroll sideways on a phone. */
.article-table-wrap { margin: 1.75rem 0; overflow-x: auto; }
.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 420px;
}
.article-table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    background: rgba(212, 175, 55, 0.07);
    border-bottom: 1px solid var(--l2-gold);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.article-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-dim);
    vertical-align: top;
}
.article-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

.article-callout {
    margin: 1.75rem 0;
    padding: 1rem 1.25rem;
    border-left: 3px solid var(--l2-blue);
    background: rgba(0, 157, 255, 0.05);
}
.article-callout .block-title { margin-top: 0; color: var(--l2-blue); }
.article-callout p:last-child { margin: 0; color: #e4e4e7; }

/* ========================= Sticky side banners ========================= */
/*
 * Identical on every article, unlike the in-body CTAs which follow the pillar.
 * They ride the scroll so they stay reachable through a long read without
 * interrupting it. Below 1024px they drop into normal flow after the article —
 * a sticky panel on a phone would just eat the viewport.
 */

.side-banner {
    border: 1px solid var(--outline);
    background: rgba(16, 16, 20, 0.82);
    backdrop-filter: blur(2px);
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}
.side-banner:hover { background: rgba(16, 16, 20, 0.92); }
.side-banner:hover { border-color: var(--l2-gold); }

.side-banner-body { padding: 0.9rem 1rem 1.1rem; }

/* Logo and section icon instead of artwork: the picture lives behind the whole
   rail, so the cards stay legible at 220px. */
.side-banner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.7rem;
}
.side-banner-head img { height: 26px; width: auto; opacity: 0.85; }
.side-banner-icon { font-size: 22px; opacity: 0.9; }

.side-banner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 0.45rem;
}
.side-banner-badge .material-symbols-outlined { font-size: 14px; }

.side-banner h2 {
    font-family: 'Noto Serif', serif;
    font-size: 0.98rem;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 0.4rem;
}
.side-banner p {
    margin: 0 0 0.85rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-dim);
}

.side-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--l2-gold);
    text-decoration: none;
}
.side-banner-cta .material-symbols-outlined { font-size: 15px; transition: transform 0.2s; }
.side-banner:hover .side-banner-cta .material-symbols-outlined { transform: translateX(2px); }

/* Side by side rather than stacked when they fall into normal flow. */
@media (max-width: 1359px) {
    .article-rail-left { flex-direction: row; flex-wrap: wrap; }
    .article-rail-left .side-banner { flex: 1 1 280px; }
}

/* ============ Structure pass: headings out of the chrome ============== */
/*
 * The promo blocks and the index used to be H2s, which put nine of them in the
 * outline before the article's own sections got a look in. They are paragraphs
 * now and carry these classes instead.
 */

.side-banner-title {
    font-family: 'Noto Serif', serif;
    font-size: 0.98rem;
    line-height: 1.3;
    color: #fff;
    margin: 0 0 0.4rem;
}

.author-box-name {
    font-family: 'Noto Serif', serif;
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
    color: #fff;
}
.author-box-name a { color: #fff; text-decoration: none; }
.author-box-name a:hover { color: var(--l2-gold); }

/* --------------------------- Index panel ------------------------------- */
/*
 * A panel rather than a bare list against the page: it needs enough ground of
 * its own to stay readable over the rail backdrop.
 */
.article-toc {
    background: rgba(10, 10, 14, 0.86);
    border: 1px solid var(--outline);
    border-left: 2px solid var(--l2-gold);
    padding: 1rem 1.1rem 1.1rem;
    backdrop-filter: blur(2px);
}

.article-toc-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--l2-gold);
    margin: 0 0 0.75rem;
}

/* Second-level entries indent, so the index mirrors the document hierarchy. */
.article-toc li.toc-level-3 { padding-left: 0.85rem; }
.article-toc li.toc-level-3 a { font-size: 12px; color: var(--text-faint); }
.article-toc li.toc-level-3 a:hover { color: var(--l2-gold); }

/* ------------------------- Cards, relisted ----------------------------- */

.card-grid { list-style: none; margin: 0; padding: 0; }
.card-grid > li { display: flex; }
.card-grid > li > .blog-card { width: 100%; }

.blog-card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }

/* The card image is a real <img> now; the wrapper keeps the aspect ratio. */
.blog-card-image { position: relative; aspect-ratio: 40 / 21; overflow: hidden; }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.blog-card-title {
    font-family: 'Noto Serif', serif;
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0;
    color: #fff;
}

/* ========================== Support form =============================== */
/*
 * The inputs used to take their width from the old external stylesheet, which
 * left them narrow and hugging the left edge. Sized and centred here instead,
 * with a measure wide enough to type a real support message into.
 */

.support-page { max-width: 760px; margin: 0 auto; }

.support-form {
    border: 1px solid var(--outline);
    background: var(--surface-raised);
    padding: 2rem clamp(1.25rem, 3vw, 2.25rem) 2.25rem;
}

/* Name and email share a row on anything wider than a phone. */
.support-row { display: grid; gap: 0 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 620px) {
    .support-row { grid-template-columns: 1fr 1fr; }
}

.support-field { margin-bottom: 1.35rem; }

.support-field label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.45rem;
}

.support-field input,
.support-field textarea {
    width: 100%;
    background: #0a0a0c;
    border: 1px solid var(--outline);
    color: var(--text);
    padding: 0.8rem 0.95rem;
    font-family: inherit;
    font-size: 0.98rem;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.support-field input:focus,
.support-field textarea:focus {
    outline: none;
    border-color: var(--l2-gold);
}
.support-field input::placeholder,
.support-field textarea::placeholder { color: var(--text-faint); }

.support-field textarea { min-height: 190px; resize: vertical; }

.support-note {
    font-size: 12px;
    color: var(--text-faint);
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.support-submit {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 12px;
    border: 1px solid var(--l2-gold);
    cursor: pointer;
}
@media (min-width: 620px) {
    .support-submit { width: auto; min-width: 220px; margin: 0 auto; }
}

/* Shared with the comment form: off-screen rather than display:none, which
   some bots treat as a signal to skip the field. */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

/* ---------------------------- Tickets --------------------------------- */
/*
 * The reference travels by email, but people lose emails, so the lookup box
 * sits under the form — quieter than it, because writing a new enquiry is the
 * common case and following an old one is not.
 */

.support-lookup { margin: 1.75rem 0 0; text-align: center; }

.support-lookup label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.6rem;
}

.support-lookup-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.support-lookup-row input {
    background: #0a0a0c;
    border: 1px solid var(--outline);
    color: var(--text);
    padding: 0.6rem 0.8rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    min-width: 230px;
}
.support-lookup-row input:focus { outline: none; border-color: var(--l2-gold); }

.support-lookup-row button {
    background: transparent;
    border: 1px solid var(--outline);
    color: var(--text-dim);
    padding: 0.6rem 1.2rem;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.support-lookup-row button:hover { border-color: var(--l2-gold); color: var(--l2-gold); }

/* The ticket's own page: the enquiry, every reply, and the box to add one. */
.ticket-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--outline);
    padding-bottom: 1rem;
    margin-bottom: 1.75rem;
}
.ticket-meta strong { color: var(--l2-gold); font-weight: 500; }
.ticket-meta .ticket-status-answered { color: var(--l2-green); }
.ticket-meta .ticket-status-closed { color: var(--text-faint); }

.ticket-message {
    border: 1px solid var(--outline);
    background: var(--surface-raised);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

/* Staff replies carry the gold edge; the visitor's own words stay plain, so a
   long thread can be read by shape before it is read by name. */
.ticket-message.from-staff { border-left: 2px solid var(--l2-gold); }

.ticket-message .who {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 0.6rem;
}
.ticket-message .body { white-space: pre-line; line-height: 1.7; font-size: 0.97rem; }
