/* ── Reset & tokens ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Dark theme (default) ──────────────────────────────────────────────────── */
:root {
  --bg:            #060504;
  --bg-2:          #0f0d09;
  --bg-3:          #181410;
  --bg-4:          #201c17;
  --border:        rgba(234,231,225,.07);
  --border-2:      rgba(234,231,225,.13);
  --text:          #eae7e1;
  --text-muted:    #9a9388;
  --text-dim:      #8f8071;
  --accent:        #7ea583;
  --accent-dim:    rgba(126,165,131,.12);
  --accent-border: rgba(126,165,131,.28);
  --primary:       #c2b8a8;
  --secondary:     #465b3e;
  --sidebar-w:     260px;
  --radius:        8px;
  --ease:          cubic-bezier(.4,0,.2,1);
}

/* Light theme ───────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:            #fbfaf9;
  --bg-2:          #f0ece4;
  --bg-3:          #e6e1d8;
  --bg-4:          #d9d3c8;
  --border:        rgba(30,27,21,.09);
  --border-2:      rgba(30,27,21,.18);
  --text:          #1e1b15;
  --text-muted:    #5c5549;
  --text-dim:      #5c4e3f;
  --accent:        #3e6944;
  --accent-dim:    rgba(62,105,68,.1);
  --accent-border: rgba(62,105,68,.3);
  --primary:       #574d3d;
  --secondary:     #acc1a4;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100%;
}

/* ── Skip link ──────────────────────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: var(--accent);
  color: #000;
  font-weight: 600;
  font-size: .875rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top .15s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ── Layout shell ───────────────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--bg-4) transparent;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  display: block;
  text-decoration: none;
  line-height: 1;
}
.logo-text {
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
}
.logo-text em {
  font-style: normal;
  color: var(--accent);
}

/* ── Sidebar nav ────────────────────────────────────────────────────────── */
.sidebar-nav { padding: .5rem 0 1rem; }

.nav-list { list-style: none; }

/* Shared row height — every interactive nav item is exactly this tall */
.nav-link,
.nav-group-toggle {
  height: 36px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  margin: 1px .5rem;
  font-family: inherit;
  font-size: .825rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s, background .15s;
  text-decoration: none;
}

/* nav-link extras */
.nav-link {
  padding: 0 .75rem;
  gap: .5rem;
  color: var(--text-muted);
}
.nav-link:hover  { color: var(--text); background: var(--bg-3); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--accent-dim); font-weight: 600; }

/* nav-group-toggle extras */
.nav-group-toggle {
  width: calc(100% - 1rem);
  padding: 0 .75rem;
  gap: .5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}
.nav-group-toggle:hover              { color: var(--text); background: var(--bg-3); }
.nav-group-toggle[aria-expanded="true"] { color: var(--text); }
.nav-group-toggle span               { flex: 1; }

/* Section-level toggle — same height, icon accent, slightly bolder */
.nav-group-toggle--section {
  font-weight: 600;
  margin-top: .35rem;
}
.nav-group-toggle--section .nav-icon,
.nav-link .nav-icon {
  font-size: 1rem;
  color: var(--accent);
  opacity: .85;
  flex-shrink: 0;
}
.nav-group-toggle--section:hover .nav-icon,
.nav-link:hover .nav-icon { opacity: 1; }

/* Sub-level toggle — indented, slightly smaller, dimmer */
.nav-group-toggle--sub {
  height: 32px;
  padding-left: 1.75rem;
  font-size: .8rem;
  color: var(--text-dim);
}
.nav-group-toggle--sub:hover              { color: var(--text); }
.nav-group-toggle--sub[aria-expanded="true"] { color: var(--text-muted); }

/* Leaf links — match sub-toggle height and indent */
.nav-link--leaf {
  height: 32px;
  padding-left: 1.75rem;
  font-size: .8rem;
  color: var(--text-dim);
}
.nav-link--leaf:hover  { color: var(--text); }
.nav-link--leaf.active { color: var(--accent); background: none; font-weight: 500; }

.nav-year { display: none; }
.nav-link--leaf:hover .nav-year,
.nav-link--leaf.active .nav-year { color: inherit; opacity: .6; }

/* Leaf link list */
.nav-leaf-list { list-style: none; padding: .1rem 0 .25rem; }

/* Level-1: subtle line for section content (eras/categories under a section) */
.nav-section-item > .nav-sub {
  border-left: 2px solid transparent;
  margin-left: .5rem;
  transition: border-color .25s var(--ease), grid-template-rows .3s var(--ease);
}
.nav-section-item > .nav-sub.is-open {
  border-left-color: rgba(126,165,131,.2);
}

/* Level-2: stronger line for item groups (individual entries under a category) */
.nav-sub .nav-sub {
  border-left: 2px solid transparent;
  margin-left: 1.5rem;
  transition: border-color .25s var(--ease), grid-template-rows .3s var(--ease);
}
/* padding inside the grid item so it's hidden when collapsed */
.nav-sub .nav-sub > ul { padding-bottom: .25rem; }
.nav-sub .nav-sub.is-open {
  border-left-color: rgba(126,165,131,.55);
}
.nav-sub .nav-sub .nav-link--leaf {
  padding-left: .75rem;
}

/* Chevron */
.chevron {
  flex-shrink: 0;
  opacity: .5;
  transition: transform .25s var(--ease), opacity .15s;
}
.nav-group-toggle:hover .chevron { opacity: .8; }
.nav-group-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Collapsible panels — grid-rows approach: animates to exact content height */
.nav-sub {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows .3s var(--ease);
}
.nav-sub > ul {
  min-height: 0;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.nav-sub.is-open { grid-template-rows: 1fr; }
.nav-sub.is-open > ul {
  opacity: 1;
  transform: none;
  transition-delay: .05s;
}
.nav-sub ul { list-style: none; }

/* ── Mobile navigation (.main-navigation) ────────────────────────────────── */
.main-navigation {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1rem 0;
}
.main-navigation-inner { display: flex; flex-direction: column; }

.main-navigation .close-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: .5rem 1rem;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: color .15s var(--ease);
}
.main-navigation .close-menu:hover { color: var(--text); }

.main-navigation .menu-item { border-bottom: 1px solid var(--border); }
.main-navigation .menu-item > a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .8rem 1.25rem;
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.main-navigation .menu-item > a:hover { color: var(--text); background: var(--bg-3); }
.main-navigation .menu-item > a i { color: var(--accent); font-size: 1rem; }

/* Submenu panel — grid-rows animation */
.main-navigation .submenu {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  border-left: 2px solid transparent;
  margin-left: .75rem;
  transition: grid-template-rows .3s var(--ease), border-color .25s var(--ease);
}
.main-navigation .submenu.is-open {
  grid-template-rows: 1fr;
  border-left-color: rgba(126,165,131,.2);
}
.main-navigation .submenu-inner {
  min-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.main-navigation .submenu.is-open .submenu-inner {
  opacity: 1;
  transform: none;
  transition-delay: .05s;
}

.main-navigation .submenu-item > a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.5rem;
  color: var(--text-dim);
  font-size: .835rem;
  text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease);
  cursor: pointer;
}
.main-navigation .submenu-item > a:hover { color: var(--text); background: var(--bg-3); }

/* Sub-links panel — grid-rows animation */
.main-navigation .sub-links {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  border-left: 2px solid transparent;
  margin-left: .5rem;
  transition: grid-template-rows .25s var(--ease), border-color .25s var(--ease);
}
.main-navigation .sub-links.is-open {
  grid-template-rows: 1fr;
  border-left-color: rgba(126,165,131,.55);
}
.main-navigation .sub-links-inner {
  min-height: 0;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.main-navigation .sub-links.is-open .sub-links-inner {
  opacity: 1;
  transform: none;
  transition-delay: .04s;
}
.main-navigation .sub-links-inner a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.75rem;
  color: var(--text-dim);
  font-size: .815rem;
  text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.main-navigation .sub-links-inner a:hover { color: var(--text); background: var(--bg-3); }

/* ── Smooth theme switching ──────────────────────────────────────────────── */
/* The .theme-switching class is added briefly by JS on toggle, so the broad
   * transition only fires during an intentional theme change — not on every
   hover, focus, or layout shift. Covers bg, text, borders, SVG fills. */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition:
    background-color 0.35s ease,
    color            0.35s ease,
    border-color     0.35s ease,
    box-shadow       0.35s ease,
    fill             0.35s ease,
    stroke           0.35s ease !important;
  transition-delay: 0s !important;
}

/* ── Overlay ────────────────────────────────────────────────────────────── */
/* Always in DOM but invisible and non-interactive until sidebar opens */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;           /* ← never block clicks when inactive */
  transition: opacity .3s var(--ease);
}
.overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Mobile header ──────────────────────────────────────────────────────── */
.mobile-header {
  display: none;
}

.mobile-logo {
  font-size: .875rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.01em;
}
.mobile-logo em {
  font-style: normal;
  color: var(--accent);
}

/* ── Hamburger — floating bottom-right FAB on mobile ────────────────────── */
.nav-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover  { background: var(--bg-3); }
.nav-toggle:active { transform: scale(.95); }

/* ── Main content ───────────────────────────────────────────────────────── */
.page-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 2.5rem 2.5rem 5rem;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
}

/* ── Typography ─────────────────────────────────────────────────────────── */
h1 { font-size: 1.875rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
h2 { font-size: 1.4rem;   font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
h3 { font-size: 1.05rem;  font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
p  { line-height: 1.7; }
a  { color: var(--accent); }
a:hover { text-decoration: underline; }

/* ── Home ───────────────────────────────────────────────────────────────── */
.home-hero {
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  position: relative;
}
.home-hero::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 3rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.home-hero h1 { margin-bottom: .6rem; }
.home-hero p  { color: var(--text-muted); font-size: 1rem; max-width: 52ch; }

/* ── Random image section ────────────────────────────────────────────────── */
.screenshot-section,
.random-image-section { margin-top: 0; }

/* ── Random image card ───────────────────────────────────────────────────── */
.random-shot {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.random-shot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 200px;
  color: var(--text-dim);
  font-size: .9rem;
}
.random-shot-placeholder i { font-size: 2rem; }

/* Now a <button> — clicking the image opens the mini lightbox */
.random-shot-img-wrap {
  display: block;
  width: 100%;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.random-shot-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: opacity .3s var(--ease);
}
.random-shot-img:not([src]) { opacity: 0; }

/* Expand icon — appears on hover */
.random-shot-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  opacity: 0;
  transition: opacity .2s var(--ease);
  pointer-events: none;
}
.random-shot-img-wrap:hover .random-shot-zoom,
.random-shot-img-wrap:focus-visible .random-shot-zoom { opacity: 1; }

.random-shot-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem 1rem;
  border-top: 1px solid var(--border);
}
.random-shot-game {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .83rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.random-shot-game:hover { color: var(--accent); text-decoration: none; }
.random-shot-view {
  font-size: .78rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.random-shot-view:hover { text-decoration: underline; }


/* ── News ────────────────────────────────────────────────────────────────── */
.news-section { margin-top: 2.5rem; }

.news-list { display: flex; flex-direction: column; gap: 1rem; }

.news-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  transition: border-color .2s, border-left-color .2s, background .2s;
}
.news-item:hover {
  border-color: var(--border-2);
  border-left-color: var(--accent);
  background: var(--bg-3);
}

.news-item-meta {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: .6rem;
}

.news-item-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: .55rem;
}
.news-item-title a { color: var(--text); text-decoration: none; }
.news-item-title a:hover { color: var(--accent); }

.news-item-excerpt {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: .85rem;
}

.news-read-more {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: gap .15s;
}
.news-read-more:hover { gap: .5rem; text-decoration: none; }

/* ── Post page ───────────────────────────────────────────────────────────── */
.post-page { max-width: 720px; }
.post-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.post-meta {
  font-size: .75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .5rem;
}
.post-lead { font-size: 1.05rem; color: var(--text-muted); margin-top: .75rem; line-height: 1.6; }
.post-body { line-height: 1.75; }
.post-body p  { margin-bottom: 1rem; }
.post-body h2 { margin: 2rem 0 .75rem; }
.post-body h3 { margin: 1.75rem 0 .6rem; }
.post-body ul, .post-body ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.post-body li { margin-bottom: .35rem; }

/* ── Post source callout ─────────────────────────────────────────────────── */
.post-source-callout {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}
.post-source-callout-inner {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.post-source-callout-label {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.post-source-callout-link {
  font-size: .95rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity .15s;
}
.post-source-callout-link:hover { opacity: .8; text-decoration: underline; }

/* ── Section titles ─────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.subsection-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
  color: var(--text-muted);
  margin: 2.25rem 0 1rem;
}

/* ── Theme toggle & sidebar actions ─────────────────────────────────────── */
.sidebar-actions {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-shrink: 0;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .95rem;
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); background: var(--bg-3); border-color: var(--border-2); }

/* ── Jump nav ────────────────────────────────────────────────────────────── */
.jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2.5rem;
}
.jump-nav a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.jump-nav a i { font-size: 1rem; }
.jump-nav a:hover {
  color: var(--text);
  background: var(--bg-3);
  border-color: var(--border-2);
  text-decoration: none;
}

/* ── Game page header ───────────────────────────────────────────────────── */
.game-page-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

/* Cover placeholder — shown when no cover_image is set */
.game-cover-ph {
  width: 120px;
  flex-shrink: 0;
  aspect-ratio: 2/3;
}

/* Clickable cover button */
.game-cover-btn {
  position: relative;
  display: block;
  width: 120px;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: zoom-in;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
  -webkit-tap-highlight-color: transparent;
}
.game-cover-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  transition: opacity .2s;
}
.game-cover-btn .game-cover-img { border-radius: 0; }
.game-cover-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.5);
  color: #fff;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.game-cover-btn:hover .game-cover-zoom,
.game-cover-btn:focus-visible .game-cover-zoom { opacity: 1; }
.game-page-title { flex: 1; min-width: 0; }
.game-meta {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .4rem;
}
.game-page-title h1 { margin-bottom: .25rem; }

/* ── Game sections ──────────────────────────────────────────────────────── */
.game-section { margin-bottom: 3.5rem; }
.game-body { font-size: .9rem; }
.game-body p + p { margin-top: .6rem; }

/* Collapsible section toggle button */
.game-section--collapsible { margin-bottom: 0; border-bottom: 1px solid var(--border); }
.game-section--collapsible:first-of-type,
.game-section--collapsible + .game-section--collapsible { }
#achievements + .game-section--collapsible,
#achievements { }
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.1rem 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
  color: inherit;
}
.section-toggle:hover .section-title { color: var(--text); }
.section-toggle .section-title {
  margin-bottom: 0;
  font-size: 1.15rem;
  color: var(--text-muted);
  transition: color .15s var(--ease);
}
.section-toggle[aria-expanded="true"] .section-title { color: var(--text); }
.section-chevron {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform .25s var(--ease);
}
.section-toggle[aria-expanded="true"] .section-chevron { transform: rotate(180deg); }

/* Panel animation */
.section-panel {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows .3s var(--ease);
}
.section-panel.is-open { grid-template-rows: 1fr; }
.section-panel-inner {
  min-height: 0;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.section-panel.is-open .section-panel-inner {
  opacity: 1;
  transform: none;
  transition-delay: .05s;
  padding-bottom: 2rem;
}

/* ── Gallery sub-sections ────────────────────────────────────────────────── */
.gallery-sub {
  border-top: 1px solid var(--border);
}
.gallery-sub:first-child { border-top: none; }
.gallery-sub-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  gap: .6rem;
  padding: .7rem 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.gallery-sub-toggle:hover .gallery-sub-title { color: var(--accent); }
.gallery-sub-title {
  flex: 1;
  font-size: .88rem;
  font-weight: 600;
  transition: color .15s;
}
.gallery-sub-count {
  font-size: .72rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.gallery-sub-chevron {
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform .2s var(--ease);
}
.gallery-sub-toggle[aria-expanded="true"] .gallery-sub-chevron { transform: rotate(180deg); }
.gallery-sub-panel {
  display: grid;
  grid-template-rows: 0fr;
  overflow: hidden;
  transition: grid-template-rows .3s var(--ease);
}
.gallery-sub-panel.is-open { grid-template-rows: 1fr; }
.gallery-sub-panel-inner {
  min-height: 0;
  overflow: hidden;
}
.gallery-sub-panel.is-open .gallery-sub-panel-inner { padding-bottom: 1rem; }

/* Wallpaper grid — wider aspect ratio cards */
.gallery-grid--wallpapers .gallery-thumb {
  aspect-ratio: 16/9;
}
.gallery-thumb-dl {
  position: absolute;
  bottom: .4rem;
  right: .4rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  border-radius: 4px;
  padding: .2rem .4rem;
  font-size: .75rem;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.gallery-thumb:hover .gallery-thumb-dl,
.gallery-thumb:focus-visible .gallery-thumb-dl { opacity: 1; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 640px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat { background: var(--bg-2); padding: .8rem 1rem; }
.stat dt {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .25rem;
}
.stat dt i { font-size: .85rem; flex-shrink: 0; }
.stat dd { font-size: .875rem; color: var(--text); }
.tab-panel > * + * { margin-top: 1.75rem; }

/* ── Game body ──────────────────────────────────────────────────────────── */
.game-body { font-size: .9rem; }
.game-body p + p { margin-top: .6rem; }

/* ── Cheats ─────────────────────────────────────────────────────────────── */
.cheat-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.cheat-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
}
.cheat-name { font-size: .875rem; font-weight: 500; flex: 1; min-width: 140px; }
.cheat-code {
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: .775rem;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: .15rem .55rem;
  color: var(--accent);
}
.cheat-steps {
  width: 100%;
  padding-left: 1.25rem;
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .2rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

/* ── Achievements ───────────────────────────────────────────────────────── */
.ach-list { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.ach-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .2rem .75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .7rem 1rem;
}
.ach-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  padding-top: .1rem;
}
.ach-name { font-size: .85rem; font-weight: 500; }
.ach-desc { font-size: .78rem; color: var(--text-muted); }
.ach-score {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 4px;
  padding: .15rem .45rem;
  align-self: start;
  justify-self: center;
  white-space: nowrap;
}
.ach-score-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
}

/* ── Gallery ────────────────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
}
.gallery-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg-3);
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s var(--ease);
  will-change: transform;
  pointer-events: none;         /* prevent drag behaviour on images */
}
.gallery-thumb:hover img    { transform: scale(1.06); }
.gallery-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Lightbox ───────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.93);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s var(--ease), visibility .22s;
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lb-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 8rem);
  max-height: 90vh;
  padding: 0 .5rem;
}
.lb-img-wrap img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 32px 80px rgba(0,0,0,.7);
  transition: opacity .15s;
}

.lb-btn {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,.60);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.6);
  transition: background .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover { background: rgba(0,0,0,.80); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev  { left: .75rem;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: .75rem; top: 50%; transform: translateY(-50%); }
.lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.lb-next:hover { transform: translateY(-50%) translateX(2px); }
.lb-btn:disabled { opacity: .25; pointer-events: none; }

.lb-counter {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: .75rem;
  color: rgba(255,255,255,.4);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ── Videos ─────────────────────────────────────────────────────────────── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.video-embed {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-3);
  border-radius: var(--radius);
  overflow: hidden;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-title { font-size: .82rem; color: var(--text-muted); margin-top: .5rem; }

/* ── Cast ───────────────────────────────────────────────────────────────── */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1rem; }
.cast-card { text-align: center; }
.cast-img-wrap {
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-3);
  margin-bottom: .5rem;
}
.cast-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.cast-name { font-size: .82rem; font-weight: 600; }
.cast-role { font-size: .75rem; color: var(--text-muted); margin-top: .1rem; }

/* ── Page-authored game pages (layout: default + raw HTML) ─────────────── */
/* Styles for the classes used in hand-written game/media pages            */

/* Page hero */
.hero {
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 { margin-bottom: .4rem; }
.subtitle {
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Info/stats grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
}
.info-cell { background: var(--bg-2); padding: .8rem 1rem; }
.label {
  font-size: .67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .2rem;
}
.value { font-size: .875rem; color: var(--text); }

/* Prose paragraphs between divs */
main > p { margin-bottom: .75rem; color: var(--text-muted); font-size: .925rem; line-height: 1.7; }

/* Cheat groups */
.cheats-group { margin-bottom: 1.5rem; }
.cheats-group h3 {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin: 1rem 0 .5rem;
}
/* Cheat description (used in page-authored pages instead of cheat-code) */
.cheat-desc {
  width: 100%;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Cast info wrapper (cards without images) */
.cast-info { display: flex; flex-direction: column; padding: .35rem 0; }

/* ── Tags ────────────────────────────────────────────────────────────────── */
.tag-list { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 .55rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: 100px;
}

/* Category badge — primary label, visually distinct from tags */
.category-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 .55rem;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 100px;
}

/* Post author byline */
.post-author {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  color: var(--text-dim);
  margin-top: .3rem;
  margin-bottom: .15rem;
}

/* ── Back button ─────────────────────────────────────────────────────────── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 1.75rem;
  transition: color .15s;
}
.back-btn:hover { color: var(--accent); text-decoration: none; }
.back-btn svg { flex-shrink: 0; }

/* ── Post header image ───────────────────────────────────────────────────── */
.post-header-img-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  background: var(--bg-3);
}
.post-header-img-wrap::before {
  content: '';
  position: absolute;
  inset: -10%;
  background: var(--blur-bg, transparent) center / cover no-repeat;
  filter: blur(20px) brightness(0.65) saturate(1.2);
}
.post-header-img-wrap .post-header-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: 0;
  margin-bottom: 0;
}
.post-header-img {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  display: block;
}

/* ── Image placeholder slots ─────────────────────────────────────────────── */
/* Used wherever a real image is missing — game covers, post headers, cast   */
.img-ph {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: var(--text-dim);
  user-select: none;
}
.img-ph-icon { opacity: .3; flex-shrink: 0; }
.img-ph-label {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .35;
}

/* Article/post hero banner — wide */
.img-ph--hero {
  width: 100%;
  height: 220px;
  margin-bottom: 2rem;
}

/* News card slot — matches .news-item-img height */
.news-item-placeholder {
  display: block;
  width: calc(100% + 3rem);
  height: 200px;
  margin: -1.25rem -1.5rem 1.25rem;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.news-item-placeholder svg { opacity: .25; }

/* Portrait — cast members */
.img-ph--portrait { width: 100%; aspect-ratio: 2/3; border-radius: var(--radius); }
.post-header-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .6rem;
}

/* ── Page hero (lore pages) ──────────────────────────────────────────────── */
.page-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.page-hero::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.page-hero-banner {
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.page-hero-banner svg {
  display: block;
  width: 100%;
  height: 100px;
}
.page-hero h1 { margin-bottom: .5rem; }
.page-hero p  { color: var(--text-muted); font-size: .95rem; max-width: 56ch; }

/* ── News page header ────────────────────────────────────────────────────── */
.news-page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.news-page-header::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.news-page-header h1 { margin-bottom: .4rem; }
.news-page-header p  { color: var(--text-muted); font-size: .95rem; }

/* Clickable card (stretched-link) */
.news-item { position: relative; cursor: pointer; }
.news-item-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  z-index: 0;
}
.news-item-body { position: relative; }
.news-item-top {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}
.news-item-top .news-item-meta { margin-bottom: 0; }

/* Full-width news list variant */
.news-list--full { gap: 1.25rem; }

/* Horizontal news list — image left, content right (news page) */
.news-list--horizontal {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.news-list--horizontal > .news-item {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  margin-bottom: .75rem;
}
.news-list--horizontal > .news-item .news-item-img-wrap {
  width: 210px;
  min-width: 210px;
  height: auto;
  min-height: 120px;
  margin: 0;
  border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  flex-shrink: 0;
}
.news-list--horizontal > .news-item .news-item-placeholder {
  width: 80px;
  min-width: 80px;
  height: auto;
  min-height: 120px;
  margin: 0;
  border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  flex-shrink: 0;
}
.news-list--horizontal > .news-item .news-item-body {
  flex: 1;
  padding: .85rem 1.1rem;
  min-width: 0;
}
.news-list--horizontal > .news-item .story-cluster-bar {
  width: 100%;
  flex-basis: 100%;
  box-sizing: border-box;
  padding: .45rem 1.1rem .65rem;
  margin-top: 0;
}

/* Day dividers */
.news-day-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0 .6rem;
}
.news-day-divider:first-child { margin-top: 0; }
.news-day-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.news-day-divider-label {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}


/* Featured news layout: first card spans full width, rest 2-per-row */
.news-list--featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.news-list--featured > .news-item:first-child {
  grid-column: 1 / -1;
}
.news-list--featured > .news-item:first-child .news-item-img-wrap {
  height: 340px;
}
.news-list--featured > .news-item:first-child .news-item-placeholder {
  height: 340px;
}

/* ── Sidebar random shot ─────────────────────────────────────────────────── */
.sidebar-random-shot {
  padding: .75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-random-shot-label {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .5rem;
  padding: 0 .25rem;
}

/* Blur-behind image wrapper for news cards */
.news-item-img-wrap {
  display: block;
  position: relative;
  width: calc(100% + 3rem);
  height: 200px;
  margin: -1.25rem -1.5rem 1.25rem;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
  background: var(--bg-3);
}
.news-item-img-wrap::before {
  content: '';
  display: none;
  position: absolute;
  inset: -10%;
  background: var(--blur-bg, transparent) center / cover no-repeat;
  filter: blur(18px) brightness(0.7) saturate(1.2);
}
.news-item-img-wrap--portrait::before { display: block; }
.news-item-img-wrap .news-item-img,
.news-item-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
  overflow: visible;
}
.news-item-img-wrap--portrait .news-item-img { object-fit: contain; }

/* ── Timeline ─────────────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2.5rem;
  margin-top: .5rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--border-2) 3%, var(--border-2) 97%, transparent);
}
.timeline-item {
  position: relative;
  padding-bottom: 2.25rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.85rem;
  top: .35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--accent-border);
}
.timeline-year {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: .2rem;
}
.timeline-title {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .35rem;
  line-height: 1.4;
}
.timeline-title a { color: var(--text); text-decoration: none; }
.timeline-title a:hover { color: var(--accent); }
.timeline-desc {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.timeline-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 .45rem;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  border-radius: 100px;
  margin-left: .4rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.timeline-tag--game   { background: var(--accent-dim); color: var(--accent); }
.timeline-tag--film   { background: rgba(120,160,220,.12); color: #7ea8d8; }
.timeline-tag--series { background: rgba(100,200,120,.12); color: #6ec880; }
.timeline-era-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 3rem 0 .25rem;
}
.timeline-era-title:first-child { margin-top: 0; }
.timeline-era-sub {
  font-size: .78rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}
.timeline-cover {
  width: 60px;
  border-radius: 4px;
  display: block;
  margin-bottom: .6rem;
}

/* ── Timeline continuity split — shown between separate game universes ─────── */
.timeline-split {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin: 2.75rem 0 2.5rem;
  padding: .95rem 1.1rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.timeline-split--film {
  border-left-color: #7ea8d8;
}
.timeline-split-icon {
  font-size: 1.5rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: .1rem;
  line-height: 1;
}
.timeline-split--film .timeline-split-icon { color: #7ea8d8; }
.timeline-split-body { min-width: 0; }
.timeline-split-label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .2rem;
}
.timeline-split-note {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Characters page ──────────────────────────────────────────────────────── */
.char-card-full {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
}
.char-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.char-alias {
  font-size: .68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .35rem;
}
.char-name { font-size: 1.5rem; margin-bottom: 1rem; }
.char-bio {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 72ch;
}
.char-bio + .char-bio { margin-top: .75rem; }
.char-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.char-detail-title {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-dim);
  margin-bottom: .75rem;
}
.char-stats { display: flex; flex-direction: column; gap: .6rem; list-style: none; }
.char-stats div { display: flex; flex-direction: column; gap: .1rem; }
.char-stats dt {
  font-size: .67rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
}
.char-stats dd { font-size: .82rem; color: var(--text); }
.char-stats a { color: var(--accent); text-decoration: none; }
.char-stats a:hover { text-decoration: underline; }
.char-appearances { }
.char-game-list {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .75rem;
}
.char-game-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 30px;
  padding: 0 .75rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: color .15s, border-color .15s, background .15s;
}
.char-game-link span { font-size: .67rem; color: var(--text-dim); }
.char-game-link:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-dim); }

/* ── Lara biography page ──────────────────────────────────────────────────── */
.bio-era-block {
  margin-bottom: 3rem;
}
.bio-era-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin-bottom: .35rem;
}
.bio-era-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.bio-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  align-items: start;
}
.bio-layout.bio-layout--reverse {
  grid-template-columns: 220px 1fr;
}
.bio-layout--reverse .bio-text { order: 2; }
.bio-layout--reverse .bio-image-col { order: 1; }
.bio-text p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: .9rem;
  max-width: 72ch;
}
.bio-text p:last-child { margin-bottom: 0; }
.bio-image-col { display: flex; flex-direction: column; gap: .75rem; }
.bio-image-slot {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--bg-3);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bio-image-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.bio-image-slot--wide {
  aspect-ratio: 4/3;
}
.bio-image-caption {
  font-size: .7rem;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}
.bio-placeholder-label {
  font-size: .7rem;
  color: var(--text-dim);
  text-align: center;
  padding: 1rem;
  user-select: none;
}
.bio-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.bio-stat dt {
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .2rem;
}
.bio-stat dd {
  font-size: .82rem;
  color: var(--text);
}

/* ── Comics page ──────────────────────────────────────────────────────────── */
.comic-series-block {
  margin-bottom: 3.5rem;
}
.comic-series-header {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  object-position: center 30%;
  border-radius: var(--radius) var(--radius) 0 0;
  display: block;
  margin-bottom: 0;
}
.comic-series-header-wrap {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-bottom: none;
}
.comic-series-meta {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
  margin-bottom: 1.25rem;
}
.comic-series-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .3rem;
}
.comic-series-pub {
  font-size: .72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}
.comic-series-desc {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 72ch;
}
.comic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: .6rem;
}
.comic-issue {
  display: block;
  text-decoration: none;
  position: relative;
}
.comic-issue img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: block;
  transition: border-color .15s, transform .15s;
}
.comic-issue:hover img {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.comic-issue-num {
  font-size: .62rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: .3rem;
  display: block;
}
.comic-series-link {
  display: inline-block;
  margin-top: .85rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.comic-series-link:hover { text-decoration: underline; }

@media (max-width: 680px) {
  .bio-layout,
  .bio-layout.bio-layout--reverse {
    grid-template-columns: 1fr;
  }
  .bio-layout--reverse .bio-text { order: 1; }
  .bio-layout--reverse .bio-image-col { order: 2; }
  .bio-image-col { flex-direction: row; overflow-x: auto; }
  .bio-image-slot { min-width: 140px; flex-shrink: 0; }
  .comic-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .4rem; }
}

/* ── Comic series page ────────────────────────────────────────────────────── */
.comic-series-banner {
  width: 100%;
  overflow: hidden;
  border-radius: 0;
  margin-bottom: 0;
  background: var(--bg-3);
}
.comic-series-banner img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
/* Issue grid: tighter columns, portrait aspect ratio for comic covers */
.comic-issue-grid {
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px;
}
.comic-issue-grid .gallery-thumb {
  aspect-ratio: 2/3;  /* portrait — comic book proportions */
}
.comic-issue-grid .gallery-thumb img {
  aspect-ratio: unset;
  object-fit: cover;
}
@media (max-width: 480px) {
  .comic-issue-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 4px; }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: start;
  padding: 3rem 2.5rem 2.25rem;
}
.footer-brand { max-width: 22rem; }
.footer-logo {
  display: block;
  font-size: .875rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap;
  margin-bottom: .65rem;
  text-decoration: none;
}
.footer-logo em { font-style: normal; color: var(--accent); }
.footer-tagline { font-size: .82rem; color: var(--text-dim); line-height: 1.65; }
.footer-nav { display: flex; gap: 3rem; }
.footer-col h3 {
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: .9rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-col a {
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .15s;
}
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  padding: 1.1rem 2.5rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-copy { font-size: .72rem; color: var(--text-dim); line-height: 1.6; }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state { color: var(--text-muted); font-size: .875rem; padding: 2rem 0; }

.news-view-all { margin-top: 1.25rem; }

/* ── Light mode component overrides ─────────────────────────────────────── */

/* Sidebar needs stronger border in light mode */
[data-theme="light"] .sidebar {
  border-right-color: var(--border-2);
}

/* Nav vertical lines in light mode */
[data-theme="light"] .nav-section-item > .nav-sub.is-open {
  border-left-color: rgba(62,105,68,.15);
}
[data-theme="light"] .nav-sub .nav-sub.is-open {
  border-left-color: rgba(62,105,68,.45);
}
[data-theme="light"] .main-navigation .submenu.is-open {
  border-left-color: rgba(62,105,68,.15);
}
[data-theme="light"] .main-navigation .sub-links.is-open {
  border-left-color: rgba(62,105,68,.45);
}

/* Ensure news item left accent border survives in light mode */
[data-theme="light"] .news-item {
  border-left-color: var(--accent-border);
}

/* Cheat code pill contrast in light mode */
[data-theme="light"] .cheat-code {
  background: var(--bg-3);
  border-color: var(--border-2);
  color: var(--accent);
}

/* ach-trophy — image icon, aligned same as ach-score */
.ach-trophy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  justify-self: center;
  padding: .1rem;
}
.trophy-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}


/* ── Wallpapers page ────────────────────────────────────────────────────── */
.page-section { max-width: 900px; }
.page-section-header { margin-bottom: 2rem; }
.page-section-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.page-section-title i { color: var(--accent); }
.page-section-desc { color: var(--text-dim); font-size: .9rem; }

.wallpaper-group-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.wallpaper-group-title:first-child { margin-top: 0; }

.wallpaper-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.wallpaper-tab {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.1rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.wallpaper-tab:hover { color: var(--text); }
.wallpaper-tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.wallpaper-count {
  font-size: .7rem;
  font-weight: 600;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .05rem .45rem;
  color: var(--text-dim);
}

.wallpaper-game-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.5rem;
}
.wallpaper-game-link {
  padding: .3rem .75rem;
  font-size: .75rem;
  font-weight: 600;
  border-radius: 20px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.wallpaper-game-link:hover {
  background: rgba(126,165,131,.12);
  border-color: rgba(126,165,131,.35);
  color: var(--accent);
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .85rem;
  margin-bottom: 1rem;
}
.wallpaper-grid--mobile {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.wallpaper-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.wallpaper-card:hover { border-color: var(--border-2); box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.wallpaper-thumb-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-3);
  cursor: zoom-in;
  border: none;
  padding: 0;
}
.wallpaper-thumb-wrap--mobile { aspect-ratio: 9/19.5; }
.wallpaper-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s var(--ease);
}
.wallpaper-card:hover .wallpaper-thumb { transform: scale(1.04); }
.wallpaper-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 1.5rem;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.wallpaper-thumb-wrap:hover .wallpaper-zoom,
.wallpaper-thumb-wrap:focus-visible .wallpaper-zoom { opacity: 1; }
.wallpaper-info {
  padding: .4rem .65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
}
.wallpaper-name {
  font-size: .72rem;
  font-weight: 500;
  text-transform: capitalize;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wallpaper-dl {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .7rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(126,165,131,.1);
  border: 1px solid rgba(126,165,131,.2);
  border-radius: 20px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.wallpaper-dl:hover { background: rgba(126,165,131,.2); border-color: var(--accent); }

.wallpaper-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 4rem 2rem;
  color: var(--text-dim);
  font-size: .9rem;
}
.wallpaper-empty i { font-size: 2.5rem; opacity: .3; }

/* ── Focus ──────────────────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  /* Sidebar becomes a full-screen drawer sliding from the right */
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: 100%;
    height: 100%;
    z-index: 200;
    transform: translateX(100%);
    transition: transform .3s var(--ease);
  }
  .sidebar.is-open { transform: translateX(0); }

  /* Fixed header — always visible as you scroll */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    height: 52px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  body { padding-top: 52px; }

  /* Show floating FAB */
  .nav-toggle { display: flex; }

  /* Offset anchor scroll targets below the fixed header */
  html { scroll-padding-top: 60px; }

  /* Overlay: present in DOM but fully non-interactive when invisible */
  .overlay { display: block; }

  main {
    padding: 1.5rem 1.25rem 7rem; /* bottom clearance for FAB */
  }

  /* Game page header — stays side-by-side on mobile, smaller cover */
  .game-cover-btn { width: 80px; }
  .game-cover-img { width: 80px; }

  /* Uniform touch targets in nav — all top-level items same height */
  .nav-link,
  .nav-group-toggle {
    height: 46px;
    font-size: .9rem;
    padding: 0 .75rem;
    margin: 1px .5rem;
  }
  .nav-group-toggle--section { margin-top: .35rem; }

  /* Sub-level items — slightly smaller but still generous */
  .nav-group-toggle--sub,
  .nav-link--leaf {
    height: 40px;
    font-size: .875rem;
    padding-left: 1.75rem;
    margin: 1px 0;
  }
  .nav-leaf-list { padding: .1rem 0 .25rem; }
  .nav-leaf-list .nav-year { flex-shrink: 0; }

  /* Sub panels: reduce indent on mobile */
  .nav-section-item > .nav-sub { margin-left: .25rem; }
  .nav-sub .nav-sub {
    margin-left: .75rem;
    transition: grid-template-rows .3s var(--ease);
  }
  .nav-sub .nav-sub .nav-link--leaf { padding-left: .9rem; }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem 1.5rem;
  }
  .footer-nav { flex-wrap: wrap; gap: 2rem; }
  .footer-bottom { padding: 1rem 1.5rem; }

  /* Character page */
  .char-card-full { padding: 1.25rem; }
  .char-detail-grid { grid-template-columns: 1fr; gap: 1.25rem; }

  /* Timeline */
  .timeline { padding-left: 1.75rem; }
  .timeline-item::before { left: -2.1rem; }

  /* News featured layout: single column on mobile */
  .news-list--featured { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .news-list--horizontal > .news-item {
    flex-direction: column;
  }
  .news-list--horizontal > .news-item .news-item-img-wrap {
    width: 100%;
    height: 160px;
    min-height: 0;
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  }
  .news-list--horizontal > .news-item .news-item-placeholder {
    width: 100%;
    min-height: 70px;
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  }
}

@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .lb-img-wrap  { max-width: 100vw; padding: 0; }
  .lb-prev { left: .25rem; }
  .lb-next { right: .25rem; }
  .nav-toggle { bottom: 1.25rem; right: 1.25rem; }
}

/* ── News source badge ───────────────────────────────────────────────────── */
.news-source {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 .5rem;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 4px;
  white-space: nowrap;
}
.post-source-name { font-weight: 500; color: var(--text-muted); }

/* ── Clickable category / tag links ─────────────────────────────────────── */
.category-link {
  position: relative;
  z-index: 1;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.category-link:hover { opacity: .78; }

.tag-link {
  position: relative;
  z-index: 1;
  text-decoration: none;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.tag-link:hover { color: var(--accent); background: var(--accent-bg); }

.news-tag-list { margin-top: .5rem; margin-bottom: .25rem; }

/* ── News filter bar ─────────────────────────────────────────────────────── */
.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.news-search-form {
  display: flex;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  overflow: hidden;
  flex: 0 1 240px;
}
.news-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: .45rem .75rem;
  font-size: .85rem;
  color: var(--text);
  font-family: inherit;
  min-width: 0;
}
.news-search-input::placeholder { color: var(--text-dim); }
.news-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  transition: color .15s;
}
.news-search-btn:hover { color: var(--accent); }

.news-cat-filters { display: flex; flex-wrap: wrap; gap: .4rem; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 .75rem;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--border-2); }
.filter-btn.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: rgba(126,165,131,.35);
}

.active-filter-banner {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1.25rem;
  padding: .5rem .75rem;
  background: var(--accent-bg);
  border: 1px solid rgba(126,165,131,.25);
  border-radius: 6px;
  font-size: .82rem;
  color: var(--text-muted);
}
.active-filter-banner strong { color: var(--accent); }
.active-filter-clear {
  margin-left: auto;
  font-size: .75rem;
  color: var(--text-dim);
  text-decoration: none;
}
.active-filter-clear:hover { color: var(--text); }

/* ── Home media row (Random Image + YouTube, side-by-side) ──────────────── */
.home-media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin-top: 2.5rem;
}
@media (max-width: 720px) {
  .home-media-row { grid-template-columns: 1fr; }
  .yt-section { order: -1; }   /* YouTube above Random Image on mobile */
}

/* ── YouTube iframe embed ────────────────────────────────────────────────── */
/* Lives inside a .random-shot card — no border-radius needed here */
.yt-embed-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
}
.yt-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Light-mode overrides ────────────────────────────────────────────────── */
[data-theme="light"] .news-source { background: #f0ede8; border-color: rgba(0,0,0,.1); color: #6b6560; }
[data-theme="light"] .filter-btn { background: #f5f3f0; border-color: rgba(0,0,0,.12); color: #6b6560; }
[data-theme="light"] .filter-btn:hover { background: #eceae6; color: #2a2520; }
[data-theme="light"] .news-search-form { background: #f5f3f0; border-color: rgba(0,0,0,.14); }
[data-theme="light"] .news-search-input { color: #1a1714; }
[data-theme="light"] .active-filter-banner { background: rgba(90,140,95,.08); }

/* ── Related articles (post page) ────────────────────────────────────────── */
.related-articles {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-heading {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.1rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .85rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--bg-2);
  transition: border-color .18s, transform .18s, background .18s;
}
.related-card:hover {
  border-color: var(--accent);
  background: var(--bg-3);
  transform: translateY(-2px);
  text-decoration: none;
}

.related-card-img-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-3);
  flex-shrink: 0;
}
.related-card-img-wrap--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.4rem;
}
.related-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.related-card:hover .related-card-img { transform: scale(1.04); }

.related-card-body {
  padding: .7rem .85rem .85rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}

.related-card-meta {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.related-card-title {
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.38;
  margin: 0;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Story clustering (news index) ───────────────────────────────────────── */
/* Secondary articles in a cluster are hidden; their sources appear as badges
   on the primary card. The cluster bar sits just inside the card border so
   it inherits the card's rounded corners. */

.story-cluster-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .4rem;
  padding: .55rem 1.5rem .8rem;
  border-top: 1px solid var(--border);
  margin-top: .75rem;
  font-size: .72rem;
  position: relative;
  z-index: 1; /* above the stretched link ::after overlay */
}

.story-cluster-label {
  color: var(--text-dim);
  font-weight: 600;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-right: .15rem;
}

.story-source-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .6rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  text-decoration: none;
  font-size: .7rem;
  font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.story-source-badge:hover {
  background: var(--bg-4, var(--bg-3));
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.story-source-badge svg { flex-shrink: 0; opacity: .7; }

/* Light-mode cluster overrides */
[data-theme="light"] .story-source-badge { background: #f0ede8; border-color: rgba(0,0,0,.1); }
[data-theme="light"] .story-source-badge:hover { background: #e8e5e0; border-color: var(--accent); }
