/* ==========================================================================
   Marine — Ghost theme
   1.  Tokens & design styles     8.  Home sections (ticker, topics, picks…)
   2.  Base                       9.  Subscribe block
   3.  Layout                     10. Article & content
   4.  Announcement, topbar       11. Article extras & pagination
   5.  Header & navigation        12. Archive, tiles, error
   6.  Buttons, chips, forms      13. Footer
   7.  Cards, hero zones          14. Utilities, motion, print
   15. Extra design styles (Glass, Minimal, Neon, Pastel, Newspaper)
   16. Archive layouts, post sidebar and widgets
   ========================================================================== */

/* 1. Tokens & design styles ------------------------------------------------ */
:root {
    --accent: #0e8a96;
    --accent-2: #ff7a59;
    --accent-ink: color-mix(in srgb, var(--accent) 78%, #000);
    --on-accent: #fff;

    --bg: #f6f8f8;
    --surface: #fff;
    --surface-2: #edf2f3;
    --text: #0d1b24;
    --muted: #55656f;
    --line: #dde5e8;
    --overlay: rgb(5 16 24 / .66);
    --shadow: 0 1px 2px rgb(13 27 36 / .05), 0 10px 28px -10px rgb(13 27 36 / .14);
    --shadow-lg: 0 2px 4px rgb(13 27 36 / .06), 0 28px 50px -18px rgb(13 27 36 / .28);

    /* design-style variables (overridden below) */
    --radius: 20px;
    --radius-sm: 12px;
    --pill: 999px;
    --card-bg: var(--surface);
    --card-border: 1px solid var(--line);
    --card-shadow: none;
    --card-hover-shadow: var(--shadow-lg);
    --card-hover-move: translateY(-4px);
    --card-pad: 22px;

    --header-h: 72px;
    --gutter: clamp(16px, 4vw, 32px);
    --container: 1240px;
    --container-wide: 1120px;
    --container-narrow: 760px;
    --measure: 700px;
    --card-ratio: 16 / 10;
    --cols: 3;

    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --font-heading: var(--font-serif);

    color-scheme: light;
}

/* Light-mode colour tokens of the Pastel and Newspaper styles. They sit before the dark blocks on purpose,
   so that dark mode still wins when it is active. */
:root[data-style="pastel"] {
    --bg: color-mix(in srgb, var(--accent) 5%, #fffaf4);
    --surface: #fff;
    --surface-2: color-mix(in srgb, var(--accent-2) 9%, #fff8f0);
    --line: color-mix(in srgb, var(--accent) 14%, #f1e6db);
    --muted: #6a6470;
}
:root[data-style="newspaper"] {
    --bg: #f3efe6;
    --surface: #faf7f0;
    --surface-2: #e9e3d6;
    --line: #cdc4b1;
    --text: #1a1a1a;
    --muted: #5d574c;
}

:root[data-theme="dark"] {
    --accent-ink: color-mix(in srgb, var(--accent) 62%, #fff);
    --bg: #071118;
    --surface: #0e1b25;
    --surface-2: #14242f;
    --text: #e7eff3;
    --muted: #93a5b0;
    --line: #1f313d;
    --overlay: rgb(2 8 12 / .72);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -10px rgb(0 0 0 / .55);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .35), 0 28px 50px -18px rgb(0 0 0 / .7);
    color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
    :root[data-color-scheme="auto"]:not([data-theme]) {
        --accent-ink: color-mix(in srgb, var(--accent) 62%, #fff);
        --bg: #071118;
        --surface: #0e1b25;
        --surface-2: #14242f;
        --text: #e7eff3;
        --muted: #93a5b0;
        --line: #1f313d;
        --overlay: rgb(2 8 12 / .72);
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -10px rgb(0 0 0 / .55);
        --shadow-lg: 0 2px 4px rgb(0 0 0 / .35), 0 28px 50px -18px rgb(0 0 0 / .7);
        color-scheme: dark;
    }
}

/* Design style: Editorial — sharp, classic, magazine-like */
:root[data-style="editorial"] {
    --radius: 3px;
    --radius-sm: 2px;
    --pill: 2px;
    --card-bg: transparent;
    --card-border: 0;
    --card-shadow: none;
    --card-hover-shadow: none;
    --card-hover-move: none;
    --card-pad: 18px 0 0;
}

/* Design style: Bold — thick outlines and hard shadows */
:root[data-style="bold"] {
    --radius: 14px;
    --radius-sm: 8px;
    --pill: 10px;
    --card-border: 2px solid var(--text);
    --card-shadow: 5px 5px 0 var(--text);
    --card-hover-shadow: 8px 8px 0 var(--accent);
    --card-hover-move: translate(-3px, -3px);
    --line: color-mix(in srgb, var(--text) 18%, transparent);
}

:root[data-ratio="square"] { --card-ratio: 1 / 1; }
:root[data-ratio="portrait"] { --card-ratio: 4 / 5; }
:root[data-cols="2"] { --cols: 2; }
:root[data-cols="4"] { --cols: 4; }

body.font-sans { --font-heading: var(--font-body); }
body.font-humanist { --font-heading: Seravek, "Gill Sans Nova", "Gill Sans", Ubuntu, Calibri, "DejaVu Sans", sans-serif; }
body.font-geometric { --font-heading: Avenir, "Avenir Next", Montserrat, Corbel, "URW Gothic", "Source Sans Pro", sans-serif; }
body.font-mono { --font-heading: var(--font-mono); }

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--gh-font-body, var(--font-body));
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
    overflow-x: clip;
}

:root[data-style="modern"] body {
    background-image:
        radial-gradient(900px 420px at 88% -120px, color-mix(in srgb, var(--accent) 13%, transparent), transparent),
        radial-gradient(700px 320px at 0 0, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent);
    background-repeat: no-repeat;
}

img, svg, video, iframe { max-width: 100%; }
img { display: block; height: auto; }
svg { flex: none; display: block; }

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--gh-font-heading, var(--font-heading));
    line-height: 1.18;
    letter-spacing: -.015em;
    text-wrap: balance;
}

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* 3. Layout ---------------------------------------------------------------- */
.site { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.site-main { flex: 1 0 auto; }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { width: 100%; max-width: calc(var(--container-wide) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { width: 100%; max-width: calc(var(--container-narrow) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

.section { padding-block: clamp(36px, 6vw, 80px); }
.section-tight { padding-block: clamp(24px, 4vw, 48px); }

.kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--accent-ink); }
.kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.kicker-light { color: rgb(255 255 255 / .8); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: clamp(20px, 3vw, 32px); }
.section-title { position: relative; padding-bottom: 14px; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem); }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 56px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.section-link { display: inline-flex; align-items: center; gap: 6px; padding-bottom: 14px; font-size: .9rem; font-weight: 600; color: var(--accent-ink); white-space: nowrap; }
.section-link svg { width: 18px; height: 18px; transition: transform .2s; }
.section-link:hover svg { transform: translateX(4px); }

:root[data-style="editorial"] .section-head { padding-top: 14px; border-top: 3px solid var(--text); }
:root[data-style="editorial"] .section-title::after { display: none; }
:root[data-style="editorial"] .section-title { padding-bottom: 0; }
:root[data-style="editorial"] .section-link { padding-bottom: 0; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-weight: 600; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* 4. Announcement & top bar ------------------------------------------------ */
.announcement { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); color: #fff; font-size: .9rem; }
.announcement-inner { position: relative; display: flex; align-items: center; justify-content: center; min-height: 42px; padding-block: 6px; padding-right: 48px; text-align: center; }
.announcement-text a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.announcement-text svg { width: 16px; height: 16px; }
.announcement-close { position: absolute; right: var(--gutter); top: 50%; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; transform: translateY(-50%); }
.announcement-close:hover { background: rgb(255 255 255 / .2); }
.announcement-close svg { width: 16px; height: 16px; }
.announcement.is-dismissed { display: none; }

.topbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); font-size: .82rem; color: var(--muted); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 38px; }
.topbar-date { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.topbar-date svg { width: 16px; height: 16px; }
.topbar-date time::first-letter { text-transform: uppercase; }
.topbar-latest { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.topbar-latest a { color: var(--text); font-weight: 500; }
.topbar-latest a:hover { color: var(--accent-ink); }
.topbar-label { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: var(--pill); background: var(--accent-2); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topbar-social { display: flex; align-items: center; gap: 2px; }
.topbar-social a { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; }
.topbar-social a:hover { background: var(--surface-2); color: var(--text); }
.topbar-social svg { width: 16px; height: 16px; }
@media (max-width: 759px) { .topbar-date, .topbar-social { display: none; } .topbar-latest { text-align: left; } }

/* 5. Header & navigation --------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: saturate(1.5) blur(16px); backdrop-filter: saturate(1.5) blur(16px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.is-stuck { border-bottom-color: var(--line); box-shadow: 0 8px 24px -16px rgb(0 0 0 / .25); }
:root[data-style="editorial"] .site-header { background: var(--bg); border-bottom-color: var(--text); }
:root[data-style="bold"] .site-header { background: var(--bg); border-bottom: 2px solid var(--text); }

.header-inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.header-start { display: flex; align-items: center; gap: 8px; }
.header-end { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.logo { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--gh-font-heading, var(--font-heading)); font-weight: 700; font-size: 1.5rem; letter-spacing: -.03em; }
.logo img { height: 36px; width: auto; max-width: 200px; object-fit: contain; }

.site-nav { display: flex; align-items: center; margin-left: 20px; }
.nav-list { display: flex; flex-wrap: wrap; gap: 2px; }
.nav-item a { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--pill); font-size: .95rem; font-weight: 500; color: var(--muted); transition: color .15s, background-color .15s; }
.nav-item a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: 0 50%; transition: transform .25s; }
.nav-item a:hover { color: var(--text); }
.nav-item a:hover::after, .nav-item.nav-current a::after { transform: scaleX(1); }
.nav-item.nav-current a { color: var(--text); font-weight: 600; }

.icon-btn.menu-toggle { display: none; }
.menu-toggle .icon-close { display: none; }
.is-open .menu-toggle .icon-open { display: none; }
.is-open .menu-toggle .icon-close { display: grid; }
.menu-account { display: none; }

/* layout: logo in the middle */
.site-header[data-nav="center"] .header-inner { display: grid; grid-template-columns: 1fr auto 1fr; }
.site-header[data-nav="center"] .site-nav { order: 1; margin-left: 0; }
.site-header[data-nav="center"] .header-start { order: 2; justify-content: center; }
.site-header[data-nav="center"] .header-end { order: 3; justify-self: end; }

/* layout: stacked masthead (logo on top, menu below). Only the menu row sticks. */
.site-header[data-nav="stacked"] { top: calc(var(--header-h) * -1); }
.site-header[data-nav="stacked"] .header-inner { display: grid; grid-template-columns: 1fr auto 1fr; grid-template-areas: ". logo end" "nav nav nav"; }
.site-header[data-nav="stacked"] .header-start { grid-area: logo; justify-content: center; min-height: var(--header-h); }
.site-header[data-nav="stacked"] .logo { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); }
.site-header[data-nav="stacked"] .header-end { grid-area: end; justify-self: end; }
.site-header[data-nav="stacked"] .site-nav { grid-area: nav; justify-content: center; margin: 0; border-top: 1px solid var(--line); min-height: 52px; }

/* search: pill on wide screens, icon on narrow ones */
.search-pill { display: none; align-items: center; gap: 8px; min-height: 40px; width: 170px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); color: var(--muted); font-size: .9rem; transition: border-color .15s, box-shadow .15s; }
.search-pill svg { width: 18px; height: 18px; }
.search-pill:hover { border-color: var(--accent); color: var(--text); }
@media (min-width: 1120px) { .search-pill { display: inline-flex; } .icon-btn.search-icon { display: none; } }

/* colour-mode button — icons are centred, no baseline offset */
.theme-toggle .icon-sun, .theme-toggle .icon-moon { display: grid; place-items: center; line-height: 0; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: grid; }
@media (prefers-color-scheme: dark) {
    :root[data-color-scheme="auto"]:not([data-theme]) .theme-toggle .icon-sun { display: none; }
    :root[data-color-scheme="auto"]:not([data-theme]) .theme-toggle .icon-moon { display: grid; }
}

/* mobile navigation */
@media (max-width: 959px) {
    .icon-btn.menu-toggle { display: inline-grid; }
    .site-header[data-nav] .header-inner { display: flex; }
    .site-header[data-nav] .header-start { order: 0; justify-content: flex-start; min-height: 0; }
    .site-header[data-nav] .header-end { order: 0; justify-self: auto; }
    .site-header[data-nav="stacked"] { top: 0; }
    .site-header[data-nav="stacked"] .logo { font-size: 1.5rem; }
    .btn.btn-signin, .btn.btn-subscribe { display: none; }

    .js .site-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; margin: 0 !important; padding: 8px var(--gutter) 20px; background: var(--bg); border: 0 !important; border-bottom: 1px solid var(--line) !important; box-shadow: var(--shadow-lg); max-height: calc(100dvh - var(--header-h)); overflow-y: auto; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s; }
    .js .site-header.is-open .site-nav { opacity: 1; visibility: visible; transform: none; }
    .site-nav .nav-list { flex-direction: column; gap: 0; width: 100%; }
    .site-nav .nav-item a { width: 100%; min-height: 54px; padding: 0 4px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
    .site-nav .nav-item a::after { display: none; }
    .site-nav .nav-item.nav-current a { color: var(--accent-ink); }
    .menu-account { display: flex; gap: 8px; margin-top: 16px; }
    .menu-account .btn { flex: 1; }
}

/* 6. Buttons, chips, forms ------------------------------------------------- */
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text); line-height: 0; transition: background-color .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); }
:root[data-style="editorial"] .icon-btn { border-radius: var(--pill); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border: 1px solid transparent; border-radius: var(--pill); font-size: .95rem; font-weight: 600; line-height: 1; white-space: nowrap; transition: transform .15s, background-color .15s, border-color .15s, box-shadow .15s; }
.btn svg { width: 18px; height: 18px; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); transform: translateY(-1px); box-shadow: 0 10px 22px -10px var(--accent); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { border-color: var(--line); background: transparent; color: var(--text); }
.btn-outline:hover { border-color: var(--text); }
:root[data-style="bold"] .btn { border: 2px solid var(--text); box-shadow: 3px 3px 0 var(--text); }
:root[data-style="bold"] .btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--text); }
:root[data-style="bold"] .btn-ghost { box-shadow: none; border-color: transparent; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--pill); background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-ink); font-family: var(--font-body); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: background-color .15s, color .15s; }
a.chip:hover { background: var(--accent); color: var(--on-accent); }
.chip-glass { background: rgb(255 255 255 / .18); border: 1px solid rgb(255 255 255 / .28); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
a.chip-glass:hover { background: var(--accent); border-color: transparent; }
:root[data-style="bold"] .chip { border: 2px solid var(--text); background: var(--surface); color: var(--text); }
:root[data-style="bold"] .chip-glass { background: var(--accent-2); border-color: var(--text); color: #fff; backdrop-filter: none; }
:root[data-style="bold"] a.chip:hover { background: var(--text); color: var(--bg); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.badge svg { width: 14px; height: 14px; }
.badge-lock { padding: 3px 9px; border-radius: var(--pill); background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: color-mix(in srgb, var(--accent-2) 70%, var(--text)); }

.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.avatar-fallback { display: inline-grid; place-items: center; color: var(--muted); }
.avatar-fallback svg { width: 55%; height: 55%; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 112px; height: 112px; }

.input { width: 100%; min-height: 52px; padding: 0 20px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
:root[data-style="bold"] .input { border: 2px solid var(--text); }

/* 7. Cards & hero zones ---------------------------------------------------- */
.grid { display: grid; gap: clamp(20px, 3vw, 32px); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(var(--cols), 1fr); } }

.card, .tile-card, .row-card, .hero-card, .topic-tile { position: relative; }

.card { display: flex; flex-direction: column; overflow: hidden; background: var(--card-bg); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--card-shadow); transition: transform .25s, box-shadow .25s, border-color .25s; }
.card-media-wrap { position: relative; }
.card-media { position: relative; display: block; aspect-ratio: var(--card-ratio); overflow: hidden; background: var(--surface-2); border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; }
:root[data-style="editorial"] .card-media { border-radius: var(--radius); }
:root[data-style="bold"] .card-media { border-bottom: var(--card-border); border-radius: calc(var(--radius) - 4px) calc(var(--radius) - 4px) 0 0; }
.card-media img, .row-media img, .hero-media img, .tile-card-media img, .topic-media img { width: 100%; height: 100%; object-fit: cover; }
.card-top-overlay { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 2; pointer-events: none; }
.card-top-overlay > * { pointer-events: auto; }
.card-top-overlay .badge { padding: 3px 10px; border-radius: var(--pill); background: rgb(0 0 0 / .45); color: #fff; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 10px; padding: var(--card-pad); }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.card-title { font-size: 1.28rem; line-height: 1.25; }
.card-excerpt { color: var(--muted); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .post-meta { margin-top: auto; padding-top: 6px; position: relative; z-index: 2; }

.card-title a, .row-title a, .hero-title a, .tile-card-title a, .pick-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .3s; }
.card-title a::after, .row-title a::after, .hero-title a::after, .tile-card-title a::after, .pick-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.chip, .badge { position: relative; z-index: 2; }

.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: .82rem; color: var(--muted); }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.meta-author { font-weight: 600; color: var(--text); }

.media-placeholder { display: block; width: 100%; height: 100%; min-height: 100%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40' viewBox='0 0 120 40'%3E%3Cpath d='M0 20c10 0 10-8 20-8s10 8 20 8 10-8 20-8 10 8 20 8 10-8 20-8 10 8 20 8' fill='none' stroke='%23fff' stroke-opacity='.18' stroke-width='2'/%3E%3C/svg%3E"), linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #000), color-mix(in srgb, var(--accent-2) 55%, #0a2b3a)); }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
    .card:hover { transform: var(--card-hover-move); box-shadow: var(--card-hover-shadow); border-color: transparent; }
    :root[data-style="bold"] .card:hover { border-color: var(--text); }
    .card-media img, .row-media img, .hero-media img, .tile-card-media img, .topic-media img { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
    .card:hover .card-media img, .row-card:hover .row-media img, .hero-card:hover .hero-media img, .tile-card:hover .tile-card-media img, .topic-tile:hover .topic-media img { transform: scale(1.06); }
    .card:hover .card-title a, .row-card:hover .row-title a, .hero-card:hover .hero-title a, .tile-card:hover .tile-card-title a, .pick:hover .pick-title a { background-size: 100% 2px; }
}

.row-card { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row-card:last-child { border-bottom: 0; }
.row-media { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row-title { font-size: 1.05rem; line-height: 1.3; }

/* large hero card */
.home-hero { position: relative; padding-top: clamp(20px, 3.5vw, 40px); }
.hero-grid { display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: 1fr; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.hero-card { display: flex; align-items: flex-end; min-height: clamp(400px, 56vw, 600px); overflow: hidden; border-radius: calc(var(--radius) + 6px); border: var(--card-border); box-shadow: var(--card-shadow); color: #fff; background: var(--surface-2); isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-card::after, .tile-card::after, .topic-tile::after, .archive-head.has-cover::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--overlay) 6%, rgb(0 0 0 / .06) 72%); pointer-events: none; }
.hero-body { display: flex; flex-direction: column; gap: 14px; width: 100%; padding: clamp(20px, 4vw, 44px); }
.hero-title { font-size: clamp(1.8rem, 1.1rem + 2.8vw, 3.2rem); line-height: 1.08; max-width: 22ch; }
.hero-excerpt { max-width: 56ch; color: rgb(255 255 255 / .86); font-size: 1.05rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-author { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.hero-author .avatar { border: 2px solid rgb(255 255 255 / .6); }
.hero-author .author-name { font-weight: 600; font-size: .92rem; }
.hero-card .post-meta, .tile-card .post-meta { color: rgb(255 255 255 / .8); }
.hero-card .badge, .tile-card .badge { color: rgb(255 255 255 / .9); }
.hero-side { display: flex; flex-direction: column; justify-content: space-between; }

/* overlay tile (used by spotlight, duo, picks) */
.tile-card { display: flex; align-items: flex-end; min-height: 280px; height: 100%; overflow: hidden; border-radius: var(--radius); border: var(--card-border); box-shadow: var(--card-shadow); color: #fff; background: var(--surface-2); isolation: isolate; transition: transform .25s, box-shadow .25s; }
.tile-card:hover { transform: var(--card-hover-move); box-shadow: var(--card-hover-shadow); }
.tile-card-media { position: absolute; inset: 0; z-index: -2; }
.tile-card-body { display: flex; flex-direction: column; gap: 10px; width: 100%; padding: clamp(16px, 2.6vw, 28px); }
.tile-card-title { font-size: clamp(1.2rem, 1rem + .8vw, 1.6rem); line-height: 1.2; }
.tile-lg { min-height: clamp(340px, 46vw, 520px); }
.tile-lg .tile-card-title { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.6rem); line-height: 1.1; max-width: 24ch; }

.spot-grid { display: grid; gap: clamp(16px, 2.4vw, 28px); grid-template-columns: 1fr; }
@media (min-width: 860px) { .spot-grid { grid-template-columns: 1.7fr 1fr; grid-template-rows: repeat(2, minmax(240px, 1fr)); } .spot-main { grid-row: span 2; } }
.spot-main, .spot-side { display: flex; min-width: 0; }
.spot-main .tile-card, .spot-side .tile-card { flex: 1; }
.spot-row { margin-top: clamp(24px, 3.5vw, 40px); }
@media (min-width: 1000px) { .grid.spot-row { grid-template-columns: repeat(3, 1fr); } }

.duo-grid { display: grid; gap: clamp(16px, 2.4vw, 28px); grid-template-columns: 1fr; }
@media (min-width: 760px) { .duo-grid { grid-template-columns: 1fr 1fr; } }
.duo-list { display: grid; column-gap: clamp(20px, 4vw, 56px); grid-template-columns: 1fr; margin-top: 12px; }
@media (min-width: 760px) { .duo-list { grid-template-columns: 1fr 1fr; } }

/* 8. Home sections --------------------------------------------------------- */
.ticker { border-block: 1px solid var(--line); background: var(--surface); }
.ticker-inner { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.ticker-label { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 5px 14px; border-radius: var(--pill); background: var(--text); color: var(--bg); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.ticker-label svg { width: 15px; height: 15px; color: var(--accent-2); }
.ticker-viewport { flex: 1; min-width: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.ticker-track { display: flex; width: max-content; animation: ticker 70s linear infinite; }
.ticker-viewport:hover .ticker-track, .ticker-viewport:focus-within .ticker-track { animation-play-state: paused; }
.ticker-track li { position: relative; padding-right: 48px; white-space: nowrap; font-size: .92rem; font-weight: 500; }
.ticker-track li::after { content: ""; position: absolute; right: 20px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); transform: translateY(-50%); }
.ticker-track a:hover { color: var(--accent-ink); }
@keyframes ticker { to { transform: translateX(-50%); } }

.topic-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 14px; margin-inline: calc(var(--gutter) * -1); padding: 4px var(--gutter) 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.topic-tiles::-webkit-scrollbar { display: none; }
.topic-tiles > li { scroll-snap-align: start; }
@media (min-width: 640px) { .topic-tiles { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(3, 1fr); margin-inline: 0; padding: 0; overflow: visible; } }
@media (min-width: 1100px) { .topic-tiles { grid-template-columns: repeat(6, 1fr); } }
.topic-tile { display: flex; align-items: flex-end; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); border: var(--card-border); box-shadow: var(--card-shadow); color: #fff; isolation: isolate; transition: transform .25s, box-shadow .25s; }
.topic-tile:hover { transform: var(--card-hover-move); box-shadow: var(--card-hover-shadow); }
.topic-media { position: absolute; inset: 0; z-index: -2; background: var(--surface-2); }
.topic-body { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 16px; }
.topic-name { font-family: var(--gh-font-heading, var(--font-heading)); font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.topic-count { font-size: .78rem; color: rgb(255 255 255 / .8); }

.picks { display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: 1fr; }
@media (min-width: 960px) { .picks { grid-template-columns: 1.25fr 1fr; align-items: stretch; } }
.picks-main { display: flex; min-width: 0; }
.picks-main .tile-card { flex: 1; }
.picks-list { display: flex; flex-direction: column; justify-content: space-between; }
.pick { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.pick:first-child { padding-top: 0; }
.pick:last-child { border-bottom: 0; padding-bottom: 0; }
.pick-num { font-family: var(--gh-font-heading, var(--font-heading)); font-size: 3rem; font-weight: 700; line-height: .9; color: transparent; -webkit-text-stroke: 1.5px color-mix(in srgb, var(--accent) 70%, transparent); }
.pick-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.pick-title { font-size: 1.25rem; line-height: 1.25; }

.author-cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.author-card { display: flex; align-items: center; gap: 16px; height: 100%; padding: 20px; border: var(--card-border); border-radius: var(--radius); background: var(--card-bg); box-shadow: var(--card-shadow); transition: transform .25s, box-shadow .25s; }
.author-card:hover { transform: var(--card-hover-move); box-shadow: var(--card-hover-shadow); }
.author-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.author-card-name { font-family: var(--gh-font-heading, var(--font-heading)); font-size: 1.2rem; font-weight: 700; }
.author-card-count { font-size: .8rem; font-weight: 600; color: var(--accent-ink); }
.author-card-bio { margin-top: 4px; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; border-block: 1px solid var(--line); }
.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: clamp(20px, 4vw, 40px) 12px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-num { font-family: var(--gh-font-heading, var(--font-heading)); font-size: clamp(2.2rem, 1.2rem + 4vw, 4.2rem); font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-label { margin: 0; font-size: .85rem; color: var(--muted); }

/* 9. Subscribe block ------------------------------------------------------- */
.cta { position: relative; overflow: hidden; border-radius: calc(var(--radius) + 8px); border: var(--card-border); box-shadow: var(--card-shadow); background: linear-gradient(145deg, #050f18, #0a1f2d 55%, #0b2837); color: #fff; isolation: isolate; }
.cta-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cta-orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.cta-orb-1 { right: -8%; top: -30%; width: 46%; aspect-ratio: 1; background: var(--accent); }
.cta-orb-2 { left: -12%; bottom: -55%; width: 40%; aspect-ratio: 1; background: #3b5bff; opacity: .28; }
.cta-bg svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 55%; }
.cta-bg path { fill: rgb(255 255 255 / .05); }
.cta-bg path + path { fill: rgb(255 255 255 / .04); }
.cta-inner { position: relative; display: grid; gap: clamp(24px, 4vw, 48px); padding: clamp(28px, 5vw, 64px); }
@media (min-width: 900px) { .cta-inner { grid-template-columns: 1.15fr 1fr; align-items: center; } }
.cta-title { font-size: clamp(1.8rem, 1.2rem + 2.2vw, 3rem); line-height: 1.1; }
.cta-text { margin-top: 14px; max-width: 46ch; color: rgb(255 255 255 / .8); font-size: 1.05rem; }
.cta-perks { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-size: .9rem; color: rgb(255 255 255 / .85); }
.cta-perks li { display: inline-flex; align-items: center; gap: 6px; }
.cta-perks svg { width: 18px; height: 18px; color: var(--accent-2); }
.cta-form { position: relative; display: flex; flex-direction: column; gap: 12px; padding: clamp(20px, 3vw, 32px); border: 1px solid rgb(255 255 255 / .16); border-radius: var(--radius); background: rgb(255 255 255 / .07); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.cta-form-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.cta-form-label { font-weight: 600; }
.cta-form .input { border-color: rgb(255 255 255 / .2); background: rgb(255 255 255 / .1); color: #fff; }
.cta-form .input::placeholder { color: rgb(255 255 255 / .55); }
.cta-form .btn-primary { background: #fff; color: #0d1b24; }
.cta-form .btn-primary:hover { background: color-mix(in srgb, #fff 88%, var(--accent)); box-shadow: 0 12px 28px -12px rgb(255 255 255 / .5); }
.cta-form .btn-loading, .cta-form.loading .btn-default { display: none; }
.cta-form.loading .btn-loading { display: inline; }
.form-message { display: none; font-size: .92rem; }
.cta-form.success .form-success, .cta-form.error .form-error { display: block; }
.form-error { color: #ffb4a6; }

/* 10. Article & content ---------------------------------------------------- */
.article-header { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: clamp(28px, 6vw, 72px); text-align: center; }
.article-header .card-top { justify-content: center; }
.article-title { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); line-height: 1.08; letter-spacing: -.025em; }
.article-excerpt { max-width: 60ch; font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem); color: var(--muted); line-height: 1.5; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 24px; margin-top: 4px; }
.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.author a { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .95rem; }
.author .avatar { width: 40px; height: 40px; }

.article-media { margin-block: clamp(24px, 4vw, 48px); }
.article-media img { width: 100%; max-height: 640px; object-fit: cover; border-radius: calc(var(--radius) + 6px); }
.article-media figcaption { margin-top: 12px; text-align: center; font-size: .85rem; color: var(--muted); }
.article { padding-bottom: clamp(32px, 5vw, 64px); }
.page .article-media { margin-top: 0; }
.landing .article-body { margin-top: clamp(24px, 4vw, 48px); }

.gh-content { display: grid; grid-template-columns: [full-start] minmax(max(var(--gutter), 0px), 1fr) [wide-start] minmax(0, 210px) [main-start] min(var(--measure), calc(100% - var(--gutter) * 2)) [main-end] minmax(0, 210px) [wide-end] minmax(max(var(--gutter), 0px), 1fr) [full-end]; font-size: clamp(1.06rem, 1rem + .25vw, 1.2rem); line-height: 1.75; }
.gh-content > * { grid-column: main-start / main-end; min-width: 0; margin-block: 0; }
.gh-content > * + * { margin-top: 1.5em; }
.gh-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.gh-content > .kg-width-full { grid-column: full-start / full-end; }
.gh-content > .kg-width-full img, .gh-content > .kg-width-full video { width: 100%; }

.gh-content h2, .gh-content h3, .gh-content h4 { margin-top: 2.2em; scroll-margin-top: calc(var(--header-h) + 16px); }
.gh-content h2 + *, .gh-content h3 + *, .gh-content h4 + * { margin-top: .8em; }
.gh-content h2 { font-size: 1.8em; }
.gh-content h3 { font-size: 1.4em; }
.gh-content h4 { font-size: 1.15em; }
.gh-content a:not([class]) { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gh-content a:not([class]):hover { text-decoration-thickness: 2px; }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content ul { list-style: disc; }
.gh-content ol { list-style: decimal; }
.gh-content li + li { margin-top: .4em; }
.gh-content li::marker { color: var(--accent-ink); }
.gh-content strong { font-weight: 700; }
.gh-content hr { height: 1px; border: 0; background: var(--line); margin-block: 3em; }
.gh-content blockquote:not([class]) { padding: .2em 0 .2em 1.2em; border-left: 4px solid; border-image: linear-gradient(var(--accent), var(--accent-2)) 1; font-family: var(--gh-font-heading, var(--font-heading)); font-size: 1.2em; font-style: italic; color: var(--text); }
.gh-content blockquote.kg-blockquote-alt { text-align: center; border: 0; padding: 0; font-family: var(--gh-font-heading, var(--font-heading)); font-size: 1.5em; font-style: italic; color: var(--muted); }
.gh-content figure { margin-inline: 0; }
.gh-content figcaption { margin-top: 10px; text-align: center; font-size: .85rem; color: var(--muted); line-height: 1.5; }
.gh-content img { border-radius: var(--radius-sm); }
.gh-content .kg-width-full img { border-radius: 0; }
.gh-content code:not(pre code) { padding: .15em .4em; border-radius: 6px; background: var(--surface-2); font-family: var(--font-mono); font-size: .88em; }
.gh-content pre { overflow-x: auto; padding: 20px; border-radius: var(--radius-sm); background: #0b1620; color: #dbe7ee; font-family: var(--font-mono); font-size: .9rem; line-height: 1.6; -webkit-overflow-scrolling: touch; }
.gh-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .95rem; }
.gh-content th, .gh-content td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.gh-content th { background: var(--surface-2); font-weight: 700; }
.gh-content iframe { width: 100%; border: 0; }
.gh-content .kg-embed-card { display: flex; flex-direction: column; align-items: center; }

.kg-image-card img, .kg-gallery-image img { width: 100%; }
.kg-callout-card { border-radius: var(--radius-sm); }
.kg-bookmark-card .kg-bookmark-container { border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.kg-bookmark-title { color: var(--text); }
.kg-bookmark-description, .kg-bookmark-metadata { color: var(--muted); }
.kg-btn, .kg-button-card .kg-btn { border-radius: var(--pill); }
.kg-btn-accent { background-color: var(--accent); color: var(--on-accent); }
.kg-toggle-card { border-radius: var(--radius-sm); }
.kg-product-card .kg-product-card-container { border-radius: var(--radius-sm); }

/* 11. Article extras & pagination ------------------------------------------ */
.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 4px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transform-origin: 0 50%; }

.toc { width: min(var(--container-narrow), calc(100% - var(--gutter) * 2)); margin-inline: auto; margin-bottom: 2em; padding: 16px 20px; border: var(--card-border); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--card-shadow); }
.toc summary { cursor: pointer; font-weight: 700; font-size: .95rem; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.toc[open] summary::after { content: "–"; }
.toc-list { margin-top: 12px; padding-left: 1.2em; list-style: decimal; font-size: .95rem; }
.toc-list li { padding: 3px 0; }
.toc-list li::marker { color: var(--muted); }
.toc-list .toc-sub { margin-left: 1em; list-style: none; }
.toc-list a:hover { color: var(--accent-ink); text-decoration: underline; }

.article-footer { display: flex; flex-direction: column; gap: 28px; margin-top: clamp(32px, 5vw, 56px); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding-block: 16px; border-block: 1px solid var(--line); }
.share-label { margin-right: 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.share .icon-btn { border: 1px solid var(--line); margin-right: 4px; }
.share-copied { margin-left: 8px; font-size: .85rem; color: var(--accent-ink); }

.author-box { display: flex; gap: 20px; align-items: flex-start; padding: 24px; border: var(--card-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); }
.author-photo img, .author-photo .avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.author-title { font-size: 1.3rem; margin-top: 2px; }
.author-bio { margin-top: 8px; color: var(--muted); font-size: .95rem; }
.author-links { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.author-links .icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); }

.post-nav { display: grid; gap: 16px; margin-top: 32px; }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav-link { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: var(--card-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); transition: border-color .2s, transform .2s; }
.post-nav-link:hover { border-color: var(--accent); transform: var(--card-hover-move); }
.post-nav-next { text-align: right; grid-column: 2; }
.post-nav-prev + .post-nav-next { grid-column: auto; }
.post-nav-label { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.post-nav-next .post-nav-label { justify-content: flex-end; }
.post-nav-label svg { width: 16px; height: 16px; }
.post-nav-title { font-family: var(--gh-font-heading, var(--font-heading)); font-size: 1.1rem; line-height: 1.3; }
@media (max-width: 639px) { .post-nav-next { grid-column: auto; } }

.comments { margin-top: 48px; }
.comments:not(:has(*)) { display: none; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: clamp(32px, 5vw, 56px); }
.pagination-link { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border: var(--card-border); border-radius: var(--pill); background: var(--surface); box-shadow: var(--card-shadow); font-weight: 600; font-size: .92rem; transition: border-color .15s, color .15s, transform .15s; }
a.pagination-link:hover { border-color: var(--accent); color: var(--accent-ink); transform: var(--card-hover-move); }
.pagination-link svg { width: 18px; height: 18px; }
.pagination-link.is-disabled { opacity: .4; box-shadow: none; }
.pagination-info { font-size: .85rem; color: var(--muted); }
@media (max-width: 520px) { .pagination-info { display: none; } .pagination { justify-content: center; } }

/* 12. Archive, tiles, error ------------------------------------------------ */
.archive-head { margin-bottom: clamp(24px, 4vw, 48px); }
.archive-head.has-cover { position: relative; display: flex; align-items: flex-end; min-height: 340px; overflow: hidden; border-radius: calc(var(--radius) + 6px); color: #fff; isolation: isolate; }
.archive-cover { position: absolute; inset: 0; z-index: -2; }
.archive-cover img { width: 100%; height: 100%; object-fit: cover; }
.archive-head.has-cover .archive-head-body { padding: clamp(20px, 4vw, 40px); }
.archive-head.has-cover .archive-desc, .archive-head.has-cover .archive-count, .archive-head.has-cover .archive-kicker { color: rgb(255 255 255 / .85); }
.archive-head-body { display: flex; flex-direction: column; gap: 10px; max-width: 70ch; }
.archive-head-body.author-head { flex-direction: row; align-items: center; gap: 24px; max-width: none; }
@media (max-width: 600px) { .archive-head-body.author-head { flex-direction: column; align-items: flex-start; } }
.archive-kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-ink); }
.archive-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); }
.archive-desc { color: var(--muted); font-size: 1.1rem; }
.archive-count { color: var(--muted); font-size: .9rem; }

.tile-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.tile { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 24px; border: var(--card-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); transition: transform .2s, border-color .2s, box-shadow .2s; }
.tile:hover { transform: var(--card-hover-move); border-color: var(--accent); box-shadow: var(--card-hover-shadow); }
.tile-name { font-family: var(--gh-font-heading, var(--font-heading)); font-size: 1.3rem; font-weight: 700; }
.tile-count { font-size: .8rem; font-weight: 600; color: var(--accent-ink); }
.tile-desc { margin-top: 4px; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-author { align-items: flex-start; }

.error-page { text-align: center; }
.error-code { font-family: var(--gh-font-heading, var(--font-heading)); font-size: clamp(5rem, 3rem + 12vw, 10rem); font-weight: 700; line-height: 1; letter-spacing: -.04em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-title { margin-top: 8px; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); }
.error-text { margin: 12px auto 0; max-width: 50ch; color: var(--muted); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.error-latest { margin-top: clamp(48px, 8vw, 96px); text-align: left; }

/* 13. Footer --------------------------------------------------------------- */
.site-footer { --f-bg: #06121a; --f-text: #e7eff3; --f-muted: #93a5b0; --f-line: rgb(255 255 255 / .12); position: relative; margin-top: clamp(72px, 8vw, 104px); background: var(--f-bg); color: var(--f-text); }
:root[data-footer="light"] .site-footer { --f-bg: var(--surface); --f-text: var(--text); --f-muted: var(--muted); --f-line: var(--line); border-top: 1px solid var(--line); }
:root[data-footer="accent"] .site-footer { --f-bg: color-mix(in srgb, var(--accent) 82%, #000); --f-text: #fff; --f-muted: rgb(255 255 255 / .75); --f-line: rgb(255 255 255 / .2); }
.footer-wave { position: absolute; left: 0; right: 0; top: -59px; width: 100%; height: 60px; fill: var(--f-bg); }
:root[data-footer="light"] .footer-wave, :root[data-style="editorial"] .footer-wave { display: none; }
.footer-grid { display: grid; gap: 36px; padding-block: clamp(40px, 6vw, 72px) clamp(28px, 4vw, 40px); }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1060px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1.4fr; } }
.footer-text { margin-top: 14px; max-width: 38ch; color: var(--f-muted); }
.social-links { display: flex; gap: 6px; margin-top: 18px; }
.site-footer .icon-btn { border: 1px solid var(--f-line); color: var(--f-text); }
.site-footer .icon-btn:hover { background: rgb(255 255 255 / .1); }
.footer-title { margin-bottom: 14px; font-family: var(--font-body); font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--f-muted); }
.footer-col .nav-list { flex-direction: column; gap: 0; }
.footer-col .nav-item a { min-height: 34px; padding: 0; border-radius: 0; color: var(--f-text); font-size: .95rem; opacity: .86; }
.footer-col .nav-item a::after { display: none; }
.footer-col .nav-item a:hover, .footer-latest a:hover { color: var(--accent-2); opacity: 1; }
.footer-latest ul { display: flex; flex-direction: column; gap: 14px; }
.footer-latest a { display: block; font-size: .95rem; line-height: 1.35; }
.footer-latest time { display: block; margin-top: 2px; font-size: .78rem; color: var(--f-muted); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 22px; border-top: 1px solid var(--f-line); font-size: .85rem; color: var(--f-muted); }
.footer-bottom a:hover { color: var(--accent-2); text-decoration: underline; }
.site-footer .logo { color: var(--f-text); }

/* 15. Extra design styles -------------------------------------------------- */

/* Glass — translucent, blurred cards over a soft colour mesh */
:root[data-style="glass"] {
    --radius: 26px; --radius-sm: 16px;
    --card-bg: color-mix(in srgb, var(--surface) 58%, transparent);
    --card-border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
    --card-shadow: 0 10px 34px -14px rgb(13 27 36 / .22);
    --card-hover-shadow: 0 22px 48px -16px rgb(13 27 36 / .34);
}
:root[data-style="glass"] body {
    background-image:
        radial-gradient(720px 520px at 8% 0, color-mix(in srgb, var(--accent) 30%, transparent), transparent),
        radial-gradient(820px 620px at 96% 12%, color-mix(in srgb, var(--accent-2) 26%, transparent), transparent),
        radial-gradient(900px 700px at 50% 108%, color-mix(in srgb, #5b6cff 24%, transparent), transparent);
    background-attachment: fixed;
}
:root[data-style="glass"] :is(.card, .author-card, .tile, .toc, .author-box, .post-nav-link, .pagination-link, .search-pill, .topic-tile, .cta-form) { -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); }
:root[data-style="glass"] :is(.ticker, .topbar) { background: color-mix(in srgb, var(--surface) 50%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
:root[data-style="glass"] .site-header { background: color-mix(in srgb, var(--bg) 55%, transparent); }
:root[data-style="glass"] .chip { background: color-mix(in srgb, var(--surface) 60%, transparent); border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }

/* Minimal — no boxes, lots of white space, quiet details */
:root[data-style="minimal"] {
    --radius: 6px; --radius-sm: 4px; --pill: 4px;
    --card-bg: transparent; --card-border: 0; --card-shadow: none; --card-hover-shadow: none; --card-hover-move: none; --card-pad: 16px 0 0;
    --line: color-mix(in srgb, var(--text) 12%, transparent);
}
:root[data-style="minimal"] .card-media { border-radius: var(--radius); }
:root[data-style="minimal"] .site-header { background: var(--bg); border-bottom-color: var(--line); }
:root[data-style="minimal"] .section-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
:root[data-style="minimal"] .section-title { padding-bottom: 0; font-size: clamp(1.3rem, 1.1rem + 1vw, 1.8rem); }
:root[data-style="minimal"] .section-title::after { display: none; }
:root[data-style="minimal"] .section-link { padding-bottom: 0; }
:root[data-style="minimal"] .chip { padding: 0; background: transparent; color: var(--accent-ink); letter-spacing: .1em; }
:root[data-style="minimal"] a.chip:hover { background: transparent; color: var(--text); text-decoration: underline; }
:root[data-style="minimal"] .chip-glass { padding: 4px 10px; background: var(--bg); border: 0; color: var(--text); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-style="minimal"] .card-title { font-size: 1.2rem; font-weight: 600; }
:root[data-style="minimal"] .nav-item a::after { height: 1px; bottom: 8px; background: var(--text); }
:root[data-style="minimal"] .grid { row-gap: clamp(32px, 5vw, 56px); }
:root[data-style="minimal"] .btn-primary { background: var(--text); color: var(--bg); }
:root[data-style="minimal"] .btn-primary:hover { background: var(--accent); color: var(--on-accent); box-shadow: none; transform: none; }

/* Neon — always dark, glowing outlines */
:root[data-style="neon"][data-color-scheme] {
    --accent-ink: color-mix(in srgb, var(--accent) 55%, #fff);
    --bg: #05070f; --surface: #0b1020; --surface-2: #121a33;
    --text: #e9efff; --muted: #8e9bc0; --line: rgb(110 130 255 / .2);
    --overlay: rgb(3 4 12 / .78);
    --radius: 14px; --radius-sm: 10px;
    --card-border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
    --card-shadow: 0 0 26px -10px color-mix(in srgb, var(--accent) 60%, transparent);
    --card-hover-shadow: 0 0 40px -6px var(--accent);
    color-scheme: dark;
}
:root[data-style="neon"] body {
    background-image:
        linear-gradient(rgb(110 130 255 / .06) 1px, transparent 1px),
        linear-gradient(90deg, rgb(110 130 255 / .06) 1px, transparent 1px),
        radial-gradient(900px 480px at 85% -140px, color-mix(in srgb, var(--accent) 24%, transparent), transparent),
        radial-gradient(700px 360px at 0 20%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent);
    background-size: 48px 48px, 48px 48px, auto, auto;
    background-repeat: repeat, repeat, no-repeat, no-repeat;
}
:root[data-style="neon"] .theme-toggle { display: none; }
:root[data-style="neon"] .site-header { background: color-mix(in srgb, var(--bg) 80%, transparent); border-bottom-color: color-mix(in srgb, var(--accent) 30%, transparent); }
:root[data-style="neon"] .btn-primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-2))); color: #fff; box-shadow: 0 0 22px -4px var(--accent); }
:root[data-style="neon"] .chip { border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); background: transparent; color: var(--accent-ink); }
:root[data-style="neon"] a.chip:hover { background: var(--accent); color: #05070f; box-shadow: 0 0 16px var(--accent); }
:root[data-style="neon"] .chip-glass { background: rgb(5 7 15 / .5); color: #fff; border-color: color-mix(in srgb, var(--accent) 70%, transparent); }
:root[data-style="neon"] .section-title::after { box-shadow: 0 0 14px var(--accent); }
:root[data-style="neon"] .hero-title, :root[data-style="neon"] .tile-card-title { text-shadow: 0 2px 24px rgb(0 0 0 / .6); }
:root[data-style="neon"] .pick-num { -webkit-text-stroke-color: var(--accent); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--accent) 70%, transparent)); }
:root[data-style="neon"] .input { background: var(--surface); }
:root[data-style="neon"] .search-pill { background: var(--surface); }

/* Pastel — soft colours, very round shapes, gentle shadows */
:root[data-style="pastel"] {
    --radius: 30px; --radius-sm: 18px;
    --card-border: 0;
    --card-shadow: 0 14px 34px -16px color-mix(in srgb, var(--accent) 45%, transparent);
    --card-hover-shadow: 0 24px 48px -16px color-mix(in srgb, var(--accent-2) 55%, transparent);
    --card-hover-move: translateY(-6px);
}
:root[data-style="pastel"] body {
    background-image:
        radial-gradient(640px 420px at 6% 4%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent),
        radial-gradient(720px 460px at 94% 0, color-mix(in srgb, var(--accent) 18%, transparent), transparent);
    background-repeat: no-repeat;
}
:root[data-style="pastel"] .chip { background: color-mix(in srgb, var(--accent-2) 22%, var(--surface)); color: color-mix(in srgb, var(--accent-2) 55%, var(--text)); }
:root[data-style="pastel"] a.chip:hover { background: var(--accent-2); color: #fff; }
:root[data-style="pastel"] .chip-glass { color: #fff; background: rgb(255 255 255 / .26); }
:root[data-style="pastel"] .section-title::after { width: 76px; height: 8px; border-radius: 8px; }
:root[data-style="pastel"] .site-header { background: color-mix(in srgb, var(--bg) 70%, transparent); }
:root[data-style="pastel"] .card-media { border-radius: calc(var(--radius) - 8px); margin: 8px 8px 0; }
:root[data-style="pastel"] .card-top-overlay { left: 22px; top: 22px; right: 22px; }
:root[data-style="pastel"] .btn-primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--accent-2))); }

/* Newspaper — classic broadsheet: serif text, double rules, sharp corners */
:root[data-style="newspaper"] {
    --radius: 0; --radius-sm: 0; --pill: 0;
    --card-bg: transparent; --card-border: 0; --card-shadow: none; --card-hover-shadow: none; --card-hover-move: none; --card-pad: 14px 0 0;
}
:root[data-style="newspaper"] body { font-family: var(--gh-font-body, var(--font-serif)); }
:root[data-style="newspaper"] .site-header { background: var(--bg); border-bottom: 4px double var(--text); }
:root[data-style="newspaper"] .logo { font-size: 1.9rem; font-weight: 800; letter-spacing: -.04em; text-transform: uppercase; }
:root[data-style="newspaper"] .nav-item a { text-transform: uppercase; font-size: .8rem; font-weight: 700; letter-spacing: .08em; }
:root[data-style="newspaper"] .section-head { padding-top: 12px; border-top: 4px double var(--text); }
:root[data-style="newspaper"] .section-title { padding-bottom: 0; }
:root[data-style="newspaper"] .section-title::after, :root[data-style="newspaper"] .footer-wave, :root[data-style="newspaper"] .kicker-dot { display: none; }
:root[data-style="newspaper"] .section-link { padding-bottom: 0; }
:root[data-style="newspaper"] .card-media { border-radius: 0; }
:root[data-style="newspaper"] .card-media img, :root[data-style="newspaper"] .row-media img { filter: grayscale(.9) contrast(1.05); transition: filter .4s, transform .7s; }
:root[data-style="newspaper"] .card:hover .card-media img, :root[data-style="newspaper"] .row-card:hover .row-media img { filter: none; }
:root[data-style="newspaper"] .card-title { font-weight: 800; }
:root[data-style="newspaper"] .chip { padding: 0 0 2px; background: transparent; border-bottom: 1px solid var(--text); color: var(--text); letter-spacing: .12em; }
:root[data-style="newspaper"] a.chip:hover { background: transparent; color: var(--accent-ink); }
:root[data-style="newspaper"] .chip-glass { padding: 3px 9px; background: var(--bg); color: var(--text); border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-style="newspaper"] .btn-primary { background: var(--text); color: var(--bg); }
:root[data-style="newspaper"] .btn-primary:hover { background: var(--accent); box-shadow: none; transform: none; }
:root[data-style="newspaper"] .ticker, :root[data-style="newspaper"] .topbar { border-color: var(--text); }
:root[data-style="newspaper"] .site-footer { border-top: 4px double var(--text); }
:root[data-style="newspaper"] .gh-content { font-family: var(--gh-font-body, var(--font-serif)); }

/* Settings overrides: text size, corner radius, header style, back-to-top */
:root[data-text="small"] { font-size: 93.75%; }
:root[data-text="large"] { font-size: 112.5%; }

:root[data-radius="sharp"][data-style] { --radius: 2px; --radius-sm: 2px; --pill: 2px; }
:root[data-radius="soft"][data-style] { --radius: 16px; --radius-sm: 10px; --pill: 12px; }
:root[data-radius="round"][data-style] { --radius: 32px; --radius-sm: 20px; --pill: 999px; }

:root[data-header-style="solid"] .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
:root[data-header-style="floating"] .site-header[data-nav] { top: 12px; width: calc(100% - var(--gutter) * 2); max-width: var(--container); margin: 12px auto 0; border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow); }
:root[data-header-style="floating"] .site-header .header-inner { padding-inline: 20px; }
:root[data-header-style="floating"] .site-header[data-nav="stacked"] .header-inner { row-gap: 0; }

.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: var(--card-border); border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); line-height: 0; transition: transform .2s, background-color .2s, color .2s; }
.to-top:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-3px); }
.to-top[hidden] { display: none !important; }

/* 16. Archive layouts, post sidebar and widgets ---------------------------- */

/* Archive layout "List": large horizontal cards */
.list-layout { display: flex; flex-direction: column; gap: clamp(18px, 2.4vw, 28px); max-width: 980px; margin-inline: auto; }
.list-item { position: relative; display: grid; grid-template-columns: 1fr; gap: clamp(16px, 3vw, 32px); align-items: center; padding: 14px; border: var(--card-border); border-radius: var(--radius); background: var(--card-bg); box-shadow: var(--card-shadow); transition: transform .25s, box-shadow .25s; }
@media (min-width: 720px) { .list-item { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding: 16px 28px 16px 16px; } }
.list-item:hover { transform: var(--card-hover-move); box-shadow: var(--card-hover-shadow); }
.list-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: max(calc(var(--radius) - 6px), 2px); background: var(--surface-2); }
.list-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.list-item:hover .list-media img { transform: scale(1.05); }
.list-body { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.list-title { font-size: clamp(1.3rem, 1.1rem + .9vw, 1.8rem); line-height: 1.2; }
.list-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .3s; }
.list-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.list-item:hover .list-title a { background-size: 100% 2px; }
.list-excerpt { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.list-body .post-meta { position: relative; z-index: 2; }

/* Archive layout "Magazine": one large tile, then a grid */
.mag-grid { margin-top: clamp(20px, 3vw, 32px); }

/* Archive layout "Compact": two columns of small rows */
.compact-grid { display: grid; grid-template-columns: 1fr; column-gap: clamp(24px, 5vw, 64px); }
@media (min-width: 760px) { .compact-grid { grid-template-columns: 1fr 1fr; } }
.compact-grid .row-card { grid-template-columns: 132px 1fr; }
.compact-grid .row-card:last-child { border-bottom: 1px solid var(--line); }

/* Archive layout "Classic": flat rows, image on the left, text on the right */
.classic-list { display: flex; flex-direction: column; }
.classic-item { position: relative; display: grid; grid-template-columns: 1fr; gap: clamp(14px, 3vw, 32px); align-items: center; padding-block: clamp(20px, 3vw, 32px); border-bottom: 1px solid var(--line); }
.classic-item:first-child { padding-top: 0; }
@media (min-width: 640px) { .classic-item { grid-template-columns: minmax(0, 300px) 1fr; } }
.classic-media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.classic-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.classic-item:hover .classic-media img { transform: scale(1.05); }
.classic-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.classic-title { font-size: clamp(1.3rem, 1.1rem + .8vw, 1.7rem); line-height: 1.22; }
.classic-title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size .3s; }
.classic-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.classic-item:hover .classic-title a { background-size: 100% 2px; }
.classic-excerpt { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.classic-body .post-meta, .classic-body .chip, .classic-body .badge { position: relative; z-index: 2; }

/* Archive with sidebar */
.archive-main { min-width: 0; }
.archive-main .grid { grid-template-columns: 1fr; }
@media (min-width: 640px) { .archive-main .grid { grid-template-columns: repeat(2, 1fr); } }
.archive-shell .pagination { margin-top: 32px; }

/* Post with a sidebar */
.article-shell.has-sidebar, .archive-shell.has-sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 1000px) {
    .article-shell.has-sidebar { grid-template-columns: minmax(0, 780px) 340px; justify-content: center; gap: 56px; align-items: start; }
    .article-shell.side-left { grid-template-columns: 340px minmax(0, 780px); }
    .archive-shell.has-sidebar { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
    .archive-shell.side-left { grid-template-columns: 340px minmax(0, 1fr); }
    .article-shell.side-left .sidebar, .archive-shell.side-left .sidebar { order: -1; }
    .article-shell.has-sidebar .sidebar, .archive-shell.has-sidebar .sidebar { align-self: stretch; }
}
.has-sidebar .gh-content { display: block; }
.has-sidebar .container-narrow { max-width: none; padding-inline: 0; }
.has-sidebar .toc { width: 100%; }
.has-sidebar .post-nav { grid-template-columns: 1fr; }
.has-sidebar .post-nav-next { grid-column: auto; text-align: left; }
.has-sidebar .post-nav-next .post-nav-label { justify-content: flex-start; }

.sidebar { min-width: 0; }
.sidebar-inner { display: flex; flex-direction: column; gap: 24px; }
@media (min-width: 1000px) { .sidebar-inner { position: sticky; top: calc(var(--header-h) + 24px); will-change: transform; } }

.widget { padding: 22px; border: var(--card-border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-shadow); }
.widget-title { position: relative; margin-bottom: 18px; padding-bottom: 12px; font-size: 1.15rem; }
.widget-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 36px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.widget-list { display: flex; flex-direction: column; }
.widget-text { margin-bottom: 14px; color: var(--muted); font-size: .95rem; }
.widget-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.widget-tags .chip-lg { padding: 6px 12px; font-size: .78rem; }
.widget-form { display: flex; flex-direction: column; gap: 10px; }
.widget-cta .input { min-height: 46px; }

.search-wide { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--pill); background: var(--bg); color: var(--muted); text-align: left; transition: border-color .15s, color .15s; }
.search-wide svg { width: 18px; height: 18px; }
.search-wide:hover { border-color: var(--accent); color: var(--text); }
.widget-about .logo { margin-bottom: 8px; }
.widget-social { display: flex; flex-wrap: wrap; gap: 8px; }
.widget-social .btn { min-height: 40px; padding: 0 16px; }
.widget-author { grid-template-columns: 56px 1fr; }
.widget-author .avatar { width: 56px; height: 56px; }
.widget-toc .toc-list { margin: 0; padding-left: 1.3em; font-size: .92rem; }
.widget-toc .toc-list li { padding: 5px 0; line-height: 1.35; }
.widget-toc .toc-list a { display: block; color: var(--muted); transition: color .15s; }
.widget-toc .toc-list a:hover, .widget-toc .toc-list a.is-active { color: var(--accent-ink); }
.widget-toc .toc-list a.is-active { font-weight: 600; }
@media (min-width: 1000px) { .toc-in-sidebar .toc { display: none !important; } }

.mini { position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.mini:first-child { padding-top: 0; }
.mini:last-child { padding-bottom: 0; border-bottom: 0; }
.mini-media { display: block; width: 72px; height: 72px; overflow: hidden; border-radius: var(--radius-sm); background: var(--surface-2); }
.mini-media img { width: 100%; height: 100%; object-fit: cover; }
.mini-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-title { font-size: .98rem; line-height: 1.3; }
.mini-title a::after { content: ""; position: absolute; inset: 0; }
.mini-title a:hover { color: var(--accent-ink); }
.mini-date { font-size: .78rem; color: var(--muted); }

/* Layout widths: "content-wide" makes the page content wider (still centred, not edge to edge);
   "header-wide" stretches the announcement bar, top bar and header across the whole window. */
:root[data-content="wide"] { --container: 1440px; --container-wide: 1280px; --container-narrow: 820px; --measure: 740px; }
@media (min-width: 1000px) {
    :root[data-content="wide"] .article-shell.has-sidebar { grid-template-columns: minmax(0, 860px) 360px; }
    :root[data-content="wide"] .article-shell.side-left { grid-template-columns: 360px minmax(0, 860px); }
    :root[data-content="wide"] .archive-shell.has-sidebar { grid-template-columns: minmax(0, 1fr) 360px; }
    :root[data-content="wide"] .archive-shell.side-left { grid-template-columns: 360px minmax(0, 1fr); }
}
:root[data-header-width="full"] :is(.announcement, .topbar, .site-header) .container { max-width: none; padding-inline: clamp(16px, 3vw, 48px); }
:root[data-header-width="full"][data-header-style="floating"] .site-header[data-nav] { max-width: none; }

/* 14. Utilities, motion & print -------------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: no-preference) {
    @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
    .hero-card, .tile-card, .row-card, .article-header { animation: rise .6s cubic-bezier(.2, .7, .2, 1) both; }
    .row-card:nth-of-type(2) { animation-delay: .05s; }
    .row-card:nth-of-type(3) { animation-delay: .1s; }
    .row-card:nth-of-type(4) { animation-delay: .15s; }
    .row-card:nth-of-type(5) { animation-delay: .2s; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ticker-viewport { overflow-x: auto; }
    .ticker-track { animation: none; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
    .announcement, .topbar, .sidebar, .to-top, .site-header, .site-footer, .ticker, .cta, .share, .post-nav, .related, .progress, .toc, .comments, .skip-link { display: none !important; }
    body { background: #fff; color: #000; }
    .gh-content { display: block; font-size: 12pt; }
    .gh-content a:not([class])::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}
