/* ============================================================
   Orderly Panic — Dark Bold theme
   Near-black surfaces, red accent, white type. Light toggle.
   ============================================================ */

/* ---- Self-hosted fonts (no external font CDN at runtime) ---- */
@font-face {
    font-family: 'Titan One';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/titan-one-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/rubik-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/rubik-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/rubik-800.woff2') format('woff2');
}

/* ---- Theme tokens ---- */
:root {
    --bg:#141414; --surface:#1f1f1f; --border:#2c2c2c;
    --text:#fff; --text-muted:#8a8a8a; --accent:#f40000; --accent-soft:#ff5a5a;

    --hero-gradient: linear-gradient(135deg, #f40000, #a30000);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.25);
    --maxw: 1140px;
    --font-body: 'Rubik', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-display: 'Titan One', var(--font-body);
    --ease: cubic-bezier(.2,.7,.3,1);
}
[data-theme="light"] {
    --bg:#f6f4ef; --surface:#fff; --border:#e2ded6;
    --text:#141414; --text-muted:#6a6a6a;
    --shadow: 0 1px 2px rgba(20,20,20,.06), 0 8px 24px rgba(20,20,20,.08);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transition: background-color .25s var(--ease), color .25s var(--ease);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.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;
}

:focus-visible {
    outline: 2px solid var(--accent-soft);
    outline-offset: 2px;
    border-radius: 4px;
}

.page-wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- Wordmark ---- */
.wordmark {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: .2px;
    color: var(--text);
    line-height: 1;
    white-space: nowrap;
}
.wordmark__accent { color: var(--accent); }
.wordmark--large { font-size: 1.4rem; }
.wordmark--small { font-size: 1rem; }

/* ---- Header ---- */
.site-header {
    background: var(--surface);
    border-bottom: 2px solid var(--accent);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.site-brand__badge {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    display: block;
}
.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}
.site-nav__link {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 99px;
    border-bottom: 2px solid transparent;
    transition: color .18s var(--ease), background-color .18s var(--ease);
}
.site-nav__link:hover { color: var(--text); }
.site-nav__link.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
    border-radius: 0;
}
.site-nav__link--featured { color: var(--accent-soft); }
.site-nav__link--featured:hover { color: var(--accent); }
.site-header__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.site-search {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 6px 12px;
    max-width: 210px;
}
.site-search__icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.site-search input {
    border: 0; background: transparent; color: var(--text);
    font: inherit; font-size: .85rem; width: 100%; outline: none;
}
.site-search input::placeholder { color: var(--text-muted); }

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent-soft); color: var(--accent-soft); }
.theme-toggle:active { transform: scale(.94); }
.theme-toggle__icon { width: 18px; height: 18px; }
.theme-toggle__icon--moon { display: none; }
.theme-toggle__icon--sun { display: block; }
[data-theme="light"] .theme-toggle__icon--moon { display: block; }
[data-theme="light"] .theme-toggle__icon--sun { display: none; }

/* Hamburger (mobile only) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px; height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    cursor: pointer;
    padding: 0 9px;
}
.hamburger span { height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s var(--ease); }
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0,0,0,.6);
    backdrop-filter: blur(2px);
}
.mobile-menu-overlay.is-open { display: block; }
.mobile-menu {
    position: absolute;
    top: 0; right: 0;
    height: 100%;
    width: min(78vw, 320px);
    background: var(--surface);
    border-left: 2px solid var(--accent);
    padding: 72px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mobile-menu a {
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
}
.mobile-menu__search {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 8px 14px;
}
.mobile-menu__search svg { width: 16px; height: 16px; color: var(--text-muted); }
.mobile-menu__search input { border: 0; background: transparent; color: var(--text); font: inherit; width: 100%; outline: none; }

/* ---- Home layout ---- */
.home { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 48px; }

/* Platform chips */
.platform-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 22px;
}
.platform-chip {
    font-size: .78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 99px;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.platform-chip:hover { color: var(--text); border-color: var(--accent-soft); }
.platform-chip--active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ---- Hero ---- */
.hero-card {
    background: var(--hero-gradient);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 34px;
    box-shadow: var(--shadow);
}
.hero-card__link {
    display: grid;
    grid-template-columns: 1fr;
    color: #fff;
}
.hero-card--has-media .hero-card__link {
    grid-template-columns: 1.1fr .9fr;
    align-items: stretch;
}
.hero-card__body { padding: 32px 34px; align-self: center; }
.hero-card__tag {
    display: inline-block;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: #141414;
    color: #fff;
    padding: 4px 12px;
    border-radius: 99px;
    margin-bottom: 14px;
}
.hero-card__category {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #ffd7d7;
    margin: 0 0 6px;
}
.hero-card__title {
    font-size: clamp(1.6rem, 3.4vw, 2.5rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
}
.hero-card__deck {
    font-size: 1.02rem;
    color: #ffe3e3;
    margin: 0 0 16px;
    max-width: 46ch;
}
.hero-card__meta { font-size: .82rem; color: #ffc9c9; margin: 0; font-weight: 600; }
.hero-card__media { position: relative; min-height: 220px; }
.hero-card__media img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.hero-card:hover .hero-card__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---- Section heads ---- */
.section { margin-top: 38px; }
.section-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.section-head__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.35rem;
    margin: 0;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .01em;
}
.section-head__rule {
    flex: 1;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
}
.section-head__more {
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent-soft);
    white-space: nowrap;
}
.section-head__more:hover { color: var(--accent); }

/* ---- Story grid ---- */
.story-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.article-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.article-card__link { display: block; color: inherit; }
.article-card__image { aspect-ratio: 16 / 9; background: var(--bg); overflow: hidden; }
.article-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.article-card:hover .article-card__image img { transform: scale(1.04); }
.article-card__body { padding: 14px 16px 16px; }
.article-card__category {
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--accent-soft);
    margin: 0 0 5px;
}
.article-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 6px;
}
.article-card__deck { font-size: .88rem; color: var(--text-muted); margin: 0 0 6px; }
.article-card__meta { font-size: .76rem; color: var(--text-muted); margin: 0; }
.article-card--medium .article-card__title { font-size: 1.12rem; }

/* ---- Pagination ---- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 28px;
}
.pagination a, .pagination span {
    min-width: 38px;
    padding: 8px 12px;
    text-align: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
}
.pagination a:hover { border-color: var(--accent-soft); color: var(--accent-soft); }
.pagination span.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Footer ---- */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 56px;
}
.site-footer__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 40px 20px 28px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 32px;
}
.site-footer__disclaimer { font-size: .82rem; color: var(--text-muted); margin: 14px 0 0; max-width: 52ch; }
.site-footer__nav { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.site-footer__links, .site-footer__legal { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer__links a, .site-footer__legal a { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.site-footer__links a:hover, .site-footer__legal a:hover { color: var(--accent-soft); }
.site-footer__legal a { font-size: .78rem; font-weight: 400; }
.site-footer__bottom {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
    text-align: center;
}
.site-footer__copyright { font-size: .78rem; color: var(--text-muted); margin: 0; max-width: var(--maxw); margin-inline: auto; }

/* ============================================================
   Public views: category, search, article, static page, 404.
   Display font (Titan One) stays reserved for the wordmark and
   home section heads — page titles use heavy Rubik.
   ============================================================ */

/* Shared buttons */
.btn {
    display: inline-block;
    font-family: var(--font-body);
    font-size: .85rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 99px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.btn--primary:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: #fff; }
.btn.btn--secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.btn--secondary:hover { border-color: var(--accent-soft); color: var(--accent-soft); }

/* Platform badges (article header + cards) */
.platform-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.platform-badges--sm { margin: 6px 0 8px; }
.platform-badge {
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--accent);
    color: #fff;
}

/* ---- Category / search headers ---- */
.category-header, .search-header { padding: 30px 0 16px; }
.category-header__title, .search-header h1, .legal-page h1 {
    font-weight: 800;
    font-size: clamp(1.7rem, 4.5vw, 2.6rem);
    letter-spacing: -.02em;
    color: var(--text);
}
.category-header__subtitle { font-size: .9rem; color: var(--text-muted); margin: 6px 0 0; }
.category-header__subtitle a { color: var(--accent-soft); }
.category-header__subtitle a:hover { color: var(--accent); }
.search-header__query { color: var(--accent-soft); }
.search-header__count { font-size: .9rem; color: var(--text-muted); margin: 6px 0 0; }

/* Subcategory nav (pill row + mobile select) */
.category-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.category-nav__item {
    font-size: .8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 99px;
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: color .18s var(--ease), border-color .18s var(--ease), background-color .18s var(--ease);
}
.category-nav__item:hover { color: var(--text); border-color: var(--accent-soft); }
.category-nav__item.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.category-nav-mobile { display: none; margin-bottom: 24px; }
.category-nav-mobile__select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    font: inherit;
}

/* Search bar */
.search-form { margin-bottom: 30px; }
.search-bar { display: flex; gap: 8px; max-width: 520px; }
.search-bar input {
    flex: 1;
    padding: 11px 16px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    outline: none;
}
.search-bar input:focus-visible { border-color: var(--accent-soft); }

/* ---- Empty state / 404 ---- */
.empty-state { text-align: center; padding: 60px 20px 70px; }
.empty-state h2 { font-weight: 800; font-size: 1.6rem; margin: 0 0 8px; }
.empty-state p { color: var(--text-muted); max-width: 46ch; margin: 0 auto; }
.empty-state__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }

.error-page { text-align: center; padding: 80px 20px 92px; }
.error-page__code {
    font-family: var(--font-display);
    font-weight: 400;
    color: var(--accent);
    font-size: clamp(3rem, 12vw, 6rem);
    line-height: 1;
    margin: 0 0 6px;
}
.error-page__title {
    font-family: var(--font-display);
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    margin: 0 0 14px;
}
.error-page__text { color: var(--text-muted); max-width: 42ch; margin: 0 auto 26px; }

/* ---- Article page ---- */
.article-update-banner {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 20px 0 0;
    font-size: .9rem;
    font-weight: 600;
}
.article-update-banner a { color: var(--accent-soft); }
.article-update-banner a:hover { color: var(--accent); }

.article-header { padding: 34px 0 18px; }
.article-header__category {
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0 0 12px;
}
.article-header__category a { color: var(--accent-soft); }
.article-header__category a:hover { color: var(--accent); }
.article-header__title {
    font-weight: 800;
    font-size: clamp(1.9rem, 5vw, 3rem);
    letter-spacing: -.02em;
    margin: 0 0 14px;
    color: var(--text);
}
.article-header__deck { font-size: 1.15rem; color: var(--text-muted); margin: 0 0 16px; max-width: 60ch; }
.article-header__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: .84rem;
    color: var(--text-muted);
}
.article-header__author-name { color: var(--text); font-weight: 600; }
.article-header__meta a { color: var(--accent-soft); }
.article-header__meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); display: inline-block; }

.article-hero { margin: 24px 0 4px; }
.article-hero img { width: 100%; border-radius: var(--radius); }
.article-hero__caption { font-size: .8rem; color: var(--text-muted); margin-top: 8px; }

.article-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
    padding: 28px 0 8px;
}
.article-body { min-width: 0; font-size: 1.06rem; line-height: 1.7; color: var(--text); }
.article-body h2 { font-size: 1.5rem; font-weight: 800; margin: 1.6em 0 .5em; }
.article-body h3 { font-size: 1.2rem; font-weight: 700; margin: 1.4em 0 .5em; }
.article-body p { margin: 0 0 1.1em; }
.article-body a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }
.article-body a:hover { color: var(--accent); }
.article-body ul, .article-body ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.article-body li { margin-bottom: .4em; }
.article-body img { border-radius: var(--radius); margin: 20px 0; }
.article-body blockquote {
    margin: 1.4em 0;
    padding: 2px 0 2px 18px;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
    font-style: italic;
}

/* Sources block — plain ordered list, decimal markers */
.sources { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--border); }
.sources__heading {
    font-size: 1.05rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 12px;
}
.sources__list { margin: 0; padding-left: 1.5em; }
.sources__item { margin-bottom: 8px; font-size: .94rem; }
.sources__item::marker { color: var(--accent-soft); font-weight: 700; }
.sources__item a { color: var(--accent-soft); word-break: break-word; }
.sources__item a:hover { color: var(--accent); text-decoration: underline; }

/* Comments */
.article-comments { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border); }
.article-comments__heading { font-size: 1.15rem; font-weight: 800; margin: 0 0 18px; }
.comment { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment__author { font-size: .82rem; font-weight: 700; color: var(--text-muted); margin: 0 0 4px; }
.comment__body { margin: 0; color: var(--text); }

.form-message { padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; margin: 16px 0; }
.form-message--ok { background: rgba(52,168,83,.14); color: #45b45f; border: 1px solid rgba(52,168,83,.3); }
.form-message--error { background: rgba(244,0,0,.12); color: var(--accent-soft); border: 1px solid rgba(244,0,0,.3); }

.comment-form { margin-top: 24px; max-width: 560px; }
.comment-form__heading { font-size: 1rem; font-weight: 800; margin: 0 0 12px; }
.comment-form input[type="text"], .comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font: inherit;
    outline: none;
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form input:focus-visible, .comment-form textarea:focus-visible { border-color: var(--accent-soft); }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Article sidebar */
.article-sidebar { min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.sidebar-widget__heading {
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
}
.article-related__item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.article-related__item:last-child { border-bottom: 0; }
.article-related__category {
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent-soft);
    margin: 0 0 4px;
}
.article-related__title { font-size: .95rem; font-weight: 700; margin: 0; }
.article-related__title a { color: var(--text); }
.article-related__title a:hover { color: var(--accent-soft); }
.article-share__buttons { display: flex; gap: 8px; }
.article-share__button {
    font-size: .8rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: color .18s var(--ease), border-color .18s var(--ease);
}
.article-share__button:hover { border-color: var(--accent-soft); color: var(--accent-soft); }
.sidebar-topics__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-topics__chip {
    font-size: .78rem;
    padding: 5px 12px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.sidebar-topics__chip:hover { color: var(--accent-soft); border-color: var(--accent-soft); }

/* ---- Static (legal / about) page ---- */
.legal-page { max-width: 72ch; padding: 22px 0; font-size: 1.02rem; line-height: 1.7; color: var(--text); }
.legal-page h2 { font-size: 1.35rem; font-weight: 800; margin: 1.6em 0 .5em; }
.legal-page h3 { font-size: 1.1rem; font-weight: 700; margin: 1.4em 0 .4em; }
.legal-page p { margin: 0 0 1.05em; }
.legal-page ul, .legal-page ol { margin: 0 0 1.05em; padding-left: 1.4em; }
.legal-page li { margin-bottom: .35em; }
.legal-page a { color: var(--accent-soft); text-decoration: underline; text-underline-offset: 2px; }
.legal-page a:hover { color: var(--accent); }
.legal-page em { color: var(--text-muted); }
.legal-page hr { border: 0; border-top: 1px solid var(--border); margin: 1.8em 0; }
.legal-page img { border-radius: var(--radius); margin: 20px 0; }
.legal-page code { background: var(--surface); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .94rem; }
.legal-page th, .legal-page td { text-align: left; padding: 8px 12px; border: 1px solid var(--border); }
.legal-page th { background: var(--surface); font-weight: 700; }

.ad-slot { margin: 16px auto; text-align: center; }

/* ---- Videos (rail + grid + lite embeds) ---- */
.video-rail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.video-embed {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.video-embed:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: var(--shadow);
}
.video-embed__trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--bg);
    cursor: pointer;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.video-embed__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s var(--ease);
}
.video-embed:hover .video-embed__thumb { transform: scale(1.04); }
.video-embed__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 58px;
    height: 58px;
    transform: translate(-50%, -50%);
    border-radius: 99px;
    background: var(--accent);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
    transition: transform .18s var(--ease), background .18s var(--ease);
}
.video-embed__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent #fff;
}
.video-embed__trigger:hover .video-embed__play,
.video-embed__trigger:focus-visible .video-embed__play {
    transform: translate(-50%, -50%) scale(1.08);
    background: var(--accent-soft);
}
.video-embed__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 99px;
    background: var(--accent);
    color: #fff;
    font-size: .62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.video-embed__iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}
.video-embed__meta { padding: 12px 14px 14px; }
.video-embed__title {
    margin: 0;
    font-weight: 700;
    font-size: .95rem;
    line-height: 1.3;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-embed__channel {
    margin: 5px 0 0;
    font-size: .74rem;
    color: var(--text-muted);
}

/* ---- Responsive (public views) ---- */
@media (max-width: 900px) {
    .article-page { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 680px) {
    .category-nav { display: none; }
    .category-nav-mobile { display: block; }
    .article-share__buttons { flex-wrap: wrap; }
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .story-grid { grid-template-columns: repeat(2, 1fr); }
    .video-rail, .video-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-card--has-media .hero-card__link { grid-template-columns: 1fr; }
    .hero-card__media { min-height: 200px; order: -1; }
    .site-footer__inner { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 680px) {
    .site-nav { display: none; }
    .site-search { display: none; }
    .hamburger { display: flex; }
    .story-grid { grid-template-columns: 1fr; }
    .video-rail, .video-grid { grid-template-columns: 1fr; }
    .hero-card__body { padding: 24px 22px; }
    .site-header__inner { gap: 12px; }
}

/* ---- Article image gallery + lightbox ---- */
.article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 28px 0;
}
.article-gallery__thumb {
    padding: 0;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.article-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.article-gallery__thumb:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.article-gallery__thumb:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .88);
    animation: lightbox-in .2s var(--ease);
}
.lightbox[hidden] { display: none; }
body.lightbox-open { overflow: hidden; }
@keyframes lightbox-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox__figure {
    margin: 0;
    max-width: min(92vw, 1100px);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.lightbox__image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.lightbox__caption {
    color: #fff;
    font-size: .9rem;
    text-align: center;
    max-width: 80ch;
}
.lightbox__caption[hidden] { display: none; }

.lightbox__close,
.lightbox__nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(0, 0, 0, .5);
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background .18s var(--ease), border-color .18s var(--ease);
}
.lightbox__close:hover,
.lightbox__nav:hover { background: var(--accent); border-color: var(--accent); }
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.lightbox__close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 1.6rem;
    line-height: 1;
}
.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 2rem;
    line-height: 1;
}
.lightbox__nav[hidden] { display: none; }
.lightbox__nav--prev { left: 20px; }
.lightbox__nav--next { right: 20px; }

@media (max-width: 640px) {
    .lightbox__nav { width: 40px; height: 40px; font-size: 1.6rem; }
    .lightbox__close { width: 40px; height: 40px; }
}

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