/* =========================================================
   STOCKRANKER.IN — DESIGN SYSTEM
   Theme: "The Ledger" — warm reading-room paper + account-book
   rules, built for long-form reading comfort at any scale.
   ========================================================= */

/* ---------- Fonts (self-hosted-ready; falls back gracefully) ---------- */
@font-face {
  font-family: "Source Serif";
  src: local("Source Serif 4"), local("Source Serif Pro");
  font-display: swap;
}

:root {
  /* ---- Color tokens: Light / Paper (default) ---- */
  --bg: #FBF8F2;
  --bg-elevated: #FFFFFF;
  --bg-muted: #F1ECE0;
  --ink: #1C2333;
  --ink-soft: #4A5266;
  --ink-faint: #7A8194;
  --border: #E4DDC9;
  --border-strong: #D8D2C2;

  --brand: #0B5D42;         /* deep emerald - trust / growth */
  --brand-ink: #063A2A;
  --brand-tint: #E4F0EA;

  --accent: #B8722E;        /* ledger amber - highlights, CTAs */
  --accent-tint: #F6E9D8;

  --positive: #0F7A4B;
  --negative: #B23B3B;
  --negative-tint: #F8E7E5;
  --caution: #A8791A;
  --caution-tint: #F7EDD9;

  --link: #0B5D42;
  --focus-ring: #1E6FD9;

  /* ---- Layout ---- */
  --container: 1180px;
  --container-narrow: 760px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* ---- Type ---- */
  --font-display: "Source Serif", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --fs-base: 1rem;
  --lh-body: 1.7;
  --lh-heading: 1.25;

  --shadow-sm: 0 1px 2px rgba(28,35,51,0.06), 0 1px 1px rgba(28,35,51,0.04);
  --shadow-md: 0 6px 20px rgba(28,35,51,0.08);
  --transition: 180ms ease;
}

/* ---- Sepia theme ---- */
[data-theme="sepia"] {
  --bg: #F2E8D5;
  --bg-elevated: #F8F1E2;
  --bg-muted: #EADFC5;
  --ink: #3A2E1F;
  --ink-soft: #5C4B34;
  --ink-faint: #8A7657;
  --border: #DCC9A3;
  --border-strong: #CBB68B;
  --brand: #5C6E2F;
  --brand-ink: #3F4B1F;
  --brand-tint: #E7EBD3;
  --link: #5C6E2F;
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --bg: #12161F;
  --bg-elevated: #191F2B;
  --bg-muted: #1E2531;
  --ink: #E9E7DD;
  --ink-soft: #B9BDC9;
  --ink-faint: #808898;
  --border: #2A3140;
  --border-strong: #384056;
  --brand: #3FBE8C;
  --brand-ink: #7FE0B6;
  --brand-tint: #16281F;
  --accent: #E0A75E;
  --accent-tint: #2B2216;
  --negative: #E07373;
  --negative-tint: #2B1919;
  --caution: #E0B95E;
  --caution-tint: #2B2413;
  --link: #6FD3A8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.4);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:not(.btn):not(.card-link) { text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color var(--transition); }
a:not(.btn):hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: var(--lh-heading); color: var(--ink); font-weight: 600; margin: 0 0 var(--space-3); }
h1 { font-size: clamp(1.9rem, 4vw + 1rem, 3rem); }
h2 { font-size: clamp(1.5rem, 2.5vw + 1rem, 2rem); margin-top: var(--space-7); }
h3 { font-size: clamp(1.2rem, 1.5vw + 1rem, 1.5rem); margin-top: var(--space-6); }
p { margin: 0 0 var(--space-4); }
table { font-variant-numeric: tabular-nums; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 1000;
  background: var(--brand); color: #fff; padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
.container-narrow { max-width: var(--container-narrow); margin-inline: auto; padding-inline: var(--space-4); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0.6rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform var(--transition), background var(--transition), border-color var(--transition);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(1.4) blur(6px);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-3); }
.brand { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--ink); text-decoration: none; }
.brand .rule { display: inline-block; width: 8px; height: 8px; background: var(--brand); border-radius: 1px; }
.brand-tagline { display: none; font-size: 0.7rem; color: var(--ink-faint); font-family: var(--font-body); font-weight: 500; }
@media (min-width: 860px) { .brand-tagline { display: block; } }

.header-tools { display: flex; align-items: center; gap: var(--space-2); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-elevated); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

.main-nav { display: none; }
@media (min-width: 960px) {
  .main-nav { display: block; border-top: 1px solid var(--border); }
  .main-nav > .container > ul { list-style: none; display: flex; gap: var(--space-6); margin: 0; padding: var(--space-2) 0; }
  .main-nav .nav-item { position: relative; }
  .main-nav > .container > ul > .nav-item > a { font-weight: 600; color: var(--ink-soft); text-decoration: none; padding: var(--space-2) 0; display: inline-block; }
  .nav-link-group { display: inline-flex; align-items: center; gap: 0.25rem; }
  .nav-link-group > a { font-weight: 600; color: var(--ink-soft); text-decoration: none; padding: var(--space-2) 0; }
  .main-nav > .container > ul > .nav-item > a:hover,
  .nav-link-group > a:hover,
  .nav-item.open .nav-link-group > a { color: var(--brand); }
  .nav-caret-btn { border: 0; background: transparent; padding: var(--space-2) 0; cursor: pointer; color: var(--ink-faint); display: inline-flex; align-items: center; }
  .nav-caret-btn:hover { color: var(--brand); }
  .nav-caret { width: 12px; height: 12px; flex-shrink: 0; transition: transform var(--transition); }
  .nav-item.open .nav-caret { transform: rotate(180deg); }
  .submenu {
    list-style: none; margin: 0; padding: var(--space-2); position: absolute; top: 100%; left: 0;
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); min-width: 220px; display: none; flex-direction: column; gap: 2px; z-index: 60;
  }
  /* Click-driven state ONLY — deliberately no CSS :hover fallback. Hover-based dropdown CSS is
     unreliable across browser engines and testing/automation tools (stuck-open states, full-page
     screenshot artifacts). A single source of truth (the JS-toggled .open class) guarantees this
     is always closed unless a visitor actually clicked it. */
  .nav-item.open > .submenu { display: flex; }
  .submenu a { display: block; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; }
  .submenu a:hover { background: var(--brand-tint); color: var(--brand-ink); }
}

/* Mobile menu */
.mobile-nav { display: block; background: var(--bg-elevated); border-top: 1px solid var(--border); }
@media (min-width: 960px) { .mobile-nav { display: none !important; } }
.mobile-nav[hidden] { display: none; }
.mobile-nav ul { list-style: none; margin: 0; padding: var(--space-2) 0; }
.mobile-nav details { border-bottom: 1px solid var(--border); }
.mobile-nav summary { padding: var(--space-3) var(--space-4); font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav .submenu-mobile { list-style: none; margin: 0; padding: 0 var(--space-4) var(--space-3); }
.mobile-nav .submenu-mobile a, .mobile-nav > ul > li > a { display: block; padding: var(--space-2) var(--space-4); color: var(--ink-soft); text-decoration: none; }
.mobile-nav > ul > li:not(:has(details)) { border-bottom: 1px solid var(--border); }

/* Theme + language switchers */
.theme-switch { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.theme-switch button { border: 0; background: var(--bg-elevated); color: var(--ink-soft); padding: var(--space-2) var(--space-3); cursor: pointer; font-size: 0.85rem; }
.theme-switch button[aria-pressed="true"] { background: var(--brand); color: #fff; }

#google_translate_element { font-size: 0.85rem; }

/* ---------- Custom translate dropdown (replaces Google's default unstyled widget) ---------- */
.lang-switch { position: relative; display: inline-flex; align-items: center; }
.lang-switch svg { position: absolute; left: 10px; pointer-events: none; color: var(--ink-faint); }
.lang-switch select {
  appearance: none; -webkit-appearance: none;
  height: 40px; padding: 0 1.6rem 0 2.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elevated); color: var(--ink);
  font-size: 0.85rem; cursor: pointer; max-width: 118px;
}
.lang-switch::after {
  content: ""; position: absolute; right: 8px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
/* Neutralise Google Translate's own page-injected chrome so it never breaks our layout */
body { top: 0 !important; }
.goog-te-banner-frame, .skiptranslate > iframe { display: none !important; visibility: hidden !important; height: 0 !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }

/* ---------- Search overlay ---------- */
.search-overlay { position: fixed; inset: 0; background: rgba(20,20,20,0.5); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 8vh var(--space-4); }
.search-overlay.open { display: flex; }
.search-panel { background: var(--bg-elevated); border-radius: var(--radius-lg); width: 100%; max-width: 640px; box-shadow: var(--shadow-md); padding: var(--space-5); max-height: 78vh; display: flex; flex-direction: column; }
.search-input-row { display: flex; gap: var(--space-2); align-items: center; }
.search-input-row input[type="search"] { flex: 1; padding: var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--ink); font-size: 1rem; }
.search-results { margin-top: var(--space-4); overflow-y: auto; }
.search-results a { display: block; padding: var(--space-3); border-radius: var(--radius-sm); text-decoration: none; }
.search-results a:hover, .search-results a.active { background: var(--brand-tint); }
.search-result-title { font-weight: 600; color: var(--ink); }
.search-result-meta { font-size: 0.8rem; color: var(--ink-faint); }
.search-empty { color: var(--ink-faint); padding: var(--space-4) 0; text-align: center; }

/* ---------- Hero / home ---------- */
.hero { padding-block: var(--space-7); border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--bg-muted), var(--bg) 70%); }
.hero-eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); background: var(--brand-tint); padding: 0.3rem 0.7rem; border-radius: 999px; margin-bottom: var(--space-4); }
.hero h1 { max-width: 18ch; }
.hero p.lede { max-width: 60ch; color: var(--ink-soft); font-size: 1.1rem; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); border-bottom: 2px solid var(--ink); padding-bottom: var(--space-2); margin-bottom: var(--space-5); }
.section-heading h2 { margin: 0; }
.section-heading a { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--transition), transform var(--transition); }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-media { aspect-ratio: 16/9; background: var(--bg-muted); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.card-kicker { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.card-title { font-family: var(--font-display); font-size: 1.15rem; margin: 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card-excerpt { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.card-meta { margin-top: auto; display: flex; align-items: center; gap: var(--space-3); font-size: 0.78rem; color: var(--ink-faint); padding-top: var(--space-2); }

/* ---------- Article ---------- */
.article-header { padding-block: var(--space-6) var(--space-5); border-bottom: 1px solid var(--border); }
.breadcrumbs { font-size: 0.82rem; color: var(--ink-faint); margin-bottom: var(--space-3); }
.breadcrumbs a { color: var(--ink-faint); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 0.35rem; }
.article-type-badge { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-ink); background: var(--brand-tint); padding: 0.25rem 0.6rem; border-radius: 999px; margin-bottom: var(--space-3); }
.article-title { max-width: 22ch; }
.article-dek { font-size: 1.1rem; color: var(--ink-soft); max-width: 65ch; }
.article-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); margin-top: var(--space-5); font-size: 0.85rem; color: var(--ink-faint); }
.author-chip { display: flex; align-items: center; gap: var(--space-2); }
.author-chip img { width: 36px; height: 36px; border-radius: 50%; }
.author-chip a { color: var(--ink); font-weight: 600; text-decoration: none; }

.article-layout { display: grid; grid-template-columns: 1fr; gap: var(--space-7); padding-block: var(--space-6); align-items: start; }
@media (min-width: 1020px) { .article-layout { grid-template-columns: minmax(0,1fr) 300px; } }

.article-body { max-width: 72ch; font-size: 1.05rem; }
.article-body > *:first-child { margin-top: 0; }
.article-body h2 { scroll-margin-top: 90px; border-top: 1px solid var(--border); padding-top: var(--space-5); }
.article-body h2:first-of-type { border-top: none; padding-top: 0; }
.article-body h3 { scroll-margin-top: 90px; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: var(--space-2); }
.article-body li::marker { color: var(--brand); }
.article-body blockquote { margin: var(--space-5) 0; padding: var(--space-4) var(--space-5); border-left: 3px solid var(--accent); background: var(--accent-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; color: var(--ink-soft); }
.article-body img { border-radius: var(--radius-md); margin-block: var(--space-4); }
.article-body figcaption { font-size: 0.85rem; color: var(--ink-faint); text-align: center; margin-top: var(--space-2); }
.article-body a.header-anchor { text-decoration: none; margin-left: 0.4em; opacity: 1; color: var(--ink-faint); }
.article-body code { font-family: var(--font-mono); background: var(--bg-muted); padding: 0.15em 0.4em; border-radius: 4px; font-size: 0.9em; }

/* Ledger data table (financial ratios, price targets, checklists) */
.ledger-table-wrap { overflow-x: auto; margin: var(--space-5) 0; border: 1px solid var(--border); border-radius: var(--radius-md); }
table.ledger-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 420px; }
table.ledger-table caption { text-align: left; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); padding: var(--space-3); background: var(--bg-muted); }
table.ledger-table th, table.ledger-table td { padding: var(--space-3) var(--space-4); text-align: left; border-bottom: 1px solid var(--border); }
table.ledger-table thead th { background: var(--bg-muted); font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
table.ledger-table tbody tr:nth-child(even) { background: var(--bg-muted); }
table.ledger-table td.num { font-family: var(--font-mono); text-align: right; }
.tag-positive { color: var(--positive); font-weight: 600; }
.tag-negative { color: var(--negative); font-weight: 600; }
.tag-caution { color: var(--caution); font-weight: 600; }

/* Callout boxes */
.callout { border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); margin: var(--space-5) 0; border: 1px solid var(--border-strong); }
.callout-disclaimer { background: var(--caution-tint); border-color: #E4CE8F; }
.callout-key-takeaway { background: var(--brand-tint); border-color: #B7D8C7; }
.callout-risk { background: var(--negative-tint); border-color: #E7B9B4; }
.callout-title { font-weight: 700; margin-bottom: var(--space-2); display: flex; align-items: center; gap: var(--space-2); }

/* Table of contents */
.toc { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); margin: var(--space-5) 0; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: var(--space-3) 0 0; padding-left: 1.1em; font-size: 0.92rem; }
.toc li { margin-bottom: var(--space-1); }
.toc a { text-decoration: none; color: var(--ink-soft); }
.toc a:hover { color: var(--brand); }

/* Share buttons */
.share-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-6) 0; padding-top: var(--space-5); border-top: 1px solid var(--border); }
.share-row .label { font-size: 0.85rem; color: var(--ink-faint); font-weight: 600; margin-right: var(--space-2); }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--ink-soft); text-decoration: none; transition: all var(--transition); }
.share-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Author box */
.author-box { display: flex; gap: var(--space-4); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); margin: var(--space-6) 0; }
.author-box img { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; }
.author-box h3 { margin: 0 0 var(--space-1); font-size: 1rem; }
.author-box p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: var(--space-6); position: sticky; top: 84px; }
.sidebar-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); }
.sidebar-card h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--font-mono); color: var(--ink-faint); margin: 0 0 var(--space-3); }
.related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.related-list li a { display: flex; gap: var(--space-3); text-decoration: none; color: var(--ink); }
.related-list img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; }
.related-list .rt { font-size: 0.85rem; font-weight: 600; line-height: 1.35; }
.related-list .rt-meta { font-size: 0.72rem; color: var(--ink-faint); }

.ad-slot { border: 1px dashed var(--border-strong); border-radius: var(--radius-md); min-height: 250px; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 0.78rem; font-family: var(--font-mono); background: var(--bg-muted); text-align: center; padding: var(--space-3); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: var(--space-2); margin-block: var(--space-7); flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.pagination a:hover { border-color: var(--brand); color: var(--brand); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-muted); border-top: 1px solid var(--border); margin-top: var(--space-8); }
.footer-top { padding-block: var(--space-7); display: grid; gap: var(--space-6); grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-top { grid-template-columns: 1.4fr repeat(3, 1fr); } }
.footer-brand p { color: var(--ink-soft); max-width: 34ch; font-size: 0.92rem; }
.footer-social { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.footer-col h3 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; font-family: var(--font-mono); color: var(--ink-faint); margin: 0 0 var(--space-3); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.footer-col a { color: var(--ink-soft); text-decoration: none; font-size: 0.92rem; }
.footer-col a:hover { color: var(--brand); text-decoration: underline; }
.footer-disclaimer { border-top: 1px solid var(--border); padding-block: var(--space-5); font-size: 0.8rem; color: var(--ink-faint); line-height: 1.6; }
.footer-bottom { border-top: 1px solid var(--border); padding-block: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: space-between; align-items: center; font-size: 0.82rem; color: var(--ink-faint); }

/* ---------- Category/listing header ---------- */
.listing-header { padding-block: var(--space-6); border-bottom: 1px solid var(--border); background: var(--bg-muted); }
.filter-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.filter-chip { padding: 0.4rem 0.9rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-elevated); font-size: 0.85rem; text-decoration: none; color: var(--ink-soft); }
.filter-chip[aria-current="page"], .filter-chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Utility page (about/disclaimer/etc) ---------- */
.prose { max-width: 72ch; margin-inline: auto; padding-block: var(--space-6); }
.prose h2 { margin-top: var(--space-6); }

/* ---------- Lazy image shimmer ---------- */
img[loading="lazy"] { background: linear-gradient(100deg, var(--bg-muted) 8%, var(--border) 18%, var(--bg-muted) 33%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
img[loading="lazy"].loaded { animation: none; background: none; }
@keyframes shimmer { to { background-position-x: -200%; } }

/* Back to top */
.back-to-top { position: fixed; right: var(--space-4); bottom: var(--space-4); width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: none; align-items: center; justify-content: center; border: none; cursor: pointer; box-shadow: var(--shadow-md); z-index: 50; }
.back-to-top.visible { display: flex; }
