/* ============================================================
   Fabulous Talk — bold, colourful magazine theme
   ============================================================ */

:root {
    --brand-1: #7b2ff7;
    --brand-2: #f107a3;
    --brand-3: #ff6a00;
    --brand-grad: linear-gradient(135deg, #7b2ff7 0%, #f107a3 55%, #ff6a00 100%);

    --bg: #ffffff;
    --bg-soft: #f7f5fb;
    --bg-card: #ffffff;
    --surface-line: #ece8f4;

    --text: #14101f;
    --text-soft: #5d5570;
    --text-faint: #8a8199;

    --radius-s: 8px;
    --radius: 16px;
    --radius-l: 24px;

    --shadow-s: 0 2px 8px rgba(28, 12, 56, .06);
    --shadow: 0 10px 30px rgba(28, 12, 56, .10);
    --shadow-l: 0 24px 60px rgba(28, 12, 56, .16);

    --wrap: 1320px;
    --gap: 28px;

    --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0a14;
        --bg-soft: #141020;
        --bg-card: #17122340;
        --surface-line: #2a2140;
        --text: #f4f1fa;
        --text-soft: #b6adcc;
        --text-faint: #8d84a6;
        --shadow-s: 0 2px 8px rgba(0, 0, 0, .3);
        --shadow: 0 10px 30px rgba(0, 0, 0, .45);
        --shadow-l: 0 24px 60px rgba(0, 0, 0, .6);
    }
}

:root[data-theme="dark"] {
    --bg: #0d0a14;
    --bg-soft: #141020;
    --bg-card: #171223;
    --surface-line: #2a2140;
    --text: #f4f1fa;
    --text-soft: #b6adcc;
    --text-faint: #8d84a6;
    --shadow-s: 0 2px 8px rgba(0, 0, 0, .3);
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-l: 0 24px 60px rgba(0, 0, 0, .6);
}

:root[data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #f7f5fb;
    --bg-card: #ffffff;
    --surface-line: #ece8f4;
    --text: #14101f;
    --text-soft: #5d5570;
    --text-faint: #8a8199;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    /* The drawer sits off-canvas to the right; without this it widens the page. */
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 20px;
}

/* ---------------------------------------------------- header */

/* Slim utility bar above the header. Not sticky — it scrolls away and leaves
   the main header pinned, the way the previous site behaved. */
.top-bar {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--surface-line);
    font-size: 13.5px;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 38px;
}

.top-links { display: flex; flex-wrap: wrap; gap: 20px; }

.top-links a {
    color: var(--text-soft);
    font-weight: 500;
    transition: color .2s ease;
}
.top-links a:hover { color: var(--brand-2); }

.top-auth {
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}
.top-auth a {
    color: var(--text-soft);
    font-weight: 600;
    transition: color .2s ease;
}
.top-auth a:hover { color: var(--brand-2); }
.top-sep  { color: var(--text-faint); }
.top-user { color: var(--text); font-weight: 700; }

@media (max-width: 640px) {
    .top-bar { font-size: 12.5px; }
    .top-links { gap: 14px; }
    .top-auth { gap: 7px; }
}

/* ---- sign-in / register ---- */

.auth-box { max-width: 460px; }
.auth-alt {
    margin: 22px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--surface-line);
    text-align: center;
    font-size: 14.5px;
    color: var(--text-soft);
}
.auth-alt a { font-weight: 700; color: var(--brand-2); }
.auth-alt a:hover { text-decoration: underline; }

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    font-style: normal;
    color: var(--text-faint);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid var(--surface-line);
    /* Own stacking context, so the blur layer below stays behind the bar's
       content instead of falling behind the page. */
    isolation: isolate;
}

/* The blur lives on a pseudo-element rather than the header itself: a
   backdrop-filter establishes a containing block, which would clip the
   "More" dropdown to the header's height. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(150%) blur(14px);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    height: 72px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    white-space: nowrap;
}

.logo-mark {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    display: block;
    border-radius: 12px;
    box-shadow: 0 5px 16px rgba(180, 30, 190, .3);
    transition: transform .22s ease;
}
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.06); }

.logo-type { display: flex; flex-direction: column; line-height: 1; }

.logo-type b {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.035em;
    color: var(--text);
}

/* Only the second word takes the gradient, so the name still reads clearly
   against both light and dark backgrounds. */
.logo-type b i {
    font-style: normal;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-left: 3px;
}

.logo-type em {
    font-style: normal;
    font-size: 8.5px;
    letter-spacing: .2em;
    font-weight: 700;
    color: var(--text-faint);
    margin-top: 5px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--text-soft);
    white-space: nowrap;
    transition: color .18s, background .18s;
}

.nav a:hover { color: var(--text); background: var(--bg-soft); }

.nav a.active {
    color: #fff;
    background: var(--brand-grad);
}

/* ---------------------------------------------------- "More" dropdown */

.nav-more { position: relative; }

.nav-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: none;
    border-radius: 999px;
    background: none;
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    white-space: nowrap;
    transition: color .18s, background .18s;
}
.nav-more-btn svg { width: 14px; height: 14px; transition: transform .22s ease; }
.nav-more-btn:hover { color: var(--text); background: var(--bg-soft); }
.nav-more-btn.active { color: #fff; background: var(--brand-grad); }
.nav-more.open .nav-more-btn svg { transform: rotate(180deg); }

.nav-drop {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 70;
    min-width: 230px;
    max-height: min(70vh, 460px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--surface-line);
    border-radius: 14px;
    background: var(--bg-card);
    box-shadow: var(--shadow-l);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}

.nav-more.open .nav-drop { opacity: 1; visibility: visible; transform: none; }

.nav-drop a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-soft);
    white-space: nowrap;
}
.nav-drop a:hover { background: var(--bg-soft); color: var(--text); }
.nav-drop a.active { background: var(--brand-grad); color: #fff; }

.nav-drop a span {
    font-size: 11.5px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-faint);
}
.nav-drop a:hover span { background: var(--bg); }
.nav-drop a.active span { background: rgba(255,255,255,.24); color: #fff; }

/* The bar scrolls horizontally, which would clip an absolutely positioned
   panel — so it stops scrolling once there is room for the dropdown. */
@media (min-width: 721px) {
    .nav { overflow: visible; }
}

.header-tools { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 12px;
    border: 1px solid var(--surface-line);
    background: var(--bg-card);
    color: var(--text-soft);
    cursor: pointer;
    transition: transform .15s, color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--brand-2); border-color: var(--brand-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

/* search panel */
.search-panel {
    display: none;
    padding: 0 0 18px;
}
.search-panel.open { display: block; }
.search-panel form { display: flex; gap: 10px; }
.search-panel input {
    flex: 1;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 2px solid var(--surface-line);
    background: var(--bg-card);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}
.search-panel input:focus { outline: none; border-color: var(--brand-1); }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius);
    background: var(--brand-grad);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(180, 30, 190, .28);
    transition: transform .16s, box-shadow .16s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(180, 30, 190, .36); }

/* ---------------------------------------------------- chips */

.chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #fff;
    background: hsl(var(--hue, 280) 82% 52%);
    white-space: nowrap;
}

.chip-ghost {
    background: transparent;
    color: hsl(var(--hue, 280) 72% 55%);
    border: 1.5px solid currentColor;
}

/* ---------------------------------------------------- hero */

.hero {
    padding: 30px 0 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.62fr 1fr;
    gap: 20px;
    /* Both columns share one height so the rail lines up with the lead. */
    align-items: stretch;
}

/* ---------------------------------------------------- hero slider */

.slider {
    position: relative;
    border-radius: var(--radius-l);
    overflow: hidden;
    min-height: 500px;
    box-shadow: var(--shadow-l);
    isolation: isolate;
    /* Brand colour shows only while the first photograph loads. */
    background: linear-gradient(128deg, #4a1d94 0%, #7b2ff7 40%, #c318b0 100%);
}

.slides { position: absolute; inset: 0; }

.slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    /* Outgoing slides fade out slower than the incoming one fades in, so the
       hero is always covered — never a blank frame mid-transition. */
    transition: opacity .5s ease;
    z-index: 1;
    /* Still fully painted, but not focusable or clickable while hidden. */
    pointer-events: none;
}

/* ---- full-bleed media ---- */

.slide-media { position: absolute; inset: 0; overflow: hidden; }

/* A blurred, enlarged copy fills any gap a portrait or square photo leaves,
   so the frame is always covered edge to edge. */
/* Only visible behind a picture that cannot fill the frame — `cover` handles
   most, but a very tall crop would otherwise letterbox. */
.slide-bg {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    object-fit: cover;
    filter: blur(30px) saturate(130%) brightness(.5);
}

.slide-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    /* Slow drift; `scale` rather than `transform` so the slide's own entrance
       animation does not overwrite it. */
    scale: 1.06;
    transition: scale 4.5s ease-out;
}
.slide.is-active .slide-img { scale: 1; }

.slide-media .ph { width: 100%; height: 100%; }

/* Shading weighted to the lower-left where the caption sits, so the picture
   stays visible up top while the headline still has something to sit on. */
.slide-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8,3,20,.22) 0%, rgba(8,3,20,.06) 26%,
                        rgba(8,3,20,.62) 62%, rgba(8,3,20,.96) 100%),
        linear-gradient(86deg, rgba(8,3,20,.78) 0%, rgba(8,3,20,.34) 40%, rgba(8,3,20,0) 72%);
}

.slide.is-active {
    opacity: 1;
    z-index: 2;
    pointer-events: auto;
    transition: opacity .28s ease;
}

.slide-body {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 700px;
    padding: 36px 40px 38px;
    color: #fff;
    min-width: 0;
}

/* Content lifts in as the slide becomes active. The starting state is only
   applied to slides that are not currently shown, so the first slide is fully
   visible on load — including when JavaScript never runs. */
.slide:not(.is-active) .slide-body > * {
    opacity: 0;
    transform: translateY(16px);
}

.slide .slide-body > * { transition: opacity .3s ease, transform .3s ease; }
.slide.is-active .slide-body > * { opacity: 1; transform: none; }
.slide.is-active .slide-body > *:nth-child(1) { transition-delay: .05s; }
.slide.is-active .slide-body > *:nth-child(2) { transition-delay: .10s; }
.slide.is-active .slide-body > *:nth-child(3) { transition-delay: .15s; }
.slide.is-active .slide-body > *:nth-child(4) { transition-delay: .20s; }

.slide-tags { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.slide-tags .stamp {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255,255,255,.72);
}

.slide h2 {
    font-family: var(--font-display);
    font-size: clamp(24px, 2.8vw, 38px);
    line-height: 1.15;
    letter-spacing: -.03em;
    font-weight: 800;
    margin: 0 0 12px;
    overflow-wrap: break-word;
    /* Keeps the headline legible over a busy photograph. */
    text-shadow: 0 2px 18px rgba(0, 0, 0, .55);
}

.slide h2 a { color: #fff; }
.slide h2 a:hover { text-decoration: underline; text-underline-offset: 5px; }

.slide p {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255,255,255,.9);
    text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}

/* White on the gradient — a gradient button would disappear into it. */
.slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 12px 24px;
    border-radius: 999px;
    background: #fff;
    color: #2a1150;
    font-weight: 700;
    font-size: 14.5px;
    box-shadow: 0 10px 26px rgba(10, 2, 26, .3);
    transition: gap .2s, transform .2s, box-shadow .2s;
}
.slide-cta svg { width: 17px; height: 17px; }
.slide-cta:hover { gap: 14px; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(10,2,26,.4); }

.slide-tags .chip {
    background: rgba(255, 255, 255, .95);
    color: #2a1150;
}

/* Kept for any page still using the single-image hero. */
.hero-main {
    position: relative;
    border-radius: var(--radius-l);
    overflow: hidden;
    min-height: 480px;
    display: flex;
    align-items: flex-end;
    box-shadow: var(--shadow-l);
    isolation: isolate;
}

.hero-main .media,
.card .media { position: absolute; inset: 0; z-index: -2; }

/* Bias the crop upward: faces and subjects sit in the top half of most news
   photographs, and the lower half is covered by the caption gradient anyway. */
.hero-main .media img,
.card .media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }

.card .thumb img { object-position: 50% 40%; }

.hero-main::after {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg,
        rgba(10,4,24,0) 20%, rgba(10,4,24,.45) 48%,
        rgba(10,4,24,.86) 78%, rgba(10,4,24,.96) 100%);
}

.hero-main .body { padding: 30px 34px 32px; color: #fff; width: 100%; }

.hero-main h2 {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.7vw, 36px);
    line-height: 1.16;
    letter-spacing: -.025em;
    margin: 12px 0 9px;
    font-weight: 800;
    overflow-wrap: break-word;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .35);
}

/* Long unbroken headlines must not push a card wider than its column. */
.card h3, .pop-item h4, .article-head h1, .prose {
    overflow-wrap: break-word;
}

.hero-main p { color: rgba(255,255,255,.82); margin: 0 0 14px; font-size: 15.5px; }

.hero-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 20px; }

.hero-side .card { min-height: 0; }

/* The rail sits beside a tall lead image, so its cards stay compact: a small
   square thumb, the category as a plain coloured label rather than a boxed
   chip, and the text block centred so short headlines are not left floating. */
/* Landscape rather than square: news photographs are shot wide, and a square
   crop cuts the subject off at both edges. */
.hero-side .card.compact .thumb {
    width: 148px;
    flex: 0 0 148px;
    aspect-ratio: 4 / 3;
    margin: 12px 0 12px 12px;
    border-radius: 12px;
    overflow: hidden;
}

.hero-side .card.compact .thumb img { object-position: 50% 30%; }

.hero-side .card.compact .body {
    padding: 14px 16px 14px 14px;
    justify-content: center;
    gap: 6px;
}

.hero-side .card.compact .chip-ghost {
    border: none;
    padding: 0;
    font-size: 10.5px;
    letter-spacing: .1em;
}

.hero-side .card.compact h3 { font-size: 15px; line-height: 1.34; }

.hero-side .card.compact .meta { padding-top: 2px; font-size: 12px; }

/* ---------------------------------------------------- cards */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-s);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}

.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }

/* Present for screen readers and crawlers, absent on screen. Used for the
   homepage H1, which the masthead already states visually. */
.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;
}

/* ---------------------------------------------------- ads */

.ad-unit {
    position: relative;
    padding-top: 18px;
    text-align: center;
}

.ad-label {
    position: absolute;
    top: 2px;
    left: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* AdSense refuses to fill a slot it measures as zero-wide — "No slot size for
   availableWidth=0". The unit has to be given a definite width, which an
   inline-block <ins> in a centred container does not get on its own. */
.ad-unit ins.adsbygoogle {
    display: block !important;
    width: 100% !important;
    min-width: 250px;
    min-height: 90px;
}

/* Mid-article: set apart from the prose it interrupts. */
.prose .ad-unit {
    margin: 30px 0;
    padding: 18px 0 6px;
    border-top: 1px solid var(--surface-line);
    border-bottom: 1px solid var(--surface-line);
}

/* Foot of an article. */
.article-col > .ad-unit { margin: 34px 0 8px; }

/* An ad occupying a grid cell. It keeps the card's frame so the row still lines
   up, but not the hover lift — nothing here is clickable as a whole.

   The cell is capped and scrolls nothing: a tall unit would otherwise stretch
   every card beside it to match, leaving them mostly blank. */
/* AdSense writes `height:auto !important; max-height:none !important` onto its
   own <ins>, so the unit cannot be capped directly — it will always grow to
   whatever it was served, and a 594px unit stretched every card in its row.
   The cell is given a fixed aspect instead, and clips what it contains. */
.grid > .card.ad-card {
    justify-content: flex-start;
    padding: 14px;
    background: var(--bg-soft);
    aspect-ratio: 3 / 4;
    overflow: hidden;
    align-self: start;
}
.ad-card:hover { transform: none; box-shadow: var(--shadow-s); border-color: var(--surface-line); }

/* A clipping window: the unit inside may be any height, but only this much of
   it is ever shown, so the grid row is never dictated by the ad. */
.ad-card .ad-unit {
    position: relative;
    width: 100%;
    height: 100%;
    padding-top: 16px;
    overflow: hidden;
}
.ad-card .ad-label { left: 50%; transform: translateX(-50%); }

/* Cards sit at the top of their row rather than stretching to the tallest cell,
   so one oversized neighbour cannot pad the rest with empty space. */
.grid > .card { align-self: start; }


/* Ad cells are never removed — a missing one leaves a hole in the grid, which
   is worse than a quiet slot. They are capped in height instead, so an empty or
   oversized unit cannot disturb the row around it. */

.card .thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-soft);
}

.card .thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .45s ease;
}
.card:hover .thumb img { transform: scale(1.06); }

.card .thumb .chip {
    position: absolute;
    left: 12px; top: 12px;
    z-index: 2;
    /* Lifts the label off busy photographs that carry their own headline text. */
    box-shadow: 0 3px 12px rgba(0, 0, 0, .35);
}

.card .body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    /* Flex items default to min-width:auto, which lets long words overflow. */
    min-width: 0;
}

.card h3 {
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: -.015em;
    margin: 0;
    font-weight: 700;
}

.card p { margin: 0; color: var(--text-soft); font-size: 14px; }

.card:hover h3 {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Placeholder for the few posts with no image of their own — mostly older
   hand-written pieces the wire cannot be re-queried for. A soft pattern reads
   as deliberate, where a bare letter looks like a loading failure. */
.ph {
    position: relative;
    width: 100%; height: 100%;
    display: grid; place-items: center;
    background:
        radial-gradient(circle at 22% 24%, rgba(255,255,255,.28) 0%, transparent 42%),
        radial-gradient(circle at 82% 78%, rgba(255,255,255,.16) 0%, transparent 46%),
        linear-gradient(135deg,
            hsl(var(--hue, 280) 76% 56%),
            hsl(calc(var(--hue, 280) + 45) 80% 46%));
    color: #fff;
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 800;
    overflow: hidden;
}

/* Faint diagonal texture so the tile is not a flat block of colour. */
.ph::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(255,255,255,.07) 0 2px,
        transparent 2px 11px
    );
}

.ph > * { position: relative; }

/* card variant used inside the hero side column */
.card.compact { flex-direction: row; align-items: stretch; }
.card.compact .thumb { aspect-ratio: auto; width: 132px; flex: 0 0 132px; }
.card.compact .body { padding: 12px 14px; }
.card.compact h3 { font-size: 14.5px; }

/* ---------------------------------------------------- meta line */

.meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-faint);
    margin-top: auto;
    padding-top: 4px;
}

.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta svg { width: 13px; height: 13px; opacity: .75; }

.hero-main .meta { color: rgba(255,255,255,.75); }

/* ---------------------------------------------------- sections */

.section { padding: 46px 0; }
.section.alt { background: var(--bg-soft); }

/* The hero already ends on generous padding. */
.hero + .section { padding-top: 34px; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.section-head h2 {
    font-family: var(--font-display);
    font-size: clamp(21px, 2.4vw, 30px);
    letter-spacing: -.025em;
    margin: 0;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-head h2::before {
    content: "";
    width: 6px; height: 30px;
    border-radius: 4px;
    background: var(--brand-grad);
}

.link-more {
    font-weight: 700;
    font-size: 14px;
    color: var(--brand-2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.link-more:hover { gap: 10px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: var(--gap);
}

/* Beside the sidebar the column is narrower, so cards get tighter and the
   first one spans the full width as a lead. */
.with-side .grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 22px;
}

.with-side .grid > .card:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
}
.with-side .grid > .card:first-child .thumb {
    width: 52%;
    flex: 0 0 52%;
    aspect-ratio: 16 / 10;
}
.with-side .grid > .card:first-child .body {
    padding: 26px 28px;
    justify-content: center;
    gap: 12px;
}
.with-side .grid > .card:first-child h3 { font-size: 24px; line-height: 1.26; }
.with-side .grid > .card:first-child p { font-size: 15px; }
.with-side .grid > .card:first-child .meta { margin-top: 6px; }

.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------------------------------------------------- rails */

.rail { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); align-items: start; }

.rail-head {
    position: sticky;
    top: 96px;
    padding: 26px;
    border-radius: var(--radius-l);
    /* A short hue sweep: wider than this and two sections whose base colours
       are close end up overlapping in the middle of the gradient. */
    background: linear-gradient(150deg,
        hsl(var(--hue, 280) 80% 56%),
        hsl(calc(var(--hue, 280) + 26) 84% 47%));
    color: #fff;
    box-shadow: var(--shadow);
}

.rail-head h2 { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; font-weight: 800; letter-spacing: -.02em; }
.rail-head p { margin: 0 0 16px; font-size: 13.5px; opacity: .85; }
.rail-head a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 16px; border-radius: 999px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.28);
    font-size: 13px; font-weight: 700;
}
.rail-head a:hover { background: rgba(255,255,255,.26); }

.rail-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ---------------------------------------------------- ticker */

.ticker {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--surface-line);
    background: var(--bg-soft);
    overflow: hidden;
}

.ticker-label {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--brand-grad);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.ticker-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .3 } }

.ticker-track {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    min-width: 0;
}
.ticker-track::-webkit-scrollbar { display: none; }

.ticker-track a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-soft);
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.ticker-track a:hover { color: var(--brand-2); }
.ticker-track a::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: hsl(var(--hue, 280) 80% 55%);
    flex: 0 0 auto;
}

/* ---------------------------------------------------- with-sidebar layout */

.with-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 44px;
    align-items: start;
}

/* The sidebar is the taller column on short pages. Stretching the row lets it
   size to the section rather than leaving dead space beneath the articles. */
.with-side > :first-child { min-width: 0; }

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: sticky;
    top: 96px;
    /* Keep the rail inside the viewport and let it scroll internally, so a
       long sidebar can never outrun the article column and leave a gap. */
    max-height: calc(100vh - 116px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding-right: 4px;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
    background: var(--surface-line);
    border-radius: 999px;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius);
    padding: 22px;
}

.widget h3 {
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: .13em;
    text-transform: uppercase;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--surface-line);
    font-weight: 800;
    position: relative;
}
.widget h3::after {
    content: "";
    position: absolute;
    left: 0; bottom: -2px;
    width: 46px; height: 2px;
    background: var(--brand-grad);
}

.side-list { display: flex; flex-direction: column; gap: 15px; }

.side-item { display: flex; gap: 13px; align-items: center; }

.side-thumb {
    width: 76px; height: 60px;
    flex: 0 0 76px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-soft);
}
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-thumb .ph { font-size: 20px; }

.side-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.side-text strong { font-size: 13.8px; font-weight: 650; line-height: 1.4; }
.side-text em { font-style: normal; font-size: 11.5px; color: var(--text-faint); }
.side-item:hover .side-text strong { color: var(--brand-2); }

.pill-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--surface-line);
    background: var(--bg-soft);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    transition: background .16s, color .16s, border-color .16s;
}
.pill span {
    font-size: 11px;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 999px;
    background: hsl(var(--hue, 280) 78% 55%);
    color: #fff;
}
.pill:hover { border-color: hsl(var(--hue, 280) 78% 55%); color: var(--text); }
.pill-plain:hover { border-color: var(--brand-2); color: var(--brand-2); }

.widget-cta {
    background: var(--brand-grad);
    border: none;
    color: #fff;
}
.widget-cta h3 { color: #fff; border-bottom-color: rgba(255,255,255,.3); }
.widget-cta h3::after { background: #fff; }
.widget-cta p { margin: 0 0 16px; font-size: 14px; opacity: .9; }

.btn-light {
    background: #fff;
    color: var(--brand-1);
    box-shadow: none;
    padding: 11px 20px;
    font-size: 14px;
}
.btn-light:hover { box-shadow: 0 10px 24px rgba(0,0,0,.18); }

/* ---------------------------------------------------- popular list */

.pop-list { display: flex; flex-direction: column; gap: 4px; counter-reset: pop; }

.pop-item {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--surface-line);
}
.pop-item:last-child { border-bottom: none; }

.pop-item::before {
    counter-increment: pop;
    content: counter(pop);
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    width: 38px;
    flex: 0 0 38px;
    text-align: center;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: .85;
}

.pop-item h4 { margin: 0 0 3px; font-size: 14.5px; font-weight: 650; line-height: 1.4; }
.pop-item:hover h4 { color: var(--brand-2); }
.pop-item .meta { margin: 0; padding: 0; }

/* ---------------------------------------------------- article */

.article { padding: 30px 0 60px; }

/* With a sidebar the article column is narrower, so the head no longer needs
   its own max-width and the text reads better left-aligned than centred. */
.article-grid { align-items: start; }
.article-col { min-width: 0; }

.article-col .article-head { max-width: none; text-align: left; }
.article-col .article-head h1 { font-size: clamp(26px, 3.1vw, 40px); }
.article-col .deck { font-size: 17.5px; }
.article-col .byline { justify-content: flex-start; }
.article-col .hero-figure { max-width: none; }
.article-col .prose,
.article-col .tag-row,
.article-col .share-row { max-width: none; margin-left: 0; margin-right: 0; }

.article-head { max-width: 800px; margin: 0 auto 28px; text-align: center; }

.article-head h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.15;
    letter-spacing: -.03em;
    margin: 16px 0 14px;
    font-weight: 800;
}

.deck {
    font-size: 18px;
    color: var(--text-soft);
    line-height: 1.6;
    margin: 0 0 20px;
}

.byline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13.5px;
    color: var(--text-faint);
    padding-top: 14px;
    border-top: 1px solid var(--surface-line);
}
.byline span { display: inline-flex; align-items: center; gap: 6px; }
.byline svg { width: 14px; height: 14px; }

.hero-figure {
    max-width: 980px;
    margin: 0 auto 34px;
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--shadow-l);
    aspect-ratio: 16 / 9;
    background: var(--bg-soft);
}
.hero-figure img { width: 100%; height: 100%; object-fit: cover; }

/* ---- article gallery ----
   Same frame as .hero-figure, but the pictures cross-fade and can be stepped
   through. Only rendered when a post actually has more than one picture. */
.figure-slider {
    position: relative;
    max-width: 980px;
    margin: 0 auto 34px;
    border-radius: var(--radius-l);
    overflow: hidden;
    box-shadow: var(--shadow-l);
    aspect-ratio: 16 / 9;
    background: var(--bg-soft);
}
.article-col .figure-slider { max-width: none; }

.figure-slides { position: absolute; inset: 0; }

.figure-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .45s ease;
}
.figure-slide.is-active { opacity: 1; }

/* Blurred fill behind anything that cannot cover a 16:9 frame on its own. */
.figure-bg {
    position: absolute;
    inset: -8%;
    width: 116%;
    height: 116%;
    object-fit: cover;
    filter: blur(28px) saturate(140%) brightness(.75);
}

/* `cover` fills the frame the way the hero slider does. The blurred layer
   behind still shows through for pictures too tall to crop cleanly. */
.figure-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

.figure-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(12, 4, 26, .52);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .25s ease, background .25s ease;
    backdrop-filter: blur(6px);
}
.figure-nav.prev { left: 14px; }
.figure-nav.next { right: 14px; }
.figure-nav svg { width: 20px; height: 20px; }
.figure-nav:hover { background: rgba(12, 4, 26, .78); }

/* Controls stay out of the way until the reader means to use them, but are
   always available to keyboard and touch users. */
.figure-slider:hover .figure-nav,
.figure-slider:focus-within .figure-nav { opacity: 1; }
@media (hover: none) { .figure-nav { opacity: 1; } }

.figure-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.figure-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: background .25s ease, width .25s ease;
}
.figure-dot.is-active { width: 22px; border-radius: 4px; background: #fff; }

@media (max-width: 640px) {
    .figure-nav { width: 34px; height: 34px; }
    .figure-nav.prev { left: 8px; }
    .figure-nav.next { right: 8px; }
}

.prose {
    max-width: 720px;
    margin: 0 auto;
    font-size: 17.5px;
    line-height: 1.8;
    color: var(--text);
}

.prose p { margin: 0 0 22px; }

.prose h4 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 40px 0 14px;
    padding-left: 15px;
    border-left: 5px solid;
    border-image: var(--brand-grad) 1;
}

.prose ul { margin: 0 0 24px; padding: 0; list-style: none; }

.prose li {
    position: relative;
    padding: 4px 0 4px 30px;
    margin-bottom: 6px;
}

.prose li::before {
    content: "";
    position: absolute;
    left: 6px; top: 16px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand-grad);
}

.prose li p { margin: 0; }

.prose strong {
    font-weight: 750;
    background: linear-gradient(transparent 62%, color-mix(in srgb, var(--brand-2) 26%, transparent) 0);
}

.prose a { color: var(--brand-1); text-decoration: underline; text-underline-offset: 3px; }

.tag-row { max-width: 720px; margin: 34px auto 0; display: flex; flex-wrap: wrap; gap: 9px; }

.tag {
    padding: 7px 15px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--surface-line);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}
.tag:hover { color: #fff; background: var(--brand-grad); border-color: transparent; }

/* ---------------------------------------------------- share row */

.share-row {
    max-width: 720px;
    margin: 36px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--surface-line);
}

.share-row strong {
    display: block;
    font-size: 12.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 14px;
}

.share-btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* Named, brand-coloured buttons: far more inviting than bare icons, and the
   reader can see where the link is going before clicking. */
.sbtn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 18px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    color: #fff;
    cursor: pointer;
    transition: transform .16s, filter .16s, box-shadow .16s;
}
.sbtn svg { width: 17px; height: 17px; }
.sbtn:hover { transform: translateY(-2px); filter: brightness(1.08); }

.sbtn.wa { background: #25d366; box-shadow: 0 6px 16px rgba(37,211,102,.32); }
.sbtn.fb { background: #1877f2; box-shadow: 0 6px 16px rgba(24,119,242,.32); }
.sbtn.x  { background: #14101f; box-shadow: 0 6px 16px rgba(20,16,31,.3); }
.sbtn.li { background: #0a66c2; box-shadow: 0 6px 16px rgba(10,102,194,.32); }

.sbtn.copy {
    background: var(--bg-soft);
    color: var(--text-soft);
    border: 1px solid var(--surface-line);
}
.sbtn.copy:hover { color: var(--brand-2); border-color: var(--brand-2); }

:root[data-theme="dark"] .sbtn.x { background: #2a2140; }

/* ---------------------------------------------------- page head */

.page-head {
    padding: 52px 0;
    background: var(--brand-grad);
    color: #fff;
    text-align: center;
}
.page-head h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 44px);
    margin: 0 0 8px;
    font-weight: 800;
    letter-spacing: -.03em;
}
.page-head p { margin: 0; opacity: .88; font-size: 15.5px; }

/* ---------------------------------------------------- contact form */

.contact-box {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-l);
    padding: 34px;
    box-shadow: var(--shadow);
}

.contact-form .field { margin-bottom: 20px; }
.contact-form label {
    display: block;
    margin-bottom: 7px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-soft);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 13px 15px;
    font: inherit;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--surface-line);
    border-radius: var(--radius-s);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.contact-form textarea { resize: vertical; min-height: 130px; line-height: 1.65; }

.contact-form input:focus,
.contact-form textarea:focus {
    outline: 0;
    border-color: var(--brand-2);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 22%, transparent);
}
.contact-form [aria-invalid="true"] { border-color: #e0245e; }

.field-error { display: block; margin-top: 6px; font-size: 13px; color: #e0245e; font-style: normal; }

/* The honeypot must be reachable by bots but invisible to people, so it is
   moved off-screen rather than display:none. */
.contact-form .trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.btn-send {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 26px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--brand-grad);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, gap .2s ease;
}
.btn-send svg { width: 17px; height: 17px; }
.btn-send:hover { gap: 14px; transform: translateY(-2px); box-shadow: var(--shadow); }

.form-note {
    padding: 16px 18px;
    border-radius: var(--radius-s);
    font-size: 15px;
    line-height: 1.6;
}
.form-note.ok  { background: color-mix(in srgb, #12b76a 12%, transparent); border: 1px solid color-mix(in srgb, #12b76a 34%, transparent); }
.form-note.bad { background: color-mix(in srgb, #e0245e 10%, transparent); border: 1px solid color-mix(in srgb, #e0245e 32%, transparent); margin-bottom: 22px; }
.form-note strong { display: block; margin-bottom: 4px; }
.form-note span { color: var(--text-soft); font-size: 14px; }

@media (max-width: 560px) { .contact-box { padding: 24px 20px; } }

/* ---------------------------------------------------- gallery */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}

.shot {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
    box-shadow: var(--shadow-s);
}
.shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}
.shot:hover img { transform: scale(1.07); }

.shot-veil {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 5px;
    padding: 14px;
    color: #fff;
    background: linear-gradient(180deg, rgba(8,3,20,0) 42%, rgba(8,3,20,.86) 100%);
    opacity: 0;
    transition: opacity .3s ease;
}
.shot:hover .shot-veil,
.shot:focus-visible .shot-veil { opacity: 1; }

.shot-cat {
    align-self: flex-start;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: hsl(var(--hue, 275) 85% 60%);
}
.shot-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; }

.gallery-pager {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 34px;
}
.gallery-pager a {
    padding: 11px 22px;
    border: 1px solid var(--surface-line);
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-soft);
    transition: border-color .2s ease, color .2s ease;
}
.gallery-pager a:hover { color: var(--brand-2); border-color: var(--brand-2); }

.empty-note { text-align: center; color: var(--text-faint); padding: 40px 0; }

/* Touch devices have no hover, so the caption is always shown. */
@media (hover: none) { .shot-veil { opacity: 1; } }

/* ---------------------------------------------------- breadcrumbs */

.crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-faint);
    margin-bottom: 22px;
}
.crumbs a { color: var(--text-soft); font-weight: 600; }
.crumbs a:hover { color: var(--brand-2); }
.crumbs em { font-style: normal; }

/* ---------------------------------------------------- load more */

.load-wrap { text-align: center; margin-top: 40px; }
.load-count { margin: 12px 0 0; font-size: 13px; color: var(--text-faint); }
#loadMore:disabled { opacity: .65; cursor: default; transform: none; }

/* ---------------------------------------------------- pagination */

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 44px; flex-wrap: wrap; }

.pager a, .pager span {
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--surface-line);
    font-weight: 650;
    font-size: 14px;
    color: var(--text-soft);
    background: var(--bg-card);
}
.pager a:hover { border-color: var(--brand-2); color: var(--brand-2); }
.pager .current { background: var(--brand-grad); border-color: transparent; color: #fff; }
.pager .gap { border: none; background: none; }

/* ---------------------------------------------------- footer */

/* Dark footer, matching the live site: About / Latest Posts / Social columns. */
.site-footer {
    margin-top: 64px;
    padding: 56px 0 24px;
    background: #1f1f1f;
    color: #d7d3dd;
}

:root[data-theme="dark"] .site-footer { background: #100c1a; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.25fr 1fr;
    gap: 56px;
    padding-bottom: 40px;
}

.footer-grid h4 {
    display: inline-block;
    font-size: 13px;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #fff;
    margin: 0 0 22px;
    padding-bottom: 10px;
    font-weight: 800;
    border-bottom: 2px solid var(--brand-2);
}

.foot-col p {
    color: #b3aebd;
    font-size: 14.5px;
    line-height: 1.75;
    margin: 0;
}

/* latest posts */
.foot-posts { display: flex; flex-direction: column; gap: 18px; }

.foot-post { display: flex; gap: 14px; align-items: center; }

.foot-thumb {
    width: 84px; height: 62px;
    flex: 0 0 84px;
    border-radius: 8px;
    overflow: hidden;
    background: #2a2a2a;
}
.foot-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; }
.foot-thumb .ph { font-size: 22px; }

.foot-text { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.foot-text strong { color: #fff; font-size: 14.5px; font-weight: 650; line-height: 1.4; }
.foot-text em { font-style: normal; font-size: 12.5px; color: #8f8a9b; }
.foot-post:hover strong { color: var(--brand-2); }

/* social */
.foot-social { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }

.foot-social a {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 8px;
    background: #2e2e2e;
    color: #d7d3dd;
    transition: background .18s, color .18s, transform .18s;
}
.foot-social svg { width: 18px; height: 18px; }
.foot-social a:hover { background: var(--brand-grad); color: #fff; transform: translateY(-2px); }

.foot-sub-label { color: #d7d3dd; font-size: 14.5px; margin: 0 0 14px; }

.foot-sub { display: flex; }

.foot-sub input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #3a3a3a;
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: #2a2a2a;
    color: #fff;
    font: inherit;
    font-size: 14.5px;
}
.foot-sub input::placeholder { color: #8f8a9b; }
.foot-sub input:focus { outline: none; border-color: var(--brand-1); }

.foot-sub button {
    padding: 14px 22px;
    border: none;
    border-radius: 0 4px 4px 0;
    background: var(--brand-1);
    color: #fff;
    font: inherit;
    font-size: 14.5px;
    font-weight: 650;
    cursor: pointer;
    transition: filter .18s;
}
.foot-sub button:hover { filter: brightness(1.12); }

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #9c96a8;
}

.foot-legal { display: flex; gap: 26px; flex-wrap: wrap; }
.foot-legal a { color: #d7d3dd; }
.foot-legal a:hover { color: var(--brand-2); }

/* back to top */
.to-top {
    position: fixed;
    right: 22px; bottom: 22px;
    z-index: 50;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border: none;
    border-radius: 6px;
    background: #2e2e2e;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s, background .2s, transform .2s;
}
.to-top svg { width: 20px; height: 20px; }
.to-top.show { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--brand-grad); transform: translateY(-2px); }

/* ---------------------------------------------------- empty / 404 */

.empty { text-align: center; padding: 80px 20px; }
.empty .big {
    font-family: var(--font-display);
    font-size: clamp(70px, 14vw, 130px);
    font-weight: 800;
    line-height: 1;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.empty h2 { font-family: var(--font-display); font-size: 26px; margin: 10px 0; }
.empty p { color: var(--text-soft); margin: 0 0 24px; }

/* ---------------------------------------------------- responsive */

/* Anything driven by a finger rather than a cursor: text links in the chrome
   were 21-23px tall, well under the ~44px a fingertip needs. Padding gives them
   height without changing the type size. Keyed to the input device, not the
   width, so a small laptop window is left alone. */
@media (hover: none), (max-width: 1024px) {
    .top-links a,
    .top-auth a,
    .foot-legal a {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
        padding: 0 2px;
    }
    .top-bar-inner { min-height: 44px; }
    .footer-bottom { gap: 4px 16px; }
    .ticker-track a { display: inline-flex; align-items: center; min-height: 38px; }
    .link-more { display: inline-flex; align-items: center; min-height: 38px; }
}

@media (max-width: 1024px) {
    /* The full category nav needs about 1100px. Between 720 and 1024 it was
       still shown and pushed the page 1200px wide, so a tablet scrolled
       sideways — hand over to the drawer here rather than at 720. The burger
       itself is switched on further down, after the rule that hides it. */
    .nav { display: none; }

    .with-side { grid-template-columns: 1fr; gap: 34px; }
    .sidebar { position: static; }
    .hero-grid { grid-template-columns: 1fr; }
    .slider { min-height: 440px; }
    .hero-side { grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
    .hero-side .card.compact { flex-direction: column; }
    .hero-side .card.compact .thumb { width: 100%; flex: none; aspect-ratio: 16/10; }
    .rail { grid-template-columns: 1fr; }
    .rail-head { position: static; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}

@media (max-width: 720px) {
    :root { --gap: 18px; }
    .header-inner { height: 62px; gap: 12px; }
    .logo { gap: 9px; }
    .logo-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
    .logo-type b { font-size: 18px; }
    .logo-type em { font-size: 7.5px; letter-spacing: .16em; }
    .nav { display: none; }

    /* Meta lines sat at 11.5px; nudged up to stay legible on a phone. */
    .side-item .side-text em,
    .foot-post .foot-text em,
    .card .meta { font-size: 12.5px; }
    .hero { padding: 18px 0 0; }
    .hero-main { min-height: 340px; }
    .hero-main .body { padding: 20px; }

    .slider { min-height: 400px; border-radius: var(--radius); }
    .slide-body { padding: 20px 20px 24px; }
    .slide h2 { font-size: 21px; }
    .slide p { display: none; }
    .slide-cta { padding: 10px 20px; font-size: 13.5px; }
    .hero-side { grid-template-columns: 1fr; }
    .hero-side .card.compact { flex-direction: row; }
    .hero-side .card.compact .thumb { width: 104px; flex: 0 0 104px; aspect-ratio: auto; }
    .card.compact .body { min-width: 0; }
    .card.compact h3 { font-size: 14px; }
    .card.compact .chip { font-size: 10px; padding: 4px 10px; }
    .rail-items { grid-template-columns: 1fr; }
    .grid, .grid-4 { grid-template-columns: 1fr; }

    /* The lead card stacks like the rest on a phone. */
    .with-side .grid > .card:first-child { flex-direction: column; }
    .with-side .grid > .card:first-child .thumb { width: 100%; flex: none; aspect-ratio: 16/10; }
    .with-side .grid > .card:first-child .body { padding: 16px 18px 18px; }
    .with-side .grid > .card:first-child h3 { font-size: 18px; }

    .section { padding: 34px 0; }
    .prose { font-size: 16.5px; }
    .footer-grid { grid-template-columns: 1fr; gap: 34px; }
    .footer-bottom { flex-direction: column; gap: 12px; }
    .foot-legal { gap: 18px; }
    .to-top { right: 14px; bottom: 14px; width: 42px; height: 42px; }
}

/* Mobile nav drawer */
.drawer {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(300px, 84vw);
    background: var(--bg);
    border-left: 1px solid var(--surface-line);
    padding: 20px;
    transform: translateX(100%);
    transition: transform .28s ease;
    z-index: 80;
    overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 650;
    color: var(--text-soft);
}
.drawer a:hover { background: var(--bg-soft); color: var(--text); }

.scrim {
    position: fixed; inset: 0;
    background: rgba(10, 4, 24, .5);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .28s;
    z-index: 70;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.burger { display: none; }

/* Matches where .nav hands over to the drawer. This block sits after the
   layout rules above, so it is what actually decides whether the button
   shows — setting it earlier was silently overridden and left a tablet with
   no way into the categories at all. */
@media (max-width: 1024px) { .burger { display: grid; } }

/* Reading progress bar */
.progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0;
    background: var(--brand-grad);
    z-index: 100;
    transition: width .1s linear;
}
