/* ==========================================================================
   Oselu Africa theme
   Mobile first. Colour, type and spacing tokens live in :root.
   ========================================================================== */

@font-face { font-family: 'Switzer'; src: url('../fonts/switzer-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('../fonts/switzer-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('../fonts/switzer-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('../fonts/literata-roman.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Erode'; src: url('../fonts/erode-roman.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Erode'; src: url('../fonts/erode-italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
    --blue: #1C3FAA;
    --zobo: #B3124A;
    --danfo: #FFC20E;
    --ink: #12162A;
    --paper: #FBF8F1;
    --white: #FFFFFF;
    --muted: #59607A;
    --soft: #343A52;
    --rule: #E2DED2;
    --wash: #E8EDFA;
    --on-blue-soft: #DCE2F5;
    --on-blue-mute: #C9D3F0;
    --danfo-text: #8A6400;

    --font-display: var(--gh-font-heading, 'Literata', Georgia, 'Times New Roman', serif);
    --font-text: var(--gh-font-body, 'Erode', Georgia, 'Times New Roman', serif);
    --font-ui: "Switzer", system-ui, -apple-system, "Segoe UI", sans-serif;
    --display-weight: 800;
    --display-tracking: -0.01em;

    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --radius-s: 6px;
    --radius-m: 12px;
    --radius-l: 20px;
    --gutter: 16px;
    --max: 1180px;
}

@media (min-width: 900px) { :root { --gutter: 24px; } }

/* Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: 88px;
}
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; font-size: 16px; }
::selection { background: var(--danfo); color: var(--ink); }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }

a, button, [role="tab"] { touch-action: manipulation; }
button, [role="tab"], .press, .chip, .tab, .pill, .btn {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.on-dark :focus-visible { outline-color: var(--danfo); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 50;
    background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--radius-s);
}
.skip-link:focus { top: 12px; }

.accent-text { color: var(--blue); }

/* Press feedback, shared ------------------------------------------------ */
.press { transition: transform 160ms var(--ease-out); }
.press:active { transform: scale(0.97); }

.hit { position: relative; }
.hit::after { content: ""; position: absolute; inset: -7px -4px; }

/* Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
    font-family: var(--font-ui); font-size: 15px; font-weight: 600; line-height: 1;
    cursor: pointer; white-space: nowrap;
}
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { min-height: 48px; padding: 0 24px; }
.btn-primary { background: var(--blue); color: var(--paper); }
.btn-danfo { background: var(--danfo); color: var(--ink); }
.pill {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
    border: 1.5px solid var(--ink); border-radius: 999px; background: transparent;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip {
    display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px;
    border-radius: 999px; background: var(--danfo); color: var(--ink);
    font-size: 13px; font-weight: 600;
}
.link-quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-weight: 500; }
.flink { text-underline-offset: 4px; }
.hl { text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--danfo); }

/* Translucent bars (Apple material), solid when transparency is reduced */
.bar {
    background: rgba(251, 248, 241, 0.82);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
}

/* Navigation list ------------------------------------------------------- */
.nav { display: flex; gap: 4px 20px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-underline-offset: 4px; }
.nav .is-current .nav-link { text-decoration: underline; text-decoration-color: var(--danfo); text-decoration-thickness: 3px; }

/* Homepage top ---------------------------------------------------------- */
.home-bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; justify-content: space-between; align-items: center;
    padding: env(safe-area-inset-top, 0px) 8px 0 18px;
    font-size: 14px;
}
.home-bar-actions { display: flex; align-items: center; gap: 8px; }
.masthead { max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter) 0; text-align: center; }
.masthead-logo { margin: 0; display: flex; justify-content: center; }
.masthead-logo a { display: block; width: min(256px, 72vw); }
.masthead-logo svg { display: block; width: 100%; height: auto; }
.masthead-tagline { margin: 16px auto 18px; max-width: 30ch; font-size: 18px; line-height: 1.35; font-weight: 500; text-wrap: balance; }
.masthead-logo + .masthead-rule { margin-top: 18px; }
.masthead-rule {
    margin: 0; padding: 10px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
    font-size: 12px; letter-spacing: 0.01em; color: var(--muted);
}

/* Lead story ----------------------------------------------------------- */
.home { max-width: var(--max); margin: 0 auto; padding: 0 12px; }
.lead { padding-top: 22px; }
.lead-media { display: block; border-radius: var(--radius-l); overflow: hidden; background: #2A2E3B; aspect-ratio: 3 / 2; }
.lead-media img { width: 100%; height: 100%; object-fit: cover; }
.lead-placeholder { display: block; width: 100%; height: 100%; background: var(--blue); }
.lead-text { padding: 16px 6px 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 10px; font-size: 13px; letter-spacing: 0.01em; color: var(--muted); }
.meta-tag { font-weight: 600; color: var(--blue); }
.lead-title {
    margin: 0; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: clamp(34px, 9vw, 64px); line-height: 1.02; letter-spacing: var(--display-tracking); text-wrap: balance;
}
.lead-excerpt { margin: 12px 0 0; font-family: var(--font-text); font-size: 18px; line-height: 1.45; }
.byline { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.lead .btn { margin-top: 16px; }

/* Sign-up block ------------------------------------------------------- */
.signup { margin-top: 30px; background: var(--danfo); border-radius: var(--radius-l); padding: 22px 16px 18px; }
.signup-title {
    margin: 0 0 14px; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: 25px; line-height: 1.1; letter-spacing: var(--display-tracking); text-wrap: balance;
}

/* Subscribe form (Ghost adds .loading / .success / .error) -------------- */
.subscribe-form { max-width: 520px; }
.subscribe-field { display: flex; background: var(--white); border: 1.5px solid var(--ink); border-radius: 999px; padding: 4px; }
.subscribe-field input {
    flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
    background: transparent; color: var(--ink);
}
.subscribe-field input::placeholder { color: #6E7591; }
.subscribe-field input:focus-visible { outline: none; }
.subscribe-field:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.form-note, .form-success, .form-error, .form-member { margin: 10px 4px 0; font-size: 13px; }
.form-success, .form-error, .btn-loading { display: none; }
.subscribe-form.loading .btn-label { display: none; }
.subscribe-form.loading .btn-loading { display: inline; }
.subscribe-form.success .subscribe-field, .subscribe-form.success .form-note { display: none; }
.subscribe-form.success .form-success { display: block; font-size: 15px; font-weight: 600; }
.subscribe-form.error .form-error { display: block; }
.on-dark .subscribe-field { background: transparent; border-color: var(--paper); }
.on-dark .subscribe-field input { color: var(--paper); }
.on-dark .subscribe-field input::placeholder { color: var(--on-blue-mute); }
.on-dark .subscribe-field:focus-within { outline-color: var(--danfo); }
.on-dark .form-note { color: var(--on-blue-mute); }

/* Search -------------------------------------------------------------- */
.search-field {
    display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 30px; height: 48px; padding: 0 16px;
    border: 1.5px solid var(--ink); border-radius: 999px; background: var(--white); color: #6E7591;
    font-size: 16px; text-align: left; cursor: pointer;
}
.search-field svg { color: var(--ink); flex: none; }

/* Theme folders --------------------------------------------------------- */
.folders { margin-top: 22px; }
.tabs { display: flex; gap: 4px; padding: 0 12px; overflow-x: auto; align-items: flex-end; }
.strip {
    scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: none; scroll-padding-inline: 12px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
}
.strip::-webkit-scrollbar { display: none; }
.tab {
    flex: 0 0 auto; scroll-snap-align: start; display: inline-flex; align-items: center;
    min-height: 44px; padding: 0 14px; margin-bottom: -1px;
    border: 1.5px solid var(--tone-edge); border-bottom: 0; border-radius: 12px 12px 0 0;
    background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--tone-bg); color: var(--tone-fg); border-color: var(--tone-bg); }
.panel {
    border-radius: 0 0 var(--radius-l) var(--radius-l); padding: 14px 8px 12px;
    background: var(--tone-bg); color: var(--tone-fg);
    transition: background-color 200ms ease, color 200ms ease;
}
.panel[hidden] { display: none; }
.panel-count { margin: 0 8px 12px; font-size: 13px; color: var(--tone-sub); }
.panel-list { display: grid; gap: 8px; }
.panel-more {
    display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px;
    border: 1.5px solid currentColor; border-radius: 999px; font-size: 14px; font-weight: 600;
}
.panel-empty { padding: 20px 8px; font-size: 17px; font-weight: 600; }

.tone-all { --tone-bg: #EFEBE1; --tone-fg: var(--ink); --tone-sub: var(--muted); --tone-edge: #A9A497; }
.tone-0 { --tone-bg: var(--blue); --tone-fg: var(--paper); --tone-sub: var(--on-blue-mute); --tone-edge: var(--blue); }
.tone-1 { --tone-bg: var(--zobo); --tone-fg: var(--paper); --tone-sub: #F6D3DE; --tone-edge: var(--zobo); }
.tone-2 { --tone-bg: var(--danfo); --tone-fg: var(--ink); --tone-sub: var(--ink); --tone-edge: #C99700; }
.tone-3 { --tone-bg: var(--ink); --tone-fg: var(--paper); --tone-sub: #B9BDCC; --tone-edge: var(--ink); }
.panel.tone-0 :focus-visible, .panel.tone-1 :focus-visible, .panel.tone-3 :focus-visible { outline-color: var(--danfo); }
.panel.tone-2 :focus-visible { outline-color: var(--ink); }

/* Cards -------------------------------------------------------------- */
.card {
    --tint: #DCD7CB; --tag: var(--blue);
    display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center;
    padding: 8px; border-radius: var(--radius-m); background: var(--white); color: var(--ink);
    transition: background-color 150ms ease, transform 160ms var(--ease-out);
}
.card-media { display: block; aspect-ratio: 1; border-radius: var(--radius-s); overflow: hidden; background: var(--tint); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: block; padding-right: 6px; }
.card-tag { display: block; font-size: 12px; font-weight: 600; color: var(--tag); }
.card-title {
    display: block; margin-top: 3px; font-family: var(--font-display); font-weight: 700;
    font-size: 18px; line-height: 1.15; letter-spacing: var(--display-tracking);
}
.card-excerpt { display: none; }
.card-meta { display: block; margin-top: 4px; font-size: 12px; letter-spacing: 0.01em; color: var(--muted); }

/* First card in a panel is the big one on phones */
.panel-list > .card:first-child { grid-template-columns: 1fr; gap: 0; }
.panel-list > .card:first-child .card-media { aspect-ratio: 16 / 9; }
.panel-list > .card:first-child .card-body { padding: 14px 8px 6px; }
.panel-list > .card:first-child .card-title { font-size: 24px; font-weight: var(--display-weight); line-height: 1.08; margin-top: 6px; }
.panel-list > .card:first-child .card-excerpt { display: block; margin-top: 8px; font-family: var(--font-text); font-size: 16px; line-height: 1.4; color: var(--soft); }

.tag-politics { --tint: #D6DEF5; --tag: var(--blue); }
.tag-history { --tint: #F2D4DE; --tag: var(--zobo); }
.tag-people { --tint: #FBEAB0; --tag: var(--danfo-text); }
.tag-ideas { --tint: #D9DAE0; --tag: var(--ink); }

/* Compact site bar --------------------------------------------------- */
.site-bar { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px); box-shadow: 0 1px 0 rgba(18, 22, 42, 0.08); }
.site-bar-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 12px 6px var(--gutter); }
.site-bar-logo { display: block; width: 100px; padding: 6px 0; }
.site-bar-logo svg { display: block; width: 100%; height: auto; }
.site-bar-nav { display: none; }
.site-bar-actions { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.site-bar-actions .link-quiet { display: none; }
.progress-track { height: 3px; }
.progress-bar { height: 3px; width: 100%; background: var(--zobo); transform: scaleX(0); transform-origin: left center; }

/* Post hero ---------------------------------------------------------- */
.post-hero { background: var(--blue); color: var(--paper); }
.post-hero-inner { max-width: var(--max); margin: 0 auto; padding: 28px 20px 30px; }
.post-title {
    margin: 16px 0 0; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: clamp(36px, 10vw, 84px); line-height: 1; letter-spacing: var(--display-tracking); text-wrap: balance;
}
.post-excerpt { margin: 14px 0 0; font-family: var(--font-text); font-size: 19px; line-height: 1.45; color: var(--on-blue-soft); }
.byline-block { display: flex; gap: 10px; align-items: center; margin-top: 20px; font-size: 13px; line-height: 1.4; }
.byline-block p { margin: 0; }
.byline-block strong { font-weight: 600; }
.byline-meta { color: var(--on-blue-soft); }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--danfo); }
.avatar-lg { width: 52px; height: 52px; }
.avatar-xl { width: 96px; height: 96px; }
.avatar-empty { display: inline-block; }

.post-image { margin: 20px var(--gutter) 0; }
.post-image img { width: 100%; border-radius: 16px; }
.post-image figcaption, .gh-content figcaption { margin-top: 10px; font-size: 13px; line-height: 1.45; color: var(--muted); }

.post-layout { padding: 0 20px; }
.post-rail { display: none; }
.toc { margin-top: 24px; }
.toc-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-list a { display: flex; gap: 12px; align-items: baseline; padding: 11px 0; font-size: 15px; text-underline-offset: 4px; }
.toc-list a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); font-weight: 600; color: var(--blue); }
.gh-content .toc-mobile { font-family: var(--font-ui); font-size: 16px; line-height: 1.5; margin: 0 0 28px; }
.gh-content .toc-list a { color: inherit; text-decoration: none; }
.toc-list a[aria-current="true"] { text-decoration: underline; text-decoration-color: var(--danfo); text-decoration-thickness: 3px; }

/* Reading text ------------------------------------------------------- */
.gh-content {
    margin-top: 26px; font-family: var(--font-text); font-size: 19px; line-height: 1.65; color: var(--ink);
    overflow-wrap: break-word;
}
.gh-content > * { margin: 0 0 20px; }
.gh-content > :last-child { margin-bottom: 0; }
.gh-content a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.gh-content h2, .gh-content h3 {
    font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.12;
}
.gh-content h2 { margin: 40px 0 14px; font-size: 27px; }
.gh-content h3 { margin: 32px 0 12px; font-size: 22px; font-weight: 700; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: 8px; }
.gh-content hr { border: 0; height: 1px; background: var(--rule); margin: 40px 0; }
.gh-content blockquote:not(.kg-blockquote-alt) { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--blue); font-style: italic; }
.gh-content code { font-size: 0.85em; background: var(--wash); padding: 0.1em 0.35em; border-radius: 4px; }

/* Drop cap on the first paragraph */
.gh-content > p.has-dropcap::first-letter {
    float: left; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: 4.1em; line-height: 0.82; margin: 0.1em 0.12em 0 0; color: var(--blue);
}

/* Pull quote: Ghost's alternative quote style */
.gh-content .kg-blockquote-alt {
    margin: 36px 0; padding: 0; border: 0; text-align: left; font-style: normal;
    font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 6vw, 34px); line-height: 1.15;
    letter-spacing: var(--display-tracking); color: var(--zobo); text-wrap: balance;
}
.gh-content .kg-blockquote-alt::before {
    content: ""; display: block; width: 46px; height: 30px; margin-bottom: 12px;
    background: no-repeat left center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 60'%3E%3Cg fill='%23B3124A'%3E%3Cpath transform='translate(20 30) rotate(-35)' d='M-8.5,-20 A8.5,8.5 0 0 1 8.5,-20 L4.25,20 A4.25,4.25 0 0 1 -4.25,20 Z'/%3E%3Cpath transform='translate(48 30) rotate(-35)' d='M-8.5,-20 A8.5,8.5 0 0 1 8.5,-20 L4.25,20 A4.25,4.25 0 0 1 -4.25,20 Z'/%3E%3C/g%3E%3C/svg%3E");
}

/* Callouts: notes, context, "from the constitution" */
.gh-content .kg-callout-card {
    display: block; margin: 28px 0; padding: 18px; border-radius: 14px;
    background: var(--wash) !important; color: var(--ink);
    font-family: var(--font-ui); font-size: 16px; line-height: 1.55;
}
.gh-content .kg-callout-card .kg-callout-emoji { display: none; }
.gh-content .kg-callout-card .kg-callout-text { font-size: inherit; }

/* The short version: the first callout of a post, rebuilt by main.js */
.gh-content .short-version {
    background: var(--white) !important; border: 1.5px solid var(--ink); border-radius: 16px; padding: 18px 18px 20px;
}
.short-version-title {
    margin: 0 0 14px; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: 22px; line-height: 1.1; letter-spacing: var(--display-tracking);
}
.short-version-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.short-version-list li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.short-version-list li::before {
    content: ""; flex: none; width: 11px; height: 18px; margin-top: 3px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-120 -200 240 400'%3E%3Cpath fill='%23B3124A' transform='rotate(-35)' d='M-68,-160 A68,68 0 0 1 68,-160 L34,160 A34,34 0 0 1 -34,160 Z'/%3E%3C/svg%3E");
}

/* Embeds: Ghost stores YouTube and Vimeo iframes at 200x113, so size them to the column */
.gh-content .kg-embed-card { display: flex; flex-direction: column; align-items: center; width: 100%; }
.gh-content .kg-embed-card iframe[src*="youtube"],
.gh-content .kg-embed-card iframe[src*="youtu.be"],
.gh-content .kg-embed-card iframe[src*="vimeo"],
.gh-content .kg-embed-card iframe[src*="dailymotion"] {
    width: 100% !important; height: auto !important; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-m); background: var(--ink);
}
.gh-content .kg-embed-card > :not(iframe) { max-width: 100%; }

/* Ghost card widths (required) */
.gh-content .kg-width-wide { margin-left: 0; margin-right: 0; }
.gh-content .kg-width-full { margin-left: -20px; margin-right: -20px; }
.gh-content .kg-width-full img { border-radius: 0; }
.gh-content .kg-image { border-radius: var(--radius-m); }

/* Members gate ------------------------------------------------------- */
.gate {
    position: relative; margin: 8px 0 0; padding: 26px 20px 24px; border-radius: var(--radius-l);
    background: var(--blue); color: var(--paper); font-family: var(--font-ui);
}
.gate::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 110px; pointer-events: none;
    background: linear-gradient(to bottom, rgba(251, 248, 241, 0), var(--paper));
}
.gate-title {
    margin: 0 0 8px !important; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: 28px; line-height: 1.08; letter-spacing: var(--display-tracking); color: var(--paper);
}
.gate-text { margin: 0 0 18px; font-size: 16px; line-height: 1.5; color: var(--on-blue-soft); max-width: 44ch; }
.gate-signin { margin: 14px 0 0; font-size: 14px; }
.gate-signin a { color: var(--paper) !important; font-weight: 600; }

/* After the story ---------------------------------------------------- */
.author-card { display: flex; gap: 14px; align-items: flex-start; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); }
.author-name { margin: 0; font-size: 16px; font-weight: 600; }
.author-bio { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--soft); }
.share { display: flex; gap: 8px; flex-wrap: wrap; }
.post-share-mobile { margin-top: 20px; }
.comments { margin-top: 40px; }
.read-next { margin-top: 40px; }
.section-title {
    margin: 0 0 14px; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: 24px; letter-spacing: var(--display-tracking);
}
.read-next-list { display: grid; gap: 10px; }
.read-next-list > .card:nth-child(n+3) { display: none; }

/* Mobile action bar -------------------------------------------------- */
.action-bar {
    position: sticky; bottom: 0; z-index: 15;
    display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 40px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -1px 0 rgba(18, 22, 42, 0.08);
}
.action { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.action-time { font-size: 13px; letter-spacing: 0.01em; color: var(--muted); }

/* Lists: tag, author, archive ---------------------------------------- */
.list-hero { background: var(--blue); color: var(--paper); }
.list-hero.tag-history { background: var(--zobo); }
.list-hero.tag-people { background: var(--danfo); color: var(--ink); }
.list-hero.tag-ideas { background: var(--ink); }
.list-hero-plain { background: transparent; color: var(--ink); }
.list-hero-inner { max-width: var(--max); margin: 0 auto; padding: 36px var(--gutter) 34px; }
.list-hero-author { display: flex; gap: 20px; align-items: center; }
.list-title {
    margin: 0; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: clamp(36px, 9vw, 72px); line-height: 1; letter-spacing: var(--display-tracking);
}
.list-desc { margin: 12px 0 0; max-width: 56ch; font-family: var(--font-text); font-size: 18px; line-height: 1.5; }
.list-count { margin: 12px 0 0; font-size: 13px; opacity: 0.85; }
.list-grid { max-width: var(--max); margin: 24px auto 0; padding: 0 12px; display: grid; gap: 8px; }
.list-grid > .card { border: 1px solid var(--rule); }

.pagination {
    max-width: var(--max); margin: 28px auto 0; padding: 0 var(--gutter);
    display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; color: var(--muted);
}
.pagination a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); font-weight: 600; }

.page-main { max-width: 720px; margin: 0 auto; padding: 32px 20px 0; }
.page-title {
    margin: 0; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: clamp(36px, 8vw, 64px); line-height: 1.02; letter-spacing: var(--display-tracking);
}
.page-excerpt { margin: 14px 0 0; font-family: var(--font-text); font-size: 20px; line-height: 1.45; color: var(--soft); }
.page-main .post-image { margin: 24px 0 0; }

.error-page { max-width: 720px; margin: 0 auto; padding: 72px 20px 24px; }
.error-code { margin: 0; font-weight: 600; color: var(--zobo); }
.error-title {
    margin: 8px 0 0; font-family: var(--font-display); font-weight: var(--display-weight);
    font-size: clamp(36px, 8vw, 64px); line-height: 1.02; letter-spacing: var(--display-tracking);
}
.error-text { margin: 14px 0 24px; font-size: 18px; color: var(--soft); }

/* Footer ------------------------------------------------------------ */
.site-footer {
    margin-top: 56px; background: var(--blue); color: var(--paper);
    border-radius: var(--radius-l) var(--radius-l) 0 0; padding: 32px 18px env(safe-area-inset-bottom, 0px); overflow: hidden;
}
.post-template .site-footer { margin-top: 0; }
.footer-top, .footer-meta { max-width: var(--max); margin: 0 auto; }
.footer-heading {
    margin: 0 0 18px; max-width: 16ch; font-family: var(--font-display); font-weight: 700;
    font-size: 26px; line-height: 1.08; letter-spacing: var(--display-tracking); text-wrap: balance;
}
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; margin-top: 36px; }
.footer-label { margin: 0 0 4px; font-size: 13px; letter-spacing: 0.01em; color: var(--on-blue-mute); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col a, .footer-col .nav-link { display: inline-block; padding: 12px 0; font-size: 15px; min-height: 0; font-weight: 400; }
.footer-col .nav { display: block; }
.footer-meta {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    margin-top: 28px; padding-top: 4px; border-top: 1px solid rgba(251, 248, 241, 0.28);
    font-size: 13px; color: var(--on-blue-mute);
}
.footer-top-link { padding: 12px 0; color: var(--paper); font-weight: 500; }
.footer-wordmark { max-width: var(--max); margin: 14px auto 0; }
.footer-wordmark svg { display: block; width: 100%; height: auto; }

/* Hover only with a real pointer ------------------------------------- */
@media (hover: hover) and (pointer: fine) {
    .card:hover { background: #F7F5EF; }
    .tab:hover { filter: brightness(0.96); }
    .flink:hover, .hl:hover, .nav-link:hover, .link-quiet:hover { text-decoration: underline; }
    .btn-primary:hover { background: #17368F; }
    .btn-danfo:hover { background: #F5B800; }
    .pill:hover { background: rgba(18, 22, 42, 0.05); }
    .gh-content a:hover { text-decoration-thickness: 2.5px; }
}

/* Larger screens ---------------------------------------------------- */
@media (min-width: 600px) {
    .site-bar-actions .link-quiet { display: inline-flex; }
}

@media (min-width: 900px) {
    .home { padding: 0 var(--gutter); }
    .home-bar { padding-left: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); padding-right: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter))); font-size: 14px; }
    .masthead { padding-top: 28px; }
    .masthead-logo a { width: 520px; }
    .masthead-tagline { max-width: none; margin: 22px auto 26px; font-size: 24px; }
    .masthead-rule { padding: 14px 0; font-size: 15px; }

    .lead { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: end; padding-top: 44px; }
    .lead-media { aspect-ratio: 4 / 3; }
    .lead-text { padding: 0; }
    .lead-excerpt { font-size: 21px; }

    .signup { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; margin-top: 56px; padding: 30px 32px; }
    .signup-title { flex: 1 1 320px; margin: 0; font-size: 34px; }
    .signup .subscribe-form { flex: 1 1 420px; }
    .search-field { margin-top: 44px; height: 50px; }

    .folders { margin-top: 26px; }
    .tabs { gap: 6px; padding: 0 20px; overflow: visible; -webkit-mask-image: none; mask-image: none; }
    .tab { min-height: 48px; padding: 0 20px; font-size: 15px; }
    .panel { border-radius: var(--radius-l); padding: 20px 12px 16px; }
    .panel-list, .list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .panel-more { width: max-content; margin: 18px auto 0; padding: 0 26px; min-height: 48px; font-size: 15px; }

    .card, .panel-list > .card:first-child { grid-template-columns: 1fr; gap: 0; align-content: start; }
    .card .card-media, .panel-list > .card:first-child .card-media { aspect-ratio: 16 / 9; }
    .card-body, .panel-list > .card:first-child .card-body { padding: 14px 8px 8px; }
    .card-title, .panel-list > .card:first-child .card-title { font-size: 23px; font-weight: var(--display-weight); line-height: 1.1; margin-top: 6px; }
    .card-excerpt, .panel-list > .card:first-child .card-excerpt { display: block; margin-top: 8px; font-family: var(--font-text); font-size: 16px; line-height: 1.4; color: var(--soft); }
    .card-meta { margin-top: 10px; font-size: 13px; }

    .site-bar-inner { padding: 8px var(--gutter); }
    .site-bar-logo { width: 130px; }
    .site-bar-nav { display: block; font-size: 15px; }
    .site-bar-nav .nav { gap: 0 28px; }

    .post-hero-inner { display: grid; grid-template-columns: 8fr 4fr; gap: 48px; align-items: end; padding: 64px var(--gutter) 64px; }
    .post-hero.has-image .post-hero-inner { padding-bottom: 112px; }
    .post-title { max-width: 13ch; margin-top: 20px; }
    .post-excerpt { margin: 0; font-size: 22px; }
    .post-image { max-width: var(--max); margin: -72px auto 0; padding: 0 var(--gutter); position: relative; }
    .post-image img { border-radius: var(--radius-l); }

    .post-layout {
        max-width: var(--max); margin: 48px auto 0; padding: 0 var(--gutter);
        display: grid; grid-template-columns: 220px minmax(0, 680px); gap: 56px; align-items: start;
    }
    .post-rail { display: flex; flex-direction: column; gap: 28px; position: sticky; top: 100px; }
    .toc { margin-top: 0; }
    .toc-list a { padding: 7px 0; }
    .toc-mobile { display: none; }
    .gh-content { margin-top: 0; font-size: 20px; }
    .gh-content h2 { margin-top: 48px; font-size: 32px; }
    .gh-content .short-version { padding: 24px 28px 26px; }
    .short-version-title { font-size: 26px; }
    .gh-content .kg-width-wide { margin-left: -60px; margin-right: -60px; }
    .gh-content .kg-width-full { width: 100vw; max-width: none; margin-left: calc(50% - 50vw - 138px); margin-right: 0; }
    .gate { padding: 36px 40px 34px; }
    .gate-title { font-size: 34px; }
    .post-share-mobile { display: none; }
    .read-next-list { grid-template-columns: 1fr 1fr; }
    .read-next-list .card { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; align-items: center; }
    .read-next-list .card .card-media { aspect-ratio: 4 / 3; }
    .read-next-list .card .card-body { padding: 0; }
    .read-next-list .card .card-title { font-size: 20px; }
    .read-next-list .card .card-excerpt { display: none; }
    .action-bar { display: none; }

    .list-hero-inner { padding: 64px var(--gutter) 56px; }
    .list-grid { padding: 0 var(--gutter); }
    .page-main { padding-top: 56px; }

    .site-footer { margin-top: 96px; border-radius: 28px 28px 0 0; padding: 64px 40px 0; }
    .post-template .site-footer { margin-top: 96px; }
    .footer-top { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; }
    .footer-heading { font-size: 34px; }
    .footer-cols { grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 0; }
    .footer-label { margin-bottom: 10px; }
    .footer-col a, .footer-col .nav-link { padding: 8px 0; font-size: 16px; }
    .footer-meta { margin-top: 56px; }
    .footer-wordmark { margin-top: 20px; }
}

/* Comfort settings --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .press:active, .card:active { transform: none; }
    .panel { transition: none; }
    html { scroll-behavior: auto; }
}
@media (prefers-reduced-transparency: reduce) {
    .bar { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
    .bar { background: var(--paper); }
    .card { border: 1px solid var(--ink); }
}
