/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== THEME TOKENS =====
   Light is the default (:root) per product requirement — new visitors land
   on light, returning visitors get whatever theme-init.js resolved from
   localStorage and stamped onto <html data-theme="..."> before first paint.
   Dark below reproduces the original (pre-theming) design pixel-for-pixel,
   just re-scoped from a flat :root into an override block. Non-color
   tokens (fonts, radii, shadow shape) aren't theme-dependent and stay
   shared here. */
:root {
    --color-bg:         #faf8f2;
    --color-surface:    #ffffff;
    --color-surface2:   #f2ede2;
    --color-surface3:   #e9e2d2;
    --color-border:     #e0d8c7;
    --color-border2:    #cfc3aa;
    --color-gold:       #8a6a1f;
    --color-gold-light: #a9822b;
    --color-gold-dim:   rgba(138,106,31,.10);
    --color-text:       #2a2620;
    --color-story-text: #3a352c;
    --color-muted:      #6b6558;
    --color-muted2:     #7a725f;
    --color-accent:     #c0392b;
    --color-header-bg:  rgba(250,248,242,.92);
    --shadow:           0 4px 24px rgba(0,0,0,.12);
    --shadow-sm:        0 2px 8px rgba(0,0,0,.08);

    --font-serif:       'Georgia', 'Times New Roman', serif;
    --font-sans:        'Segoe UI', system-ui, -apple-system, sans-serif;
    --max-width:        920px;
    --radius:           6px;
    --radius-lg:        12px;
}

:root[data-theme="dark"] {
    --color-bg:         #080808;
    --color-surface:    #111111;
    --color-surface2:   #1a1a1a;
    --color-surface3:   #222222;
    --color-border:     #2a2a2a;
    --color-border2:    #383838;
    --color-gold:       #c9a84c;
    --color-gold-light: #e8c97e;
    --color-gold-dim:   rgba(201,168,76,.12);
    --color-text:       #e2e2e2;
    --color-story-text: #d0d0d0;
    --color-muted:      #777777;
    --color-muted2:     #555555;
    --color-accent:     #c0392b;
    --color-header-bg:  rgba(8,8,8,.95);
    --shadow:           0 4px 24px rgba(0,0,0,.5);
    --shadow-sm:        0 2px 8px rgba(0,0,0,.4);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--color-gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-gold-light); }

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

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2.5rem 0;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    line-height: 1.25;
    color: var(--color-gold);
    letter-spacing: -.01em;
}

h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.2rem, 3vw, 1.7rem); margin-bottom: .8rem; }
h3 { font-size: clamp(1rem, 2.5vw, 1.25rem); margin-bottom: .5rem; }

p { margin-bottom: 1rem; color: var(--color-text); }
small { color: var(--color-muted); font-size: .8rem; }

/* ===== ACCESSIBILITY ===== */
.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;
}

/* <dfn> marks the defining instance of a glossary term semantically —
   the browser's default italic styling isn't wanted when it wraps an h1. */
h1 dfn { font-style: normal; }

.skip-link {
    position: absolute;
    top: -3rem;
    left: 1rem;
    z-index: 300;
    padding: .6rem 1.2rem;
    background: var(--color-gold);
    color: var(--color-bg);
    font-weight: 700;
    border-radius: var(--radius);
    transition: top .2s;
}

.skip-link:focus {
    top: 1rem;
}

/* Honeypot field: hidden from real users via off-screen positioning
   (not display:none, which some bots specifically check for and skip). */
.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ===== SUBMIT STORY FORM ===== */
.submit-form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 640px; }
.submit-form label { display: block; font-weight: 600; margin-bottom: .4rem; }
.submit-form .field-hint { font-size: .85rem; color: var(--color-muted); margin-top: .3rem; }
.submit-form input[type="text"],
.submit-form input[type="email"],
.submit-form textarea {
    width: 100%;
    padding: .7rem .9rem;
    background: var(--color-surface2);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
}
.submit-form input[type="text"]:focus,
.submit-form input[type="email"]:focus,
.submit-form textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}
.submit-form textarea { min-height: 220px; resize: vertical; }
.submit-form .checkbox-field { display: flex; align-items: flex-start; gap: .6rem; }
.submit-form .checkbox-field input { margin-top: .3rem; }
.submit-form .checkbox-field label { font-weight: 400; margin-bottom: 0; }
.submit-form button {
    align-self: flex-start;
    padding: .8rem 1.8rem;
    background: var(--color-gold);
    color: var(--color-bg);
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.submit-form-errors {
    background: #fbeaea;
    color: #b3261e;
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.submit-success {
    background: var(--color-surface);
    border-left: 3px solid var(--color-gold);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* ===== LAYOUT ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

main { flex: 1; padding: 2.5rem 0 5rem; }

/* ===== HEADER ===== */
.site-header {
    background: var(--color-header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    color: var(--color-gold) !important;
    font-weight: bold;
    white-space: nowrap;
    letter-spacing: .02em;
}

.nav-logo span {
    color: var(--color-accent);
    font-style: italic;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ===== LANGUAGE SWITCHER DROPDOWN ===== */
.lang-dropdown {
    position: relative;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .75rem;
    background: var(--color-surface2);
    border: 1px solid var(--color-border2);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-transform: uppercase;
    letter-spacing: .06em;
    user-select: none;
}

.lang-dropdown-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.lang-dropdown-btn .lang-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s;
    display: inline-block;
}

.lang-dropdown.open .lang-arrow {
    transform: rotate(-135deg) translateY(-2px);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    min-width: 160px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all .2s ease;
    z-index: 300;
}

.lang-dropdown.open .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem 1rem;
    font-size: .85rem;
    color: var(--color-muted);
    transition: all .15s;
    border-bottom: 1px solid var(--color-border);
}

.lang-dropdown-menu a:last-child {
    border-bottom: none;
}

.lang-dropdown-menu a:hover {
    background: var(--color-gold-dim);
    color: var(--color-gold);
}

.lang-dropdown-menu a.active {
    color: var(--color-gold);
    background: var(--color-gold-dim);
    font-weight: 600;
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
}

.lang-name {
    flex: 1;
}

.lang-code {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-muted2);
}

/* ===== THEME TOGGLE =====
   Fixed 36x36 icon button, same footprint regardless of theme/icon shown,
   so flipping it never shifts surrounding nav layout (zero CLS). Sun/moon
   glyphs are inline SVG (no icon font/network request); only one is
   display:block at a time, swapped via [data-theme] on <html>. */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: var(--color-surface2);
    border: 1px solid var(--color-border2);
    border-radius: var(--radius);
    color: var(--color-text);
    cursor: pointer;
    transition: all .2s;
}

.theme-toggle-btn:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

.theme-toggle-btn svg {
    width: 18px;
    height: 18px;
}

.theme-toggle-icon-dark { display: none; }
.theme-toggle-icon-light { display: block; }

:root[data-theme="dark"] .theme-toggle-icon-dark { display: block; }
:root[data-theme="dark"] .theme-toggle-icon-light { display: none; }

/* ===== FOOTER ===== */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 3.5rem 0 0;
}

.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand .footer-logo {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--color-gold);
    font-weight: bold;
    margin-bottom: .6rem;
    display: block;
}

.footer-brand .footer-logo span { color: var(--color-accent); font-style: italic; }

.footer-brand p {
    color: var(--color-muted);
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-col h4 {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--color-muted2);
    margin-bottom: 1rem;
    font-family: var(--font-sans);
    font-weight: 700;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a {
    color: var(--color-muted);
    font-size: .9rem;
    transition: color .2s;
}
.footer-col ul li a:hover { color: var(--color-gold); }

.footer-bottom {
    max-width: var(--max-width);
    margin: 2.5rem auto 0;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
    color: var(--color-muted2);
}

.footer-bottom a { color: var(--color-muted2); transition: color .2s; }
.footer-bottom a:hover { color: var(--color-gold); }

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
    font-size: .82rem;
    margin-bottom: 2rem;
}

.breadcrumbs ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li + li::before {
    content: '›';
    margin: 0 .5rem;
    color: var(--color-muted2);
}

.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-gold); }
.breadcrumbs span { color: var(--color-muted2); }

/* ===== SECTION HEADING ===== */
.section-heading {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--color-muted2);
    font-family: var(--font-sans);
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.section-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ===== HERO ===== */
.home-hero {
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
    position: relative;
}

.home-hero::before {
    content: '';
    position: absolute;
    top: 0; left: -1.5rem; right: -1.5rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    opacity: .3;
}

.home-hero h1 {
    font-size: clamp(2rem, 5.5vw, 3.2rem);
    color: var(--color-gold);
    margin-bottom: 1rem;
    line-height: 1.15;
}

.home-hero p {
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 580px;
    line-height: 1.7;
    margin-bottom: 0;
}

/* ===== STORY CARD ===== */
.story-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    transition: border-color .25s, box-shadow .25s, transform .25s;
    position: relative;
}

.story-card::before {
    content: '';
    position: absolute;
    left: 0; top: 15%; bottom: 15%;
    width: 2px;
    background: var(--color-gold);
    border-radius: 2px;
    opacity: 0;
    transition: opacity .25s;
}

.story-card:hover {
    border-color: var(--color-border2);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.story-card:hover::before {
    opacity: 1;
}

.story-card h3 {
    margin-bottom: .4rem;
    font-size: 1.1rem;
}

.story-card h3 a {
    color: var(--color-text);
    font-family: var(--font-serif);
    line-height: 1.35;
}

.story-card h3 a:hover { color: var(--color-gold); }

.story-card p {
    color: var(--color-muted);
    font-size: .92rem;
    margin: .4rem 0 .8rem;
    line-height: 1.6;
}

.story-meta {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    flex-wrap: wrap;
}

.story-meta small {
    color: var(--color-muted2);
    font-size: .78rem;
}

/* ===== HOME SECTION ===== */
.home-section { margin-bottom: 1rem; }

/* ===== CATEGORY PILLS ===== */
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.category-pill {
    display: inline-flex;
    align-items: center;
    padding: .4rem 1.1rem;
    background: var(--color-surface2);
    border: 1px solid var(--color-border);
    border-radius: 30px;
    font-size: .85rem;
    color: var(--color-muted);
    transition: all .2s;
    font-weight: 500;
}

.category-pill:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
}

/* ===== TAG PILLS ===== */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: .25rem .8rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: .78rem;
    color: var(--color-muted2);
    transition: all .2s;
    letter-spacing: .02em;
}

.tag-pill:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
}

/* ===== BROWSE MODULES (story page) ===== */
.browse-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.75rem;
}

.browse-module-heading {
    font-size: .95rem;
    color: var(--color-muted);
    margin-bottom: .75rem;
}

.tag-pill--active {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
}

/* ===== FEATURED STORIES (homepage teaser) =====
   Editorial highlight, not a ranking — the panel background and badge
   signal "curated" so it doesn't read as a duplicate of the "Most Read"
   nav tab/page below it. Title/excerpt get their own warmer, slightly
   larger treatment on top of that so the section reads as a lead-story
   showcase rather than just a variant of the regular card list below it.
   (Cards themselves keep the standard card border, not a gold one — see
   .story-card--featured.) */
.home-section--featured {
    background: var(--color-gold-dim);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.75rem 1rem;
}

.story-card--featured {
    margin-bottom: 1.5rem;
}

.story-card--featured h3 {
    font-size: 1.25rem;
}

/* Rests in a warmer, lighter gold than the plain white used by regular
   card titles — the existing ".story-card h3 a:hover" rule (higher
   specificity via :hover) still takes over on hover, so featured titles
   settle to the site's standard gold on interaction like everything
   else. */
.story-card--featured h3 a {
    color: var(--color-gold-light);
}

.story-card--featured p {
    color: var(--color-text);
    font-size: .96rem;
    line-height: 1.75;
}

/* An editorial "seal" over the thumbnail rather than a stock notification
   pill: a translucent dark chip (reads over any photo, light or dark)
   with a hairline gold rule instead of a solid fill — every other gold
   accent on this site (nav pills, active states) is a thin border + a
   faint tint, never a solid block, so a flat gold pill was the one
   element on the page breaking that restraint. Positioned .5rem inset
   from the thumbnail's own top-left corner (card padding is 1.5rem top /
   1.75rem sides — see .story-card — so top/left below land the badge
   fully on the photo, not straddling the card's padding above it). */
.story-card-badge {
    position: absolute;
    top: 2rem;
    left: 2.25rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1.05rem;
    background: rgba(8, 8, 8, .8);
    border: 1px solid var(--color-gold);
    border-radius: 2px;
    color: var(--color-gold-light);
    font-family: var(--font-sans);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .16em;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: var(--shadow-sm), 0 0 0 3px rgba(8, 8, 8, .35);
}

.story-card-badge::before {
    content: '\2726';
    color: var(--color-gold);
    font-size: .74rem;
    line-height: 1;
}

/* ===== LISTING NAV (Latest / Most Read / Editorial Selection tabs) ===== */
.listing-nav {
    margin: 1.5rem 0;
}

.listing-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.listing-nav-link {
    display: inline-flex;
    align-items: center;
    padding: .5rem 1.2rem;
    background: var(--color-surface2);
    border: 1px solid var(--color-border);
    border-radius: 30px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--color-muted);
    transition: all .2s;
}

.listing-nav-link:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
}

.listing-nav-link.active {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
}

/* ===== PAGINATION ===== */
.pagination {
    margin: 2.5rem 0 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .4rem;
}

.pagination-top {
    margin: 0 0 1.5rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 .7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--color-muted);
    transition: all .2s;
    font-family: var(--font-sans);
}

.pagination a:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
}

.pagination .current {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
    font-weight: 700;
}

/* Deliberately quieter than a heading — small, muted2 (the same tone as
   ".story-meta small"'s view-count text), no centering — so it reads as
   an incidental caption above the controls, not an announcement. */
/* A small-caps "kicker" treatment (sans, muted, wide tracking) instead of
   a plain sentence — the same typographic device the site already uses
   for secondary/meta labels (see .section-heading), just quieter: no
   serif, no gold, no bold weight-jump. The top rule + generous margin
   give it its own zone, clearly separated from the story list rather
   than sitting flush against the last card or the buttons below it —
   centered to match the pagination row it introduces, not left-hung
   against the page's own left-aligned headings/cards. */
.pagination-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 3rem 0 1.25rem;
    color: var(--color-muted2);
    font-family: var(--font-sans);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
}

/* Flanking hairlines instead of a plain top border — frames the text as
   its own small masthead-style divider (the classic printed "— page N of
   M —" treatment) rather than a line of body copy that happens to be
   small. Dropped below 480px so a long translated string (French/German
   run noticeably longer than English) never has to fight two rules for
   space on a phone-width screen — it just centers plainly there instead. */
.pagination-summary::before,
.pagination-summary::after {
    content: '';
    flex: 1 1 40px;
    height: 1px;
    background: var(--color-border);
}

@media (max-width: 480px) {
    .pagination-summary::before,
    .pagination-summary::after {
        display: none;
    }
}

/* Overrides the generic ".pagination span" box treatment above (border,
   min-width, padding) — the ellipsis is a plain gap marker between page
   numbers, not a clickable control, so it shouldn't look like one. Needs
   the extra ".pagination" ancestor in the selector to win on specificity
   against that rule. */
.pagination .pagination-ellipsis {
    border: none;
    background: none;
    min-width: auto;
    height: auto;
    padding: 0 .3rem;
}

/* ===== STORY DETAIL ===== */
.story-cover {
    width: 100%;
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
    object-fit: cover;
    max-height: 460px;
    box-shadow: var(--shadow);
}

.story-header { margin-bottom: 2rem; }
.story-header h1 { margin-bottom: .8rem; }

/* ===== CONTINUE READING (prev/next card duo) =====
   The first thing after the article text, immediately followed by
   Related Stories with no <hr> between them — together they're the
   "keep reading" zone and dominate the post-article area visually. See
   templates/story/show.html.twig for the quieter "story-footnav" utility
   panel (tags/topics/browse/internal links) that follows it.
   Chronological, wraps at both ends (StoryRepository::findAdjacentByLocale)
   so both cards are present on virtually every real page — the
   --single variant below only matters for the theoretical case of a
   locale with a single published story. */
.continue-reading {
    margin-bottom: 2.5rem;
}

.story-nav-duo {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.story-nav-duo--single {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
}

.story-nav-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color .25s, box-shadow .25s, transform .25s;
}

.story-nav-card:hover {
    border-color: var(--color-gold);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.story-nav-thumb {
    width: 100%;
    aspect-ratio: 600 / 315;
    object-fit: cover;
    display: block;
}

.story-nav-card-body {
    padding: 1rem 1.15rem 1.15rem;
    /* Keeps the title baseline aligned between the prev/next cards even
       when a thumbnail is missing on one of the two (a story with no
       cover image is rare but possible) or titles wrap to different
       line counts — the body simply grows from the top in both cases. */
    flex: 1;
}

.story-nav-eyebrow {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
    color: var(--color-muted);
    margin-bottom: .55rem;
}

/* Next is the primary, forward direction of the reading flow — a gold
   eyebrow gives it slightly more pull than prev's muted one without
   changing either card's size, keeping the pair visually balanced. */
.story-nav-card--next .story-nav-eyebrow { color: var(--color-gold); }
.story-nav-card--next { justify-content: flex-end; }

.story-nav-title {
    display: -webkit-box;
    font-family: var(--font-serif);
    color: var(--color-text);
    font-size: 1.05rem;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.story-nav-card:hover .story-nav-title { color: var(--color-gold); }

@media (max-width: 700px) {
    .story-nav-duo,
    .story-nav-duo--single {
        grid-template-columns: 1fr;
    }
}

/* ===== STORY FOOTNAV (tags / related topics / browse / internal links) =====
   Everything a crawler or a deliberate explorer needs, deliberately
   quieter than Continue Reading / Related Stories above: one contained,
   muted panel instead of four full-weight sections each with their own
   <hr> and section-heading, so it reads as reference material rather
   than competing with the "keep reading" flow for attention. */
.story-footnav {
    background: var(--color-surface2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
}

.story-footnav-heading {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--color-muted2);
    font-family: var(--font-sans);
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.story-footnav-row {
    padding-top: 1.1rem;
    margin-top: 1.1rem;
    border-top: 1px solid var(--color-border);
}

.story-footnav-row:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.story-footnav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 320px));
    gap: 1.25rem;
}

.story-footnav-group h4 {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-weight: 600;
    margin-bottom: .65rem;
}

.story-footnav .tag-pill,
.story-footnav .category-pill {
    font-size: .74rem;
    padding: .22rem .7rem;
}

.story-footnav .browse-modules { gap: 1.5rem; }
.story-footnav .browse-module-heading { font-size: .78rem; margin-bottom: .6rem; }

/* ===== ERROR PAGE (404 and friends) ===== */
.error-header {
    text-align: center;
    padding: 3rem 0 2rem;
}

.error-header h1 {
    font-size: 2.2rem;
}

.error-message {
    color: var(--color-muted);
    font-size: 1.05rem;
    max-width: 480px;
    margin: 0 auto 1.5rem;
}

.error-home-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .7rem 1.6rem;
    background: var(--color-gold);
    color: var(--color-bg);
    border-radius: var(--radius);
    font-weight: 600;
    transition: background .2s, transform .2s;
}

.error-home-cta:hover {
    background: var(--color-gold-light);
    transform: translateY(-2px);
}

.story-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .85rem;
    color: var(--color-muted);
    padding: .75rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.story-info a { color: var(--color-muted); }
.story-info a:hover { color: var(--color-gold); }

.story-content {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.9;
    color: var(--color-story-text);
}

.story-content p { margin-bottom: 1.4rem; }

/* ===== INTERNAL NAV ===== */
.internal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.internal-nav a {
    display: inline-flex;
    align-items: center;
    padding: .4rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: .85rem;
    color: var(--color-muted);
    transition: all .2s;
}

.internal-nav a:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
    background: var(--color-gold-dim);
}

/* ===== RELATED STORIES GRID ===== */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

/* ===== HUB INTRO ===== */
.hub-intro {
    background: var(--color-surface2);
    border-left: 3px solid var(--color-gold);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    margin-bottom: 2rem;
    color: var(--color-muted);
    font-size: .95rem;
    line-height: 1.7;
}

/* ===== STATIC PAGES (about/contact/privacy/cookies/editorial) ===== */
.static-content h2 {
    margin-top: 2rem;
}

.static-content p {
    line-height: 1.75;
}

.static-content ul {
    list-style: disc;
    padding-left: 1.4rem;
    margin-bottom: 1rem;
}

.static-content li {
    margin-bottom: .5rem;
    color: var(--color-text);
}

.static-content a {
    text-decoration: underline;
}

/* ===== TAG INTRO ===== */
.tag-intro {
    margin: 1.5rem 0 2rem;
    line-height: 1.75;
    color: var(--color-text);
}

.tag-intro a {
    color: var(--color-gold);
    text-decoration: underline;
}

/* ===== FAQ ===== */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.faq-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text);
}

.faq-item p {
    margin-top: .75rem;
    line-height: 1.7;
    color: var(--color-muted);
}

/* ===== QUICK ANSWER (FAQ pages) ===== */
.quick-answer-label {
    text-transform: uppercase;
    font-size: .75rem;
    letter-spacing: .05em;
    color: var(--color-gold);
    font-weight: 700;
    margin: 1.5rem 0 .5rem;
}

.quick-answer {
    background: var(--color-surface);
    border-left: 3px solid var(--color-gold);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.quick-answer p {
    line-height: 1.75;
    color: var(--color-text);
}

/* ===== STORY CARD THUMBNAIL ===== */
.story-card-thumb-link {
    display: block;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.story-card-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 600 / 315;
    object-fit: cover;
    display: block;
}

/* ===== UTILS ===== */
.text-muted { color: var(--color-muted); }
.text-gold  { color: var(--color-gold); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer-bottom { flex-direction: column; gap: .6rem; text-align: center; }
    .nav-inner { height: 56px; }
    .home-hero { padding: 2.5rem 0 2rem; }
    .related-grid { grid-template-columns: 1fr; }
    .story-card { padding: 1.25rem; }
}

/* Sub-360px phones (e.g. iPhone SE 1st gen, 320px): the theme toggle added
   next to the language switcher pushes nav-right past what the logo +
   language button alone used to leave room for. Trim gap/control size and
   the logo's footprint here rather than letting the header overflow. */
@media (max-width: 360px) {
    .nav-logo { font-size: 1.05rem; }
    .nav-right { gap: .5rem; }
    .theme-toggle-btn { width: 32px; height: 32px; }
    .theme-toggle-btn svg { width: 16px; height: 16px; }
}

/* ===== COOKIE CONSENT BANNER =====
   Fixed/overlay positioning only — never occupies space in normal
   document flow, so showing/hiding it (or swapping between the simple and
   Customize views inside it) can't shift any other content (zero CLS by
   construction, not just by care). max-height + overflow-y lets the
   Customize view scroll internally on short mobile viewports instead of
   growing the fixed box off-screen. */
.cookie-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    background: var(--color-surface2);
    border-top: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, .4);
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-consent-banner[hidden] { display: none; }

.cookie-consent-simple {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 2rem;
}
.cookie-consent-simple[hidden] { display: none; }

.cookie-consent-heading {
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 .3rem;
}

#cookie-consent-message {
    margin: 0;
    color: var(--color-muted);
    font-size: .9rem;
    max-width: 640px;
    line-height: 1.5;
}
#cookie-consent-message a { color: var(--color-gold); }

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-shrink: 0;
}

.cookie-consent-btn {
    padding: .6rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
}
.cookie-consent-btn-primary { background: var(--color-gold); color: var(--color-bg); }
.cookie-consent-btn-primary:hover { background: var(--color-gold-light); }
.cookie-consent-btn-secondary { background: transparent; color: var(--color-text); border-color: var(--color-border2); }
.cookie-consent-btn-secondary:hover { border-color: var(--color-gold); color: var(--color-gold); }

/* Tertiary action (Customize) — same tap target as the two primary
   buttons, deliberately lighter weight so Accept/Reject stay the two
   equally-prominent choices per CNIL/EDPB guidance on "reject as easy as
   accept"; Customize is an addition, not a replacement of that pair. */
.cookie-consent-btn-text {
    background: none;
    padding: .6rem .2rem;
    color: var(--color-muted);
    text-decoration: underline;
}
.cookie-consent-btn-text:hover { color: var(--color-gold); }

.cookie-consent-btn:focus-visible,
.cookie-consent-manage:focus-visible {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

.cookie-consent-manage {
    background: none;
    border: none;
    padding: 0;
    color: var(--color-gold);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}
.cookie-consent-manage:hover { color: var(--color-gold-light); }

/* ===== COOKIE CONSENT — CUSTOMIZE VIEW ===== */
.cookie-consent-detail {
    max-width: 680px;
    margin: 0 auto;
}
.cookie-consent-detail[hidden] { display: none; }

.cookie-consent-category {
    padding: .75rem 0;
    border-top: 1px solid var(--color-border);
}
.cookie-consent-category:first-of-type { border-top: none; }

.cookie-consent-category-header {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.cookie-consent-category-name {
    font-weight: 700;
    color: var(--color-text);
    font-size: .9rem;
}

.cookie-consent-category-status {
    margin-left: auto;
    font-size: .75rem;
    color: var(--color-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.cookie-consent-category-desc {
    margin: .35rem 0 0;
    color: var(--color-muted);
    font-size: .85rem;
    line-height: 1.5;
}

.cookie-consent-detail .cookie-consent-actions {
    justify-content: flex-end;
    margin-top: 1rem;
}

/* Custom toggle switch — a checkbox visually restyled as a track/thumb,
   not a plugin: keeps native keyboard/focus/AT semantics from the
   underlying <input type="checkbox">. */
.cookie-consent-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.cookie-consent-toggle input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}
.cookie-consent-toggle-track {
    position: absolute;
    inset: 0;
    background: var(--color-border2);
    border-radius: 999px;
    transition: background .2s;
    pointer-events: none;
}
.cookie-consent-toggle-track::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: var(--color-text);
    border-radius: 50%;
    transition: transform .2s;
}
.cookie-consent-toggle input:checked + .cookie-consent-toggle-track {
    background: var(--color-gold);
}
.cookie-consent-toggle input:checked + .cookie-consent-toggle-track::before {
    transform: translateX(18px);
    background: var(--color-bg);
}
.cookie-consent-toggle input:focus-visible + .cookie-consent-toggle-track {
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .cookie-consent-simple {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-consent-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-consent-btn { flex: 1; }
    .cookie-consent-btn-text { text-align: center; }
}
