/* ==========================================================================
   Design tokens — "midnight signal" dark identity
   Near-black surfaces, coral→amber glow accent, glass chrome, distinctive
   display type for story titles. Dark-first by design.
   ========================================================================== */
:root {
    --color-primary: #606165;
    --color-accent: #ff8975;
    --color-accent-2: #ffa347;
    --color-accent-contrast: #0d0d0d;

    --color-bg: #09090b;
    --color-bg-alt: #121214;
    --color-surface: #141416;
    --color-surface-raised: #1a1a1e;
    --color-text: #f4f4f5;
    --color-text-muted: #a1a1aa;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.14);
    --color-link: var(--color-accent);
    --color-focus: #ff8a75;
    --color-ring: rgba(255, 137, 117, 0.35);

    --gradient-warm: linear-gradient(165deg, #16161a 0%, #0a0a0c 55%, #09090b 100%);
    --gradient-accent: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-2) 100%);
    --gradient-mesh:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(255, 137, 117, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 10%, rgba(255, 163, 71, 0.12), transparent 50%),
        radial-gradient(ellipse 60% 40% at 70% 80%, rgba(96, 97, 101, 0.2), transparent 50%),
        var(--gradient-warm);

    /* Plus Jakarta Sans = modern UI; Fraunces = soft optical serif for story display. */
    --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Fraunces", "Plus Jakarta Sans", Georgia, "Times New Roman", serif;
    --font-serif: var(--font-display);

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4.5rem;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 48px rgba(255, 137, 117, 0.28);
    --shadow-card: 0 0 0 1px var(--color-border), 0 12px 40px rgba(0, 0, 0, 0.35);

    --container-width: 1180px;
    --content-width: 720px;
    --header-blur: 18px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.65;
    font-size: 17px;
    font-feature-settings: "ss01" on, "cv11" on;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
::selection {
    background: rgba(255, 137, 117, 0.35);
    color: #fff;
}
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { line-height: 1.2; margin: 0 0 var(--space-3); font-weight: 650; }

/* Display face for page/story titles; body UI stays geometric sans. */
h1, .hero__intro h1, .article-header h1, .post-card--lead .post-card__title,
.post-card--featured .post-card__title, .error-page__code {
    font-family: var(--font-display);
    font-weight: 550;
    font-optical-sizing: auto;
    letter-spacing: -0.03em;
}
h1 { font-size: clamp(2.25rem, 1.7rem + 2.4vw, 3.5rem); line-height: 1.05; }
h2 {
    font-family: var(--font-sans);
    font-size: clamp(1.55rem, 1.3rem + 1vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 650;
}
h3 {
    font-family: var(--font-sans);
    font-size: 1.28rem;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.015em;
}
p { margin: 0 0 var(--space-4); }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: 4px;
}
ul, ol { padding-left: 1.3em; }
button { font-family: inherit; }

/* Skip link: hidden until focused, then jumps above the header for keyboard users. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-3) var(--space-4);
    z-index: 1000;
    border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
    left: 0;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-5);
}
.content-width {
    max-width: var(--content-width);
    margin: 0 auto;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Header / Navigation — frosted glass sticky chrome
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
}
/* Blur lives on a pseudo-element rather than .site-header itself: some mobile
   browsers (notably iOS Safari) treat an element with backdrop-filter as the
   containing block for its position: fixed descendants instead of the viewport,
   which clipped .primary-nav (fixed, nested inside this header) to the header's
   own height. z-index: -1 keeps it painted behind the header's real content
   regardless of that content's own positioning. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgba(9, 9, 11, 0.72);
    backdrop-filter: saturate(1.4) blur(var(--header-blur));
    -webkit-backdrop-filter: saturate(1.4) blur(var(--header-blur));
}
.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    gap: var(--space-5);
}
.site-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-text);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    text-decoration: none;
}
.site-brand:hover { text-decoration: none; opacity: 0.92; }
.site-brand img { height: 34px; width: auto; border-radius: 9px; }

.nav-toggle {
    display: none;
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    color: var(--color-text);
}
.nav-toggle__icon { display: block; width: 22px; height: 2px; background: currentColor; position: relative; border-radius: 2px; }
.nav-toggle__icon::before, .nav-toggle__icon::after {
    content: "";
    position: absolute; left: 0;
    width: 22px; height: 2px; background: currentColor;
    border-radius: 2px;
}
.nav-toggle__icon::before { top: -7px; }
.nav-toggle__icon::after { top: 7px; }

.primary-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    list-style: none;
    margin: 0; padding: 0;
}
.primary-nav__list a {
    position: relative;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease;
}
.primary-nav__list a::after { display: none; }
.primary-nav__list a:hover {
    color: var(--color-text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.06);
}

/* Bug fix: this search form lives inside the mobile slide-in nav panel and
   must only ever be shown there — it was previously visible at every width,
   duplicating .site-header__search right next to the nav links. */
.primary-nav__search { display: none; }

.site-header__search {
    display: flex;
    align-items: center;
    margin-left: var(--space-4);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.site-header__search:focus-within {
    border-color: var(--color-ring);
    box-shadow: 0 0 0 3px var(--color-ring);
}
.site-header__search input[type="search"] {
    padding: 0.45rem 0.85rem;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
    font-size: 0.88rem;
    width: 150px;
}
.site-header__search input[type="search"]:focus { outline: none; }
.site-header__search button {
    padding: 0.45rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.15s ease;
}
.site-header__search button:hover { color: var(--color-accent); }

/* ==========================================================================
   Buttons & forms
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.7rem 1.25rem;
    border-radius: 999px;
    font-weight: 650;
    font-size: 0.92rem;
    letter-spacing: -0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary {
    background: var(--gradient-accent);
    color: var(--color-accent-contrast);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, var(--shadow-sm);
}
.btn--primary:hover { filter: brightness(1.07); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, var(--shadow-glow); }
.btn--secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text);
    border-color: var(--color-border-strong);
}
.btn--secondary:hover {
    border-color: rgba(255, 137, 117, 0.45);
    color: var(--color-accent);
    background: rgba(255, 137, 117, 0.08);
}
.btn--sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

label { display: block; font-weight: 600; margin-bottom: var(--space-2); font-size: 0.88rem; color: var(--color-text); }
.form-group { margin-bottom: var(--space-5); }
.form-hint { font-size: 0.82rem; color: var(--color-text-muted); margin-top: var(--space-1); line-height: 1.45; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="url"], input[type="number"], input[type="date"], input[type="datetime-local"],
textarea, select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.25);
    color: var(--color-text);
    font-size: 0.98rem;
    font-family: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: rgba(255, 137, 117, 0.55);
    box-shadow: 0 0 0 3px var(--color-ring);
}
textarea { min-height: 140px; resize: vertical; }
.field-error { color: #ff9c8f; font-size: 0.85rem; margin-top: var(--space-1); }
.honeypot-field { position: absolute; left: -9999px; top: -9999px; }

/* ==========================================================================
   Alerts / flash messages
   ========================================================================== */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-5);
    border: 1px solid transparent;
}
.alert--success { background: #123524; color: #7ee2ab; border-color: #1f5c3d; }
.alert--error { background: #3a1613; color: #ff9c8f; border-color: #6b2620; }
.alert--info { background: #12283f; color: #8ec0f5; border-color: #1f4066; }

/* ==========================================================================
   Hero (homepage) — mesh gradient masthead + featured story card
   ========================================================================== */
.hero {
    background: var(--gradient-mesh);
    border-bottom: 1px solid var(--color-border);
    padding: clamp(3rem, 6vw, 5.5rem) 0;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, transparent 60%, var(--color-bg) 100%);
    pointer-events: none;
    z-index: 0;
}
/* Fine noise grain for depth without a bitmap asset. */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.35;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    mix-blend-mode: overlay;
}
.hero .container { position: relative; z-index: 1; }

/* Ambient floating bubbles — homepage hero only (markup lives in home.php so
   it never renders on other pages). Purely decorative, aria-hidden, colors
   drawn from the theme's own custom properties so they follow whatever
   primary/accent colors the admin has configured, in both color schemes. */
.hero-bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-bubble {
    position: absolute;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.32;
    will-change: transform;
    animation-name: hero-bubble-float;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}
.hero-bubble--1 { width: 260px; height: 260px; top: -90px; left: 6%; background: var(--color-primary); animation-duration: 26s; }
.hero-bubble--2 { width: 210px; height: 210px; top: 35%; right: 4%; background: var(--color-accent); animation-duration: 19s; animation-delay: -4s; }
.hero-bubble--3 { width: 160px; height: 160px; bottom: -70px; left: 38%; background: var(--color-accent-2); animation-duration: 23s; animation-delay: -9s; }
.hero-bubble--4 { width: 190px; height: 190px; top: 5%; right: 28%; background: var(--color-primary); opacity: 0.2; animation-duration: 30s; animation-delay: -14s; }

@keyframes hero-bubble-float {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(30px, -26px) scale(1.08); }
    50%  { transform: translate(-16px, 22px) scale(0.95); }
    75%  { transform: translate(-32px, -14px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

.hero__grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-7);
    align-items: center;
}
.hero__grid--solo {
    grid-template-columns: 1fr;
    max-width: 46ch;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-4);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 137, 117, 0.1);
    border: 1px solid rgba(255, 137, 117, 0.22);
}
.hero__intro h1 {
    margin-bottom: var(--space-4);
    max-width: 14ch;
    background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, 0.72) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero__intro p {
    color: var(--color-text-muted);
    font-size: 1.12rem;
    line-height: 1.55;
    max-width: 40ch;
    margin: 0;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.hero__meta { margin: var(--space-5) 0 0; font-size: 0.85rem; color: var(--color-text-muted); }
.hero__stat strong {
    font-family: var(--font-display);
    color: var(--color-text);
    font-size: 1.15rem;
    font-weight: 550;
}

.hero-feature {
    display: block;
    background: rgba(20, 20, 22, 0.85);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    color: var(--color-text);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    backdrop-filter: blur(8px);
}
.hero-feature:hover {
    text-decoration: none;
    transform: translateY(-4px);
    border-color: rgba(255, 137, 117, 0.35);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 137, 117, 0.2), var(--shadow-glow);
}
.hero-feature__image { aspect-ratio: 16 / 10; overflow: hidden; background: var(--gradient-warm); display: flex; align-items: center; justify-content: center; }
.hero-feature__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hero-feature:hover .hero-feature__image img { transform: scale(1.04); }
.hero-feature__body { padding: var(--space-5) var(--space-5) var(--space-6); }
.hero-feature__eyebrow {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
}
.hero-feature__title {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 550;
    letter-spacing: -0.025em;
    margin: 0 0 var(--space-2);
}
.hero-feature__excerpt { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: var(--space-3); line-height: 1.5; }
.hero-feature__meta { font-size: 0.82rem; font-weight: 650; color: var(--color-accent); }

/* ==========================================================================
   Post cards / listings
   ========================================================================== */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}
.post-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    position: relative;
}
.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
    border-color: var(--color-border-strong);
}
.post-card__image { aspect-ratio: 16 / 10; overflow: hidden; background: var(--gradient-warm); display: flex; align-items: center; justify-content: center; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.post-card:hover .post-card__image img { transform: scale(1.05); }

/* No-featured-image placeholder: a faint centered mark (reusing the open-book
   logomark geometry from favicon.svg/default-logo.svg) via a CSS mask, so the
   empty state reads as an intentional "no image yet" placeholder rather than
   a broken/loading image. Browsers without :has() support just see the plain
   gradient background above, which still degrades gracefully. */
.hero-feature__image:not(:has(img))::before,
.post-card__image:not(:has(img))::before {
    content: "";
    display: block;
    width: 28%;
    aspect-ratio: 1;
    background-color: var(--color-text-muted);
    opacity: 0.35;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 10.6c-2.3-1.7-5.1-2.4-7.4-2.1v11.7c2.3-.3 5.1.4 7.4 2.1 2.3-1.7 5.1-2.4 7.4-2.1V8.5c-2.3-.3-5.1.4-7.4 2.1Z'/%3E%3Ccircle cx='23.5' cy='8.5' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 10.6c-2.3-1.7-5.1-2.4-7.4-2.1v11.7c2.3-.3 5.1.4 7.4 2.1 2.3-1.7 5.1-2.4 7.4-2.1V8.5c-2.3-.3-5.1.4-7.4 2.1Z'/%3E%3Ccircle cx='23.5' cy='8.5' r='3'/%3E%3C/svg%3E") no-repeat center / contain;
}
.post-card__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.post-card__meta { font-size: 0.8rem; color: var(--color-text-muted); }
.post-card__meta a { color: var(--color-accent); font-weight: 600; }
.post-card__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 550;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.25;
}
.post-card__title a { color: var(--color-text); }
.post-card__title a:hover { color: var(--color-accent); text-decoration: none; }
.post-card__excerpt { color: var(--color-text-muted); font-size: 0.95rem; flex: 1; }

.post-card--featured {
    grid-column: span 2;
    grid-row: span 2;
}
.post-card--featured .post-card__title { font-size: 1.6rem; }
.post-card--featured .post-card__image { aspect-ratio: 16 / 9; }
.post-card--featured::before {
    content: "Featured";
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 2;
    background: var(--gradient-accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
}

.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0; }
.tag-pill {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--color-bg-alt);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.tag-pill:hover {
    color: #fff;
    text-decoration: none;
    border-color: transparent;
    background: var(--gradient-accent);
    transform: translateY(-1px);
}
/* Tag-cloud size tiers (sidebar widget) — weight by how many posts share the tag. */
.tag-pill--sm { font-size: 0.7rem; }
.tag-pill--lg { font-size: 0.92rem; font-weight: 700; }

/* Section headings above a post feed (e.g. "Latest Stories") */
.section-heading { margin-bottom: var(--space-5); }
.section-heading h2 { margin: 0; }
.section-heading--center { text-align: center; }

/* ==========================================================================
   Homepage builder sections (categories / tags / CTA / rich text)
   ========================================================================== */
.home-section--categories {
    padding: var(--space-7) 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.home-category-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-4);
}
.home-category-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: var(--space-5);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.home-category-card:hover {
    text-decoration: none;
    transform: translateY(-3px);
    border-color: rgba(255, 137, 117, 0.4);
    box-shadow: var(--shadow-md);
}
.home-category-card__name { font-weight: 700; letter-spacing: -0.02em; }
.home-category-card__count { font-size: 0.8rem; color: var(--color-text-muted); }

.home-tag-cloud {
    justify-content: center;
    gap: var(--space-2);
}

.home-section--cta { padding: var(--space-7) 0; }
.home-cta {
    text-align: center;
    padding: clamp(2rem, 5vw, 3.25rem);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-strong);
    background:
        radial-gradient(ellipse 70% 80% at 20% 0%, rgba(255, 137, 117, 0.16), transparent 55%),
        radial-gradient(ellipse 60% 70% at 90% 100%, rgba(255, 163, 71, 0.1), transparent 50%),
        var(--color-surface);
    box-shadow: var(--shadow-card);
}
.home-cta__title {
    font-family: var(--font-display);
    font-weight: 550;
    letter-spacing: -0.03em;
    margin: 0 0 var(--space-3);
    font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
}
.home-cta__text {
    color: var(--color-text-muted);
    max-width: 40ch;
    margin: 0 auto var(--space-5);
    font-size: 1.05rem;
}

.home-rich-text { padding: 0 var(--space-2); }

/* Latest-stories feed: the two newest posts as equal-width, widened lead
   cards up top, with the "More Stories" rail moved below (full width)
   instead of squeezed into a narrow side column. */
.latest-duo {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-7);
    margin-bottom: var(--space-7);
}
/* Only one post available (few-post sites) — collapse to a single column
   rather than leaving a large empty gap beside the lead card. */
.latest-duo--solo { grid-template-columns: 1fr; }
.latest-duo--solo .post-card--lead { max-width: 640px; }
.post-card--lead .post-card__image { aspect-ratio: 16 / 9; }
.post-card--lead .post-card__title { font-size: 1.75rem; }
.post-card--lead .post-card__excerpt { font-size: 1.02rem; }

/* Rail box: same bordered/surfaced card treatment as the sidebar .widget
   boxes, so the "More Stories" block reads as an intentional, contained
   section rather than stray unboxed content. */
.magazine-rail { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.magazine-rail--full { margin-bottom: var(--space-7); }
.magazine-rail__title {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-4);
}

.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-5); }
/* Full-width rail: lay the items out in a row of columns instead of one
   long vertical stack, since there's now a whole section's width to use. */
.post-list--row { flex-direction: row; flex-wrap: wrap; }
.post-list--row .post-list__item { flex: 1 1 200px; min-width: 200px; }
.post-list__item { display: flex; gap: var(--space-4); }
.post-list__thumb {
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--gradient-warm);
}
.post-list__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-list__body { flex: 1; min-width: 0; }
.post-list__title { font-size: 1.02rem; margin: 0 0 var(--space-1); }
.post-list__title a { color: var(--color-text); }
.post-list__title a:hover { color: var(--color-accent); text-decoration: none; }
.post-list__meta { font-size: 0.78rem; color: var(--color-text-muted); margin: 0; }

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs { margin-bottom: var(--space-5); }
.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin: 0 var(--space-2);
    color: var(--color-border);
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs li:last-child span { color: var(--color-text); font-weight: 600; }

/* ==========================================================================
   Article / single post
   ========================================================================== */
.article-header { margin-bottom: var(--space-6); }
.article-meta {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-3);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
}
.article-meta a { font-weight: 650; }
.article-featured-image {
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--space-7);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
}
.article-body {
    font-size: 1.1rem;
    line-height: 1.75;
    color: rgba(244, 244, 245, 0.92);
}
.article-body p { margin-bottom: var(--space-5); }
.article-body img { border-radius: var(--radius-md); margin: var(--space-6) 0; border: 1px solid var(--color-border); }
.article-body h2 {
    font-family: var(--font-display);
    font-weight: 550;
    letter-spacing: -0.025em;
    margin-top: var(--space-7);
    color: #fff;
}
.article-body h3 { margin-top: var(--space-6); color: #fff; }
.article-body a { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: rgba(255, 137, 117, 0.45); }
.article-body a:hover { text-decoration-color: var(--color-accent); }
.article-body blockquote {
    margin: var(--space-6) 0;
    padding: var(--space-5) var(--space-5) var(--space-5) var(--space-6);
    border-left: 3px solid transparent;
    border-image: var(--gradient-accent) 1;
    background: linear-gradient(90deg, rgba(255, 137, 117, 0.08), transparent 80%);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--color-text-muted);
}
.article-body pre {
    background: #0c0c0e;
    border: 1px solid var(--color-border);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    overflow-x: auto;
    font-size: 0.9rem;
}
.article-body code {
    background: rgba(255, 255, 255, 0.06);
    padding: 0.12em 0.4em;
    border-radius: 6px;
    font-size: 0.9em;
}
.article-body pre code { background: none; padding: 0; }
.article-body iframe { max-width: 100%; border-radius: var(--radius-md); aspect-ratio: 16/9; width: 100%; height: auto; border: none; }

.article-share {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-top: var(--space-7);
    padding: var(--space-4) var(--space-5);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}
.article-share__label {
    font-weight: 650;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.author-bio {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
    margin-top: var(--space-7);
    padding: var(--space-5) var(--space-6);
    background: linear-gradient(145deg, rgba(255, 137, 117, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}
.author-bio__avatar {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}
.author-bio__avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-accent);
    color: #fff;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.4rem;
}
.author-bio__label { margin: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.author-bio__name { margin: 2px 0 var(--space-2); font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700; }
.author-bio__name a { color: var(--color-text); }
.author-bio__text { margin: 0; color: var(--color-text-muted); font-size: 0.92rem; }

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin: var(--space-7) 0;
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border);
}
.post-nav__link { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-4); display: block; color: var(--color-text); }
.post-nav__link:hover { border-color: var(--color-accent); text-decoration: none; }
.post-nav__label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.post-nav--next { text-align: right; }
/* Only one of prev/next exists — only that grid column is rendered (see
   post-single.php), so center it instead of leaving the other half blank. */
.post-nav--single { grid-template-columns: 1fr; justify-items: center; }
.post-nav--single .post-nav__link { width: 100%; max-width: 420px; }
.post-nav--single .post-nav--next { text-align: left; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: var(--space-7) 0;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-2);
    border-radius: 999px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.pagination a:hover { border-color: rgba(255, 137, 117, 0.45); color: var(--color-accent); text-decoration: none; background: rgba(255, 137, 117, 0.08); }
.pagination .is-current {
    background: var(--gradient-accent);
    color: var(--color-accent-contrast);
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}
.pagination .is-disabled { opacity: 0.35; pointer-events: none; }

/* ==========================================================================
   Sidebar / widgets
   ========================================================================== */
.layout-with-sidebar { display: grid; grid-template-columns: 2.2fr 1fr; gap: var(--space-7); align-items: start; }
.layout-primary { min-width: 0; }
.sidebar { min-width: 0; }

.widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    box-shadow: var(--shadow-sm);
}
.widget:last-child { margin-bottom: 0; }
.widget__title {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0 0 var(--space-4);
}
.widget ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.widget .tag-list { flex-direction: row; flex-wrap: wrap; gap: var(--space-2); }
.widget p:last-child { margin-bottom: 0; }
.widget__more { font-weight: 600; font-size: 0.88rem; }

.widget--categories ul li a { display: flex; justify-content: space-between; gap: var(--space-3); color: var(--color-text); }
.widget--categories ul li a:hover { color: var(--color-accent); text-decoration: none; }
.widget__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
    padding: 0 0.3em;
    border-radius: 999px;
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.widget__search-form { display: flex; }
.widget__search-form input[type="search"] {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    border-right: none;
}
.widget__search-form button {
    padding: 0 var(--space-4);
    border: 1px solid var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
}

.widget-posts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.widget-posts__item { display: flex; gap: var(--space-3); align-items: flex-start; }
.widget-posts__thumb { flex: 0 0 52px; width: 52px; height: 52px; border-radius: var(--radius-sm); overflow: hidden; background: var(--gradient-warm); }
.widget-posts__thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-posts__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.widget-posts__title { color: var(--color-text); font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.widget-posts__title:hover { color: var(--color-accent); text-decoration: none; }
.widget-posts__date { font-size: 0.76rem; color: var(--color-text-muted); }

/* ==========================================================================
   Comments
   ========================================================================== */
.comment-list { list-style: none; padding: 0; margin: var(--space-6) 0; display: flex; flex-direction: column; gap: var(--space-4); }
.comment {
    padding: var(--space-5);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
}
.comment__meta { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.comment__author { color: var(--color-text); font-weight: 700; }
.comment__body { line-height: 1.6; color: rgba(244, 244, 245, 0.9); }
.comment-replies { list-style: none; padding-left: var(--space-6); margin-top: var(--space-4); border-left: 2px solid var(--color-border); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-8);
    padding: var(--space-7) 0 var(--space-6);
}
.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}
.site-footer h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: var(--space-3); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-accent); }
.site-footer__bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: var(--space-5); border-top: 1px solid var(--color-border);
    font-size: 0.85rem; color: var(--color-text-muted); flex-wrap: wrap; gap: var(--space-3);
}
.social-links { display: flex; gap: var(--space-4); list-style: none; padding: 0; margin: 0; }

/* ==========================================================================
   Cookie consent banner — floating glass card
   ========================================================================== */
.cookie-banner {
    position: fixed;
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    background: rgba(18, 18, 20, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--color-text);
    padding: var(--space-4) var(--space-5);
    display: none;
    z-index: 200;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 720px;
    margin: 0 auto;
}
.cookie-banner.is-visible { display: block; }
.cookie-banner__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    flex-wrap: wrap;
}
.cookie-banner a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 0.12em; }
.cookie-banner p { font-size: 0.9rem; color: var(--color-text-muted); line-height: 1.45; }

/* ==========================================================================
   404 / error pages
   ========================================================================== */
.error-page { text-align: center; padding: var(--space-8) 0; }
.error-page__code {
    font-size: clamp(4.5rem, 12vw, 7rem);
    font-weight: 550;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
    line-height: 1;
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */
@media (max-width: 1023px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .post-card--featured { grid-column: span 2; grid-row: span 1; }
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-5); align-items: start; }
    .widget { margin-bottom: 0; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .hero__grid { grid-template-columns: 1fr; }
    .hero-feature { max-width: 480px; }
    .latest-duo { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    body { font-size: 16px; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .primary-nav {
        position: fixed;
        inset: 0 0 0 22%;
        background: rgba(14, 14, 16, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: var(--space-7) var(--space-5);
        transform: translateX(100%);
        transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
        overflow-y: auto;
        box-shadow: var(--shadow-lg);
        border-left: 1px solid var(--color-border);
    }
    .primary-nav.is-open { transform: translateX(0); }
    .primary-nav__list { flex-direction: column; align-items: stretch; gap: var(--space-2); }
    .primary-nav__list a { padding: 0.75rem 1rem; font-size: 1.05rem; }
    .site-header__search { display: none; }
    .primary-nav__search { display: block; margin-top: var(--space-6); }
    .primary-nav__search input[type="search"] { width: 100%; border-radius: var(--radius-sm); }
    .post-grid { grid-template-columns: 1fr; }
    .post-card--featured { grid-column: span 1; }
    .post-nav { grid-template-columns: 1fr; }
    .site-footer__grid { grid-template-columns: 1fr; }
    .sidebar { grid-template-columns: 1fr; }
    .hero-feature { max-width: none; }
    .post-card--lead .post-card__title { font-size: 1.4rem; }
    .author-bio { flex-direction: column; align-items: flex-start; }
    .cookie-banner { left: var(--space-3); right: var(--space-3); bottom: var(--space-3); }
}

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 90;
    display: none;
}
.nav-backdrop.is-visible { display: block; }

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
