/* UFO Magazine Archive — main.css
   Adapted from UFOScans.com template.
   ================================================ */

:root {
  --bg-body:    #f1f5f9;
  --bg-white:   #ffffff;
  --bg-header:  #0f172a;
  --text-main:  #1e293b;
  --text-muted: #334155;
  --border:     #cbd5e1;
  --accent:     #1e40af;
  --accent-soft:#eff6ff;
  --font-sans:  'Inter', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --radius:     6px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); }

/* ── Header ── */
.site-header {
  background: var(--bg-header);
  color: #fff;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.site-logo {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { color: #93c5fd; text-decoration: none; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: auto;
}
.header-browse-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}
.header-browse-link:hover { color: #fff; text-decoration: none; }

/* ── Header stats ── */
.hp-header-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  justify-content: center;
  overflow: hidden;
}
.hp-header-stat {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  white-space: nowrap;
}
.hp-header-stat-val {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}
.hp-header-stat-lbl {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
}
@media (max-width: 860px) { .hp-header-stats { display: none; } }

/* ── Breadcrumb ── */
.breadcrumb {
  padding: 0.5rem 1.5rem;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent); text-decoration: underline; font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); font-size: 0.85em; }

/* ── Portal 2-column layout ── */
.hp-portal {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: start;
}
.hp-main { min-width: 0; }

.hp-sidebar {
  position: sticky;
  top: 44px;
  height: calc(100vh - 44px);
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.hp-sidebar::-webkit-scrollbar { width: 4px; }
.hp-sidebar::-webkit-scrollbar-track { background: transparent; }
.hp-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-heading {
  padding: 0.875rem 1rem 0.5rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.sidebar-col-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-main);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  line-height: 1.3;
}
.sidebar-col-link:hover,
.sidebar-col-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}
.sidebar-col-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-col-count {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .hp-portal { grid-template-columns: 1fr; }
  .hp-sidebar {
    position: static;
    height: auto;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0.5rem;
    scrollbar-width: none;
  }
  .hp-sidebar::-webkit-scrollbar { display: none; }
  .sidebar-heading { display: none; }
  .sidebar-col-link {
    flex: 0 0 auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
  }
  .sidebar-col-link:hover,
  .sidebar-col-link.active {
    border-bottom-color: var(--accent);
    background: transparent;
  }
  .sidebar-col-count { display: none; }

  /* Spotlight: stack both slides on mobile */
  #spotlight { height: auto; overflow: visible; }
  #spotlight-game,
  #spotlight-donate {
    position: static;
    opacity: 1 !important;
    pointer-events: auto !important;
    animation: none !important;
    border-bottom: 1px solid var(--border);
  }
  #spotlight-donate { border-bottom: none; }
  .sl-donate-card { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .sl-donate-visual { flex: none; width: 100%; height: auto; padding: 0.75rem 1rem; flex-direction: row; gap: 0.75rem; justify-content: flex-start; text-align: left; align-items: center; }
  .sl-dv-num { font-size: 1.375rem; }
}

/* ── Search ── */
.search-wrap {
  padding: 0.75rem 1rem;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
}
.search-input-row {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.search-input {
  width: 100%;
  padding: 0.5rem 2.4rem 0.5rem 2.375rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s;
}
.search-input::placeholder { color: #94a3b8; }
.search-input:focus { border-color: var(--accent); background: #fff; }
.search-clear {
  position: absolute;
  right: 0.625rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 0.25rem;
}
.search-clear:hover { color: var(--text-main); }

/* ── Page layout (doc detail) ── */
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}
.hp-main .page-container { max-width: none; margin: 0; }
.hp-main .cat-container  { max-width: none; margin: 0; }

/* ── Document header ── */
.doc-header {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.doc-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.doc-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--bg-header);
  line-height: 1.25;
  margin-bottom: 1.25rem;
  word-break: break-word;
}
.doc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  line-height: 1.4;
}
.badge-type   { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-agency { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.badge-mag    { background: var(--accent-soft); color: var(--accent); border: 1px solid #bfdbfe; }
.doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.875rem;
}
.doc-tag {
  padding: 0.175rem 0.5rem;
  border-radius: 3px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Rotating spotlight banner ── */
#spotlight {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
/* Shared positioning for both slides */
.spotlight-slide {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  padding: 1.125rem 1.5rem;
  display: flex;
  align-items: center;
  background: var(--bg-white);
}
/* Game slide: permanent base — always visible */
#spotlight-game { opacity: 1; z-index: 1; pointer-events: auto; }
/* Donate slide: fades over the archive slide via CSS animation */
#spotlight-donate {
  opacity: 0; z-index: 2; pointer-events: none;
  will-change: opacity;
  animation: donateShow 62s linear infinite;
}
@keyframes donateShow {
  0%,  47% { opacity: 0; pointer-events: none; }
  48%      { opacity: 0; pointer-events: none; animation-timing-function: ease-in-out; }
  50%      { opacity: 1; pointer-events: auto; }
  96%      { opacity: 1; pointer-events: auto; animation-timing-function: ease-in-out; }
  98%      { opacity: 0; pointer-events: none; }
  100%     { opacity: 0; pointer-events: none; }
}
.sl-donate-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
}
.sl-donate-visual {
  flex: 0 0 150px;
  background: #0f172a;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  height: 90px;
}
.sl-dv-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #60a5fa;
  margin: 0;
  line-height: 1;
}
.sl-dv-lbl {
  font-size: 0.58rem;
  color: #94a3b8;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.sl-dv-free {
  font-size: 0.6rem;
  font-weight: 600;
  color: #64748b;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sl-donate-body { flex: 1; min-width: 0; }
.sl-donate-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.3rem;
}
.sl-donate-text {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 0.6rem;
}
/* — Game slide — */
.sl-game-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}
.sl-screenshot-frame {
  flex: 0 0 auto;
  background: #111827;
  border-radius: 6px;
  overflow: hidden;
  padding: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}
.sl-screenshot {
  width: 152px;
  height: 102px;
  object-fit: cover;
  object-position: center;
  border-radius: 3px;
  display: block;
}
.sl-game-body { flex: 1; min-width: 0; }
.sl-game-hook {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.15rem;
  line-height: 1.3;
}
.sl-game-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.sl-game-meta {
  font-weight: 400;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.sl-game-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 0.45rem;
}
.sl-game-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0 0 0.55rem;
}
.sl-topic {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #e2e8f0;
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* — Donate/CTA button — */
.sl-game-btn {
  display: inline-block;
  font-size: 0.775rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  transition: background 0.15s;
  letter-spacing: 0.01em;
}
.sl-game-btn:hover { background: #1d4ed8; text-decoration: none; color: #fff; }
.sl-paypal-img {
  height: 38px;
  display: block;
  opacity: 0.9;
  transition: opacity 0.15s, transform 0.15s;
}
.sl-paypal-img:hover { opacity: 0.88; transform: scale(1.03); }
@media (max-width: 600px) {
  .sl-donate-card { flex-direction: column; gap: 0.75rem; }
  .sl-donate-visual { flex: none; width: 100%; height: auto; flex-direction: row; gap: 0.75rem; justify-content: flex-start; text-align: left; align-items: center; padding: 0.75rem 1rem; }
}

/* ── Summary card ── */
.doc-summary-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.section-heading {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ── TL;DR box ── */
.doc-tldr {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.875rem 1.125rem;
  margin-bottom: 1.25rem;
}
.doc-tldr-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.doc-tldr p {
  font-size: 0.875rem;
  color: var(--text-main);
  line-height: 1.65;
  margin: 0;
}

/* ── Summary body typography ── */
.summary-body h1,
.summary-body h2,
.summary-body h3 {
  color: var(--bg-header);
  font-weight: 700;
  line-height: 1.3;
  margin: 1.5rem 0 0.75rem;
}
.summary-body h1:first-child,
.summary-body h2:first-child,
.summary-body h3:first-child { margin-top: 0; }
.summary-body h1 { font-size: 1.25rem; }
.summary-body h2 { font-size: 1.05rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.summary-body h3 { font-size: 0.95rem; color: var(--text-muted); }
.summary-body p { color: var(--text-main); line-height: 1.8; margin-bottom: 1rem; }
.summary-body ul, .summary-body ol { margin: 0.75rem 0 1rem 1.5rem; line-height: 1.75; }
.summary-body li { margin-bottom: 0.4rem; color: var(--text-main); }
.summary-body strong { font-weight: 600; color: var(--bg-header); }
.summary-body em { font-style: italic; color: var(--text-muted); }
.summary-body hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.summary-body a { color: var(--accent); }
.summary-body img { max-width: 100%; height: auto; display: block; }

/* ── Share bar ── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.share-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 0.25rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all 0.12s;
  white-space: nowrap;
  cursor: pointer;
}
.share-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── Sidebar (doc detail) ── */
.doc-sidebar { position: sticky; top: 52px; }
.sidebar-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Cover preview card: thumbnail bleeds to edges */
.sidebar-card-preview { padding: 0; overflow: hidden; }
.doc-preview-thumb { line-height: 0; }
.doc-preview-img { width: 100%; height: auto; display: block; background: var(--bg-body); }
.doc-card-body { padding: 1rem 1.125rem 1.125rem; }
.doc-card-body .section-heading { margin-bottom: 0.75rem; }
.no-cover {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
}

/* ── Key facts table ── */
.facts-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.facts-table tr:not(:last-child) .facts-label,
.facts-table tr:not(:last-child) .facts-value { padding-bottom: 0.7rem; }
.facts-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  color: var(--text-muted);
  font-weight: 700;
  padding-right: 0.875rem;
  vertical-align: top;
  white-space: nowrap;
  width: 35%;
}
.facts-value {
  color: var(--text-main);
  font-size: 0.8rem;
  line-height: 1.5;
  word-break: break-word;
  font-family: var(--font-mono);
}

/* ── Download / view button ── */
.btn-download {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-header);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.875rem;
  margin-top: 1.25rem;
  transition: background 0.2s;
  letter-spacing: 0.01em;
}
.btn-download:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ── Archive stat ── */
.archive-stat { font-size: 0.8125rem; color: var(--text-muted); line-height: 1.6; }
.archive-stat strong { color: var(--text-main); font-weight: 600; }

/* ── Category / index pages ── */
.cat-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.375rem 1.5rem 3.5rem;
}
.cat-header { margin-bottom: 0.75rem; }
.cat-header-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.cat-header-meta { display: flex; gap: 0.375rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.625rem; }
.cat-count-badge,
.cat-date-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 0.175rem 0.5rem;
  border-radius: 4px;
}
.cat-count-badge { background: var(--accent-soft); color: var(--accent); border: 1px solid #bfdbfe; }
.cat-date-badge  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.cat-header-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 720px;
  margin: 0.625rem 0 0;
}
.cat-header-title {
  font-size: clamp(1.375rem, 3vw, 1.875rem);
  font-weight: 700;
  color: var(--bg-header);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.cat-doc-snippet {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 720px;
  margin: 0;
}
/* ── Category doc list ── */
.cat-container .pager {
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
}
.cat-docs + .pager {
  padding: 0.75rem 0 0.25rem;
  border-top: 2px solid var(--border);
  border-bottom: none;
  margin-top: 0;
}
.cat-docs { border-top: none; }
.cat-doc  { border-bottom: 1px solid var(--border); }
.cat-doc-link {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.75rem 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s, padding-left 0.1s;
}
.cat-doc-link:hover { background: var(--accent-soft); padding-left: 0.875rem; }
.cat-doc-thumb {
  flex: 0 0 44px;
  width: 44px;
  height: 60px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.cat-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.cat-doc-thumb.feat-card-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-doc-body { flex: 1; min-width: 0; }
.cat-doc-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 0.3rem;
}
.cat-doc-link:hover .cat-doc-title { color: var(--accent); }
.cat-doc-meta {
  display: flex; flex-wrap: wrap; gap: 0.2rem 0.75rem;
  margin-bottom: 0.35rem;
}
.cat-doc-meta span { font-size: 0.65rem; font-family: var(--font-mono); color: var(--text-muted); }
.cat-doc-year {
  background: var(--bg-body); border: 1px solid var(--border);
  padding: 0.1rem 0.4rem; border-radius: 3px;
}

/* ── Paginator ── */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.pager-btn,
.pager-num {
  font-family: var(--font-sans);
  background: var(--bg-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.pager-btn {
  padding: 0.35rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}
.pager-btn:not(.pager-btn--disabled):hover,
.pager-num:not(.pager-num--active):hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.pager-btn--disabled { opacity: 0.4; cursor: default; }
.pager-nums { display: flex; gap: 0.25rem; flex-wrap: wrap; justify-content: center; }
.pager-num {
  width: 2rem; height: 2rem;
  font-size: 0.8125rem; font-weight: 500;
}
.pager-num--active { background: var(--accent); color: #fff; border-color: var(--accent); cursor: default; }
.pager-ellipsis { display: inline-flex; align-items: center; padding: 0 0.25rem; color: var(--text-muted); font-size: 0.875rem; }

.cat-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bg-header);
  margin: 2rem 0 0.875rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.cat-section-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Magazine cards (feat-grid) ── */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}
.feat-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem 0.875rem 0.875rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.feat-card:hover { background: var(--accent-soft); text-decoration: none; color: inherit; }

/* Magazine cover thumbnail inside card */
.feat-card-thumb {
  flex: 0 0 52px;
  width: 52px;
  height: 70px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.feat-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.feat-card-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  color: var(--text-muted);
  text-align: center;
}

.feat-card-inner { flex: 1; min-width: 0; }
.feat-card-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
  min-height: 1.3rem;
}
.feat-card-type {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}
.feat-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin: 0 0 0.35rem;
}
.feat-card:hover .feat-card-title { color: var(--accent); }
.feat-card-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.feat-card-agency {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-body);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.feat-card-arrow {
  font-size: 0.9rem;
  color: var(--border);
  flex-shrink: 0;
  align-self: center;
  transition: color 0.12s, transform 0.12s;
}
.feat-card:hover .feat-card-arrow { color: var(--accent); transform: translateX(3px); }

/* ── Section bar (homepage + category) ── */
.hp-section-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem 0.875rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.hp-section-bar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}
.hp-section-bar-count {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-body);
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* ── Footer ── */
.site-footer {
  background: var(--bg-header);
  color: rgba(255,255,255,0.55);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.75rem;
}
.footer-inner { max-width: 800px; margin: 0 auto; }
.footer-inner p { margin-bottom: 0.5rem; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.site-footer a { color: rgba(255,255,255,0.7); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-inner p a { text-decoration: underline; }
.footer-dev {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.5rem;
}
.footer-dev-label { font-size: 0.7rem; color: rgba(255,255,255,0.35); }
.footer-dev a { font-size: 0.75rem; white-space: nowrap; padding: 0.25rem; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ── Responsive: tablet ── */
@media (max-width: 900px) {
  .page-container {
    grid-template-columns: 1fr;
    padding: 1rem 1rem 2rem;
    gap: 1rem;
  }
  .doc-sidebar { position: static; }
  .doc-title { font-size: 1.25rem; }
  .doc-header { padding: 1.25rem; }
  .doc-summary-card { padding: 1.25rem; }
  .sidebar-card { padding: 1.25rem; }
  .header-browse-link { display: none; }
  .sidebar-card-preview .doc-preview-img { max-height: 320px; object-fit: cover; object-position: top; width: 100%; }
}

/* ── Responsive: mobile ── */
@media (max-width: 640px) {
  .cat-container { padding: 1rem 1rem 2rem; }
  .breadcrumb { font-size: 0.7rem; padding: 0.375rem 0.75rem; gap: 0.25rem; }
  .doc-title { font-size: 1.15rem; }
  .feat-grid { grid-template-columns: 1fr; }
  .share-bar { flex-wrap: wrap; gap: 0.3rem; }
  .share-btn { min-height: 40px; }
}
@media (max-width: 480px) {
  .cat-doc-snippet { display: none; }
  .doc-badges { gap: 0.375rem; }
  .badge { font-size: 0.65rem; }
  .summary-body { font-size: 0.875rem; }
  .summary-body h1, .summary-body h2 { font-size: 1rem; }
  .summary-body h3 { font-size: 0.9rem; }
  .feat-card-thumb { flex: 0 0 44px; width: 44px; height: 60px; }
}
