/* ── Web fonts ────────────────────────────────────────────────────────────────
 *
 * Source Sans 3 (Adobe, SIL Open Font License 1.1), self-hosted. Never load a
 * font from a CDN — see the privacy requirements in CLAUDE.md.
 *
 * Two variable files cover every weight the site uses (400/500/600/700/800/900)
 * plus italics. Regenerate the subsets with `node scripts/subset-fonts.js`;
 * the licence text sits next to the files in website/static/fonts/.
 *
 * The URLs are relative, not absolute. This stylesheet lives at /css/site.css
 * and the React bundle's stylesheet at /app/index.css — both one level deep —
 * so `../fonts/…` resolves identically from either, and survives any baseURL
 * change without touching the paths.
 *
 * ─────────────────────────────────────────────────────────────────────────── */

/* `font-weight: 200 900` declares the variable axis range, not a single weight.
   The files' own default instance is 200 (ExtraLight), so anything that renders
   the font without resolving a weight comes out alarmingly thin — if you ever
   see that, the cause is a missing font-weight, not a broken font.

   Plain `format('woff2')` is deliberate. The older `woff2-variations` hint is
   only needed for browsers that predate variable-font support entirely; every
   engine that can render these files detects the axes from the file itself. */
@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-3-vf.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('../fonts/source-sans-3-vf-italic.woff2') format('woff2');
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* ── Breakpoints ──────────────────────────────────────────────────────────────
 *
 * CSS custom properties cannot be used in @media conditions (no browser
 * support for @custom-media yet), so breakpoint values are literals.
 * All viewport breakpoints are listed here — update every occurrence when
 * changing a value (search the file for the px value to find them all).
 *
 *   700px  mobile nav — hamburger menu appears, subnav row hides
 *            @media (max-width: 700px)  — mobile overrides
 *            @media (min-width: 701px)  — desktop-only rules
 *   400px  very small screens — feedback widget repositions
 *            @media (max-width: 400px)
 *
 * ─────────────────────────────────────────────────────────────────────────── */

/* ── Corner ribbon ────────────────────────────────────────────────────────── */

.corner-ribbon {
  position: fixed;
  top: 26px;
  right: -36px;
  width: 160px;
  padding: 6px 0;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  transform: rotate(45deg);
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.corner-ribbon:hover { text-decoration: none; opacity: 0.88; color: #fff; }

/* ── Dev ribbon (localhost only, injected by JS) ──────────────────────────── */

.dev-ribbon {
  position: fixed;
  top: 26px;
  left: -36px;
  width: 160px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  transform: rotate(-45deg);
  z-index: 9999;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.dev-ribbon--proxy  { background: #2a7d2a; }
.dev-ribbon--direct { background: #b02020; }

/* ── Reset & base ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Backgrounds ── */
  --bg:           #0d0d1a;
  --bg-card:      #10102a;
  --bg-input:     #0a0a1e;    /* input / select background */
  --bg-hover:     #1a1a3a;    /* highlighted row / selection */

  /* ── Borders ── */
  --border:         #1e1e3a;
  --border-input:   #2a2a4a;    /* form field borders */
  --border-tooltip: #545276;    /* chart tool-tip border */
  --border-subtle:  #1a1a30;    /* dividers within panels */

  /* ── Text ── */
  --text:         rgba(255, 255, 255, 0.87);
  --text-bright:  #eee;       /* primary bright labels */
  --text-page:    #e0e0ff;    /* page-level heading text */
  --text-secondary: #bbbbdd;  /* secondary / meta labels */
  --text-muted:   #888;
  --text-dim:     #aaa;       /* dimmed hints / placeholders */
  --text-faint:   #777;       /* very faint labels */

  /* ── Accents ── */
  --accent:       #4361ee;
  --accent-dim:   #2a3ea0;

  /* ── Radii ── */
  --radius:       10px;
  --radius-sm:    6px;        /* form elements, small buttons */
  --radius-lg:    12px;       /* panels */

  /* ── Fonts ── */
  /* Self-hosted, so the site renders identically on every OS instead of
     falling through to Segoe UI / SF Pro / Roboto per platform. The fallbacks
     only cover the moment before the woff2 lands. Keep in sync with the same
     stack in src/index.css, which the React island needs standalone. */
  --font-sans:    'Source Sans 3', system-ui, -apple-system, sans-serif;

  /* ── Font sizes ── */
  --fs-sm:        11px;       /* hints, badges, labels */
  --fs-base:      13px;       /* body text */
  --fs-md:        14px;       /* input text, prominent body */

  /* ── Status colours ── */
  --color-ok:     #22cc66;    /* healthy / success */
  --color-warn:   #ffaa00;    /* caution */
  --color-bad:    #ff4444;    /* danger */
  --color-error:  #f04;       /* invalid / error */

  --max-w:        760px;
}

html { font-size: 16px; }

body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--text); }
h1 { font-size: 2rem;   margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin-bottom: 0.4rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }

p { margin-bottom: 1rem; }

/* ── Layout ───────────────────────────────────────────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.site-header .container {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1.5rem;
  align-items: center;
  max-width: 1200px;
  padding-right: 5rem; /* keeps content clear of the early-access ribbon */
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.site-title:hover { text-decoration: none; color: #fff; }

.main-nav { display: flex; gap: 1rem; flex: 1; align-items: center; }
.main-nav > a, .main-nav .nav-dropdown > a, .main-nav .nav-dropdown > span { color: var(--text-dim); font-size: 0.9rem; white-space: nowrap; }
.main-nav .nav-dropdown > span { cursor: default; }
.main-nav > a:hover, .main-nav > a.active,
.main-nav .nav-dropdown > a:hover, .main-nav .nav-dropdown > a.active,
.main-nav .nav-dropdown > span.active { color: var(--text-bright); text-decoration: none; }

.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 8px;
  min-width: 140px;
  z-index: 100;
}
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: 8px; left: 0; right: 0; bottom: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: -1;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu { display: flex; flex-direction: column; }
.nav-dropdown-menu a {
  position: relative;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active { color: var(--text-bright); text-decoration: none; background: var(--bg-card); }

.lang-switcher { display: flex; gap: 0.75rem; font-size: 0.85rem; }
.lang-switcher a { color: var(--text-dim); }
.lang-switcher a.active { color: var(--text-bright); font-weight: 600; }
.lang-switcher a:hover { text-decoration: none; color: var(--text-bright); }

/* ── Mobile nav ───────────────────────────────────────────────────────────── */

/* On desktop: flex wrapper so main-nav + lang-switcher occupy one grid cell */
.mobile-nav-overlay { display: flex; align-items: center; gap: 1.5rem; flex: 1; min-width: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px 10px;
  margin-left: auto;
}

/* On desktop, suppress the dropdown for any nav item whose children are shown in the subnav.
   pointer-events stays enabled so :hover fires for the subnav highlight below.
   Keep the arrow visible — it signals there is a submenu even when the subnav is active. */
@media (min-width: 701px) {
  .nav-dropdown.has-subnav .nav-dropdown-menu { display: none !important; }

  /* Highlight the entire subnav when hovering the active top-nav item */
  .container:has(.nav-dropdown.has-subnav:hover) .subnav {
    background: var(--bg-hover);
    border-radius: var(--radius);
  }
}

@media (max-width: 700px) {
  /* Revert header container from grid to flex for the mobile hamburger layout */
  .site-header .container { display: flex; align-items: center; gap: 1.5rem; }
  .site-header { position: relative; }
  .site-header .container { padding-right: 5rem; } /* padding prevents being hidden by the early access ribbon */

  .nav-toggle { display: block; }

  /* Overlay panel: hidden by default, absolutely positioned below header */
  .site-header .mobile-nav-overlay {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem 1rem;
    z-index: 200;
    gap: 0;
  }

  .site-header.nav-open .mobile-nav-overlay { display: flex; }

  /* Nav links inside the overlay */
  .site-header.nav-open .main-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: none;
    gap: 0;
  }

  .site-header.nav-open .main-nav > a,
  .site-header.nav-open .main-nav .nav-dropdown > a,
  .site-header.nav-open .main-nav .nav-dropdown > span { padding: 8px 0; }

  .site-header.nav-open .nav-dropdown { flex-direction: column; align-items: flex-start; }

  .site-header.nav-open .nav-dropdown-menu {
    display: flex !important;
    flex-direction: column;
    position: static;
    padding: 0 0 4px 1rem;
    min-width: unset;
  }

  .site-header.nav-open .nav-dropdown-menu::before { display: none; }

  /* Lang switcher at the bottom of the overlay */
  .site-header.nav-open .lang-switcher {
    display: flex;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
  }
}

/* ── React island spacing ─────────────────────────────────────────────────── */
/* Each page mounts into #react-app-{name} (not #root — that selector was dead). */
/* site-main top padding is suppressed on react-island pages; mount points carry */
/* their own 1rem top margin so all app pages have a uniform small gap.        */

[id^="react-app-"] { margin-top: 1rem; margin-bottom: 2rem; }
#react-app-share { margin-top: 0; margin-bottom: 0; }
.site-main:has([role="application"]) { padding-top: 0; }
.site-main:has([role="application"]) .container { max-width: 1400px; }

/* ── Main ─────────────────────────────────────────────────────────────────── */

.site-main { flex: 1; padding: 2.5rem 0; }

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-content { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.footer-brand { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; min-width: 0; }
.footer-title { font-weight: 600; color: var(--text-secondary); }

/* Share buttons */
.share-buttons { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
#social-share-buttons { display: contents; }
#social-share-buttons[hidden] { display: none; }
#native-share-btn[hidden] { display: none; }
.mastodon-widget { position: relative; }
.footer-social { display: flex; align-items: center; background: none; border: none; padding: 0; cursor: pointer; color: var(--text-muted); }
.footer-social:hover { color: var(--accent); }
.footer-social-icon { width: 1.4rem; height: 1.4rem; fill: currentColor; }

.mastodon-popover {
  position: absolute;
  bottom: calc(100% + 0.6rem);
  left: 0;
  min-width: 16rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 200;
}
.mastodon-follow-line {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.mastodon-profile-link {
  display: inline;
  color: var(--accent);
  text-decoration: none;
}
.mastodon-profile-link:hover { text-decoration: underline; }
.mastodon-divider { border: none; border-top: 1px solid var(--border); margin: 0.5rem 0; }
.mastodon-share-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.mastodon-share-row { display: flex; gap: 0.4rem; }
.mastodon-instance-input {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}
.mastodon-instance-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.mastodon-share-btn {
  flex-shrink: 0;
  font-size: 0.82rem;
  padding: 0.3rem 0.65rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.mastodon-share-btn:hover { opacity: 0.88; }

.footer-nav { display: flex; align-items: center; gap: 1.25rem; }
.footer-nav a { color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; letter-spacing: 0.03em; }
.footer-nav a:hover { color: var(--text-dim); text-decoration: none; }
.footer-hash { position: absolute; right: 0.5rem; bottom: 0.35rem; font-size: 0.7rem; color: var(--text-faint); font-family: monospace; }

/* ── Hero (home) ──────────────────────────────────────────────────────────── */

.hero { margin-bottom: 3rem; }
.hero h1 { font-size: 2.4rem; margin-bottom: 0.75rem; }
.hero-content { color: var(--text-muted); font-size: 1.05rem; }

/* ── Post card (list) ─────────────────────────────────────────────────────── */

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.post-card-body {
  padding: 1.25rem 1.5rem;
  overflow: hidden; /* contain the image float */
}

.post-card--foreign { border-color: var(--border-input); opacity: 0.85; }

/* Watermark overlay — dev only (draft/future pages excluded from prod builds) */
.wm-draft,
.wm-future {
  position: relative;
  --wm-size: 5rem;
  --wm-z: 3;
  --wm-draft-color: rgba(255, 80, 80, 0.60);
  --wm-future-color: rgba(255, 170, 0, 0.60);
}
.wm-draft::before,
.wm-future::before {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-size: var(--wm-size);
  font-weight: 900;
  pointer-events: none;
  white-space: nowrap;
  z-index: var(--wm-z);
  user-select: none;
}
.wm-draft::before           { content: "Draft";        color: var(--wm-draft-color); }
.wm-future::before          { content: "Future";       color: var(--wm-future-color); }
.wm-draft.wm-future::before { content: "Future Draft"; color: var(--wm-draft-color); }

/* Post cards: smaller canvas → more subtle */
.post-card.wm-draft,
.post-card.wm-future {
  --wm-size: 4rem;
  --wm-z: 10;
  --wm-draft-color: rgba(255, 80, 80, 0.18);
  --wm-future-color: rgba(255, 170, 0, 0.18);
}
body.future-page {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200'%3E%3Ctext x='200' y='100' text-anchor='middle' dominant-baseline='middle' transform='rotate(-30 200 100)' font-size='48' font-weight='900' fill='%23ffaa00' fill-opacity='0.22' font-family='sans-serif'%3EFuture%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}
body.draft-page {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='200'%3E%3Ctext x='160' y='100' text-anchor='middle' dominant-baseline='middle' transform='rotate(-30 160 100)' font-size='48' font-weight='900' fill='%23ff5050' fill-opacity='0.22' font-family='sans-serif'%3EDraft%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}
body.future-page.draft-page {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='200'%3E%3Ctext x='200' y='100' text-anchor='middle' dominant-baseline='middle' transform='rotate(-30 200 100)' font-size='48' font-weight='900' fill='%23ffaa00' fill-opacity='0.22' font-family='sans-serif'%3EFuture-Draft%3C/text%3E%3C/svg%3E");
  background-repeat: repeat;
}

.post-card h2, .post-card h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.post-card h2 a, .post-card h3 a { color: var(--text-bright); }
.post-card h2 a:hover, .post-card h3 a:hover { color: #fff; text-decoration: none; }

.post-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.6rem; }

.lang-badge {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.75rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-muted);
}

.post-summary { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }

.read-more { font-size: 0.85rem; color: var(--accent); }
.read-more:hover { text-decoration: underline; }

/* ── Post featured image (card thumbnail + single header) ────────────────── */

.post-card-image {
  float: right;
  width: 10rem;
  height: 10rem;
  overflow: hidden;
  border-radius: var(--radius);
  margin: 0.1rem 0 0.75rem 1.25rem;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

@media (min-width: 701px) {
  .post-card-body {
    position: relative;
    padding-right: calc(10rem + 2.75rem); /* image width + gap + original right padding */
    min-height: calc(10rem + 2 * 1.25rem); /* ensure body is never shorter than the image + top/bottom padding */
  }
  .post-card-image {
    float: none;
    position: absolute;
    top: 1.25rem; /* match body padding-top */
    right: 1.5rem; /* match body padding-right */
    margin: 0;
  }
}

@media (max-width: 700px) {
  .post-card-image {
    width: 40vw;
    height: auto;
    aspect-ratio: 1;
  }
}

.post-feature-image {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 1.5rem;
}

.post-feature-image img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

.post-feature-credit {
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-card);
}

/* Page banner — the same full-bleed treatment as a post's feature image, at half
   the height. Pages carry it via the `page-banner` shortcode, not frontmatter. */
.page-banner {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 1.5rem;
}

.page-banner img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
}

.page-banner-credit {
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-card);
}

.post-feature-credit a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* ── Podcast ──────────────────────────────────────────────────────────────── */

.podcast-ep-number { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 0.25rem; }
.podcast-duration  { color: var(--text-muted); font-size: 0.85rem; }

.podcast-player {
  margin-bottom: 1.5rem;
}

.podcast-player audio {
  width: 100%;
  max-width: 600px;
}

/* ── Article TOC (desktop gutter, fixed) ──────────────────────────────────── */

.article-toc { display: none; }

/* Gutter breakpoint, and the single place it is defined — draft-tags.html
   derives its own gutter/flow switch from this rule's computed `display`
   rather than repeating the number.
   380px is --max-w / 2, so the gutter is (viewport - content) / 2 minus the
   1rem margins on either side: 188px at 1200, growing from there. Below the
   breakpoint the TOC drops out entirely, by design.
   Mind the scrollbar when comparing against a reported width:
   window.innerWidth includes it, media queries don't, so a window reporting
   1215 matches at ~1200. */
@media (min-width: 1200px) {
  .article-toc {
    display: block;
    position: fixed;
    /* Anchored to viewport left; width fills the gutter up to 1rem from the container edge. */
    left: 1rem;
    width: calc(50% - 380px - 2rem);
    top: 5rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    scrollbar-width: thin;
    font-size: 0.78rem;
    line-height: 1.4;
  }
  .article-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--border-subtle);
  }
  .article-toc li { margin: 0; }
  .article-toc a {
    display: block;
    padding: 0.2rem 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color 0.15s;
  }
  .article-toc a:hover { color: var(--text-secondary); text-decoration: none; }
  .article-toc .toc-h1 > a { font-weight: 600; color: var(--text-secondary); }
  /* Indentation follows the heading level alone. Card labels used to get their
     own deeper indent because their level was hardcoded to h2 and therefore
     carried no structural information; partials/card-heading-level.html now
     derives it, so .toc-shortcode only marks them (parentheses in the label). */
  .article-toc .toc-h3 > a { padding-left: 1rem; }
  .article-toc .toc-h4 > a { padding-left: 2rem; }
  .article-toc a.toc-active { color: var(--accent); border-left-color: var(--accent); }
}

/* ── Draft-only tag list (rendered only with hugo -D) ─────────────────────── */

.draft-tags {
  margin: 0 0 1.5rem;
  padding: 0.6rem 0.85rem;
  border: 1px dashed var(--border-subtle);
  border-radius: 6px;
  font-size: 0.85rem;
}
.draft-tags-title {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.draft-tags ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.draft-tags a {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.draft-tags a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* Same breakpoint as .article-toc above — see the note there. */
@media (min-width: 1200px) {
  /* Sit in the left gutter, just below the TOC. `top` is set by JS. */
  .draft-tags {
    position: fixed;
    left: 1rem;
    width: calc(50% - 380px - 2rem);
    margin: 0;
    font-size: 0.78rem;
  }
}

/* ── Single post / page ───────────────────────────────────────────────────── */

.post-header, .page-header { margin-bottom: 1.5rem; }
.post-content, .page-content { max-width: 65ch; }
.post-content p, .page-content p { margin-bottom: 1rem; }

/* ── Blockquote ───────────────────────────────────────────────────────────── */

blockquote {
  position: relative;
  max-width: 48ch;
  margin: 1.75rem auto 1.75rem 3ch;
  padding: 1rem 0.5rem 1rem 1.5rem;
  color: var(--text-secondary);
}

blockquote::before,
blockquote::after {
  position: absolute;
  font-style: normal;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent-secondary);
  opacity: 0.6;
}

/* German opening low-9 quotation mark „ — anchored to top-left */
blockquote::before {
  content: '\201E';
  top: -0.45em;
  left: -0.55em;
}

/* German closing quotation mark " — anchored to bottom-right */
blockquote::after {
  content: '\201C';
  bottom: 0em;
  right: -0.3em;
}

/* ── Content aside (info box) ────────────────────────────────────────────── */

aside.content-aside {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-left: 3px solid var(--accent-secondary);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

aside.content-aside p:last-child { margin-bottom: 0; }

/* ── Post references / footnotes ────────────────────────────────────────── */

footer.post-references {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer.post-references p:last-child { margin-bottom: 0; }

a.fn-ref {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85em;
}

a.fn-ref:hover { text-decoration: underline; }

/* ── Inline content images ───────────────────────────────────────────────── */

figure.inline-image {
  float: right;
  width: 50%;
  margin: 0 0 1rem 1.5rem;
}

figure.inline-image img,
figure.inline-image .inline-image-svg svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
}

figure.inline-image .inline-image-svg {
  display: block;
}

.inline-image-wrap {
  position: relative;
  display: block;
}

.inline-image-attr {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
}

.inline-image-attr-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 700;
  cursor: default;
  user-select: none;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.inline-image-attr:hover .inline-image-attr-icon {
  opacity: 1;
}

.inline-image-attr-tooltip {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-tooltip);
  border-radius: var(--radius);
  padding: 0.35rem 0.6rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.inline-image-attr:hover .inline-image-attr-tooltip {
  opacity: 1;
  pointer-events: auto;
}

.inline-image-attr-tooltip span {
  display: block;
}

.inline-image-attr-tooltip a {
  color: var(--text-secondary);
}

figure.inline-image figcaption {
  padding: 0.3rem 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  figure.inline-image {
    float: none;
    width: 100%;
    margin-left: 0;
  }
}

/* ── embedded simulation ──────────────────────────────────────────────────── */

figure.sim-embed {
  margin: 0;
}

.sim-embed-frame-wrap {
  position: relative;
}

.sim-embed-open {
  position: absolute;
  bottom: 1rem; /* overridden by sim-embed-toggle-mid postMessage once iframe loads */
  right: 0.75rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

figure.sim-embed:hover .sim-embed-open {
  opacity: 1;
  pointer-events: auto;
}

figure.sim-embed figcaption {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ── Glossary terms ───────────────────────────────────────────────────────── */

.glossary-term {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  display: inline;
  vertical-align: baseline;
  text-decoration: underline dotted var(--accent);
  text-underline-offset: 3px;
  cursor: help;
}

@position-try --gp-fit {
  inset: auto;
  top: anchor(bottom);
  left: anchor(left);
  right: 0.5rem;
  width: auto;
}

@position-try --gp-fit-above {
  inset: auto;
  bottom: anchor(top);
  left: anchor(left);
  right: 0.5rem;
  width: auto;
}

.glossary-popup {
  /* reset UA popover defaults (inset:0; margin:auto; border:solid; padding:.25em) */
  position: fixed;
  inset: auto;
  margin: 0;
  border: 1px solid var(--border-input);
  padding: 0.6rem 0.8rem;

  top: anchor(bottom);
  left: anchor(left);
  position-try-fallbacks: --gp-fit, flip-block, --gp-fit-above;

  width: max-content;
  max-width: 28ch;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-style: normal;
  color: var(--text-secondary);
  line-height: 1.55;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.glossary-term--missing {
  color: var(--color-error);
}

/* {{< nobr >}} - keep a short phrase on one line; break before it instead */
.nobr {
  white-space: nowrap;
}

.emoji-inline {
  white-space: nowrap;
}

.emoji-stack {
  display: block;
  white-space: pre-line;
}

.emoji-missing {
  background: var(--color-error);
  color: #fff;
  padding: 0 0.3em;
  border-radius: var(--radius-sm);
  font-family: monospace;
  white-space: nowrap;
}

.glossary-popup a {
  display: block;
  margin-top: 0.4rem;
  color: var(--accent);
  font-size: var(--fs-sm);
  text-decoration: none;
}

.glossary-popup a:hover { text-decoration: underline; }

/* ── List styling (prose pages and react-island page prose) ───────────────── */
.post-content ul, .post-content ol,
.page-content ul, .page-content ol,
.site-main .container > ul,
.site-main .container > ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.post-content li, .page-content li,
.site-main .container > ul li,
.site-main .container > ol li { margin-bottom: 0.25rem; }
.post-content ul ul, .post-content ol ul, .post-content ul ol, .post-content ol ol,
.page-content ul ul, .page-content ol ul, .page-content ul ol, .page-content ol ol,
.site-main .container > ul ul, .site-main .container > ul ol,
.site-main .container > ol ul, .site-main .container > ol ol {
  padding-left: 1.25rem; margin-bottom: 0;
}

/* ── Width-constrain prose in react-island pages ─────────────────────────── */
/* Targets direct container children (prose below the React app), not #root  */
.site-main .container > p,
.site-main .container > ul,
.site-main .container > ol,
.site-main .container > h2,
.site-main .container > h3 { max-width: 65ch; }

/* ── Language notice (foreign-language post) ──────────────────────────────── */

.lang-notice {
  background: var(--bg-hover);
  border-left: 3px solid var(--accent-dim);
  border-radius: 0 6px 6px 0;
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Screenshot ───────────────────────────────────────────────────────────── */

.screenshot-tilt {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.5);
  transform: rotate(-2deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.screenshot-tilt:hover {
  transform: rotate(0deg);
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.3);
}

/* (recent-posts styles moved to landing page section below) */

/* ── Feedback widget ──────────────────────────────────────────────────────── */

#fb-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(67,97,238,0.4);
  transition: background 0.15s, transform 0.15s;
  letter-spacing: 0.02em;
}
#fb-btn:hover { background: var(--accent-dim); transform: translateY(-1px); }

#fb-panel {
  display: none;
  position: fixed;
  bottom: 72px;
  right: 24px;
  z-index: 1000;
  width: 340px;
  background: var(--bg-hover);
  border: 1px solid var(--border-input);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
}
#fb-panel.open { display: flex; flex-direction: column; }

#fb-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
#fb-panel-head h3 { margin: 0; font-size: 15px; color: var(--text-bright); font-weight: 600; }
#fb-close { background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; padding: 0 2px; line-height: 1; }
#fb-close:hover { color: var(--text-secondary); }

#fb-panel-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }

#fb-panel-body p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

#fb-message {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 7px;
  color: var(--text-bright);
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 90px;
  outline: none;
  font-family: inherit;
}
#fb-message:focus { border-color: var(--accent); }

#fb-email {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: 7px;
  color: var(--text-bright);
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
}
#fb-email:focus { border-color: var(--accent); }
#fb-email::placeholder { color: var(--text-faint); }

#fb-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#fb-submit:hover:not(:disabled) { background: var(--accent-dim); }
#fb-submit:disabled { opacity: 0.5; cursor: default; }

#fb-status { font-size: 13px; text-align: center; min-height: 18px; }
#fb-status.ok  { color: var(--color-ok); }
#fb-status.err { color: var(--color-error); }

@media (max-width: 400px) {
  #fb-panel { right: 8px; left: 8px; width: auto; }
  #fb-btn   { right: 12px; bottom: 16px; }
}

/* ── GIS second-level navigation ──────────────────────────────────────────── */

.subnav {
  grid-column: 2;
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  transition: background 0.15s;
}

.subnav-tab {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.subnav-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.subnav-tab.active {
  color: var(--text-bright);
  background: var(--bg-hover);
  border-bottom-color: var(--accent);
  border-radius: var(--radius) var(--radius) 0 0;
}

@media (max-width: 700px) {
  .subnav { display: none; }
}

/* ── Content sidebar ──────────────────────────────────────────────────────── */

.sidebar-toggle {
  position: fixed;
  top: 7rem;
  right: 1rem;
  z-index: 500;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.sidebar-toggle:hover { color: var(--text-bright); border-color: var(--accent); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 7999;
  background: rgba(0, 0, 0, 0.45);
}
body.sidebar-open .sidebar-backdrop { display: block; }

.page-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(550px, 92vw);
  height: 100dvh;
  z-index: 8000;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
body.sidebar-open .page-sidebar { transform: translateX(0); }

.sidebar-header {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  line-height: 1;
}
.sidebar-close:hover { color: var(--text-bright); }

.sidebar-content {
  padding: 1.25rem 1.5rem 2rem;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.sidebar-content h2 {
  font-size: 1rem;
  color: var(--text-bright);
  margin: 1.5rem 0 0.4rem;
  letter-spacing: 0.05em;
}
.sidebar-content h2:first-child { margin-top: 0; }
.sidebar-content p { margin: 0 0 0.75rem; }
.sidebar-content ul { margin: 0 0 0.75rem; padding-left: 1.2rem; }
.sidebar-content li { margin-bottom: 0.3rem; }

/* ── Sidebar accordion sections ──────────────────────────────────────────────── */
.sidebar-section:first-child .sidebar-section-h2 { margin-top: 0; }
.sidebar-section-h2 {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  user-select: none;
}
.sidebar-section-h2::after {
  content: '▶';
  font-size: 0.6em;
  color: var(--text-dim);
  flex-shrink: 0;
  margin-left: 0.5rem;
  display: inline-block;
  transition: transform 0.2s;
}
.sidebar-section.expanded .sidebar-section-h2::after {
  transform: rotate(90deg);
}
.sidebar-section-h2:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.sidebar-section-body {
  position: relative;
  max-height: 4em;
  overflow: hidden;
  transition: max-height 0.3s ease;
  cursor: pointer;
}
.sidebar-section.expanded .sidebar-section-body {
  max-height: 2000px;
  cursor: auto;
}
.sidebar-section-body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3.7em;
  background: linear-gradient(transparent, var(--bg-card));
  pointer-events: none;
}
.sidebar-section.expanded .sidebar-section-body::after {
  display: none;
}

/* ── Simulation two-column layout (Phase 17) ─────────────────────────────── */
/* Mobile: chart on top, controls below (DOM order).                           */
/* Desktop (≥ 960 px): controls left (35 %), chart right (65 %), chart sticky. */

.sim-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 960px) {
  .sim-layout {
    grid-template-columns: 40fr 60fr;
    align-items: start;
  }
  .sim-layout.sim-layout--equal {
    grid-template-columns: 1fr 1fr;
  }
  .sim-layout > .sim-controls  { grid-column: 1; grid-row: 1; }
  .sim-layout > .sim-chart-col {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 1rem;
  }
}

/* ── Landing page (Phase 27) ──────────────────────────────────────────────── */

.landing-hero {
  padding: 4rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3rem;
}
.landing-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.landing-tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 1.25rem;
}
.landing-intro {
  max-width: 54ch;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
}

/* ── Shared landing section label ─────────────────────────────────────────── */

.landing-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ── Landing page vertical rhythm ─────────────────────────────────────────── */

/* Shortcodes that appear both on the landing page and inside articles need two
   different spacings: in an article each is an inline interruption of the prose
   flow, on the landing page each is a peer section in a 3rem stack alongside
   .landing-hero and .landing-block. This is derived from context rather than
   passed as a shortcode parameter, so no call site has to know about it.
   .post-slider-wrap also covers tag-slider, which renders via the same partial. */
.landing-page .editorial-pick,
.landing-page .post-slider-wrap,
.landing-page .sim-embed,
.landing-page .recent-posts-section { margin-bottom: 3rem; }

/* ── Editorial pick shortcode ─────────────────────────────────────────────── */

.editorial-pick { margin-bottom: 1rem; padding-bottom: 1rem; }
.editorial-pick-inner {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 2rem;
  align-items: start;
}
.editorial-pick-image img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}
/* Title level varies with the card's position in the outline - see
   partials/card-heading-level.html - so match by level range, not a fixed tag. */
.editorial-pick-body h2, .editorial-pick-body h3, .editorial-pick-body h4 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.editorial-pick-body h2 a, .editorial-pick-body h3 a, .editorial-pick-body h4 a { color: var(--text-bright); }
.editorial-pick-body h2 a:hover, .editorial-pick-body h3 a:hover, .editorial-pick-body h4 a:hover { color: #fff; text-decoration: none; }
.editorial-pick-summary { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.editorial-pick-text {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
/* Without title and summary the text block is the first thing in the body —
   its separator rule would then divide it from nothing. */
.editorial-pick-text:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.editorial-pick-text h2, .editorial-pick-text h3 {
  font-size: 1rem;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
  margin-top: 0.75rem;
}
.editorial-pick-text h2:first-child,
.editorial-pick-text h3:first-child { margin-top: 0; }

/* ── Landing block (illustration + text) shortcode ────────────────────────── */

.landing-block {
  margin-bottom: 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}
.landing-block-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}
.landing-block-text h2 { font-size: 1.4rem; margin-bottom: 0.5rem; color: var(--text-bright); }
.landing-block-text p  { color: var(--text-secondary); margin-bottom: 0.75rem; }
.landing-block-text ul, .landing-block-text ol { color: var(--text-secondary); padding-left: 1.25rem; margin-bottom: 0.75rem; }
.landing-block-text--full { max-width: 65ch; }

.landing-block-cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  margin-top: 0.5rem;
  transition: opacity 0.15s;
}
.landing-block-cta:hover { opacity: 0.88; text-decoration: none; color: #fff; }
.landing-block-image { text-align: center; }
.landing-block-image img {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: 4px 8px 24px rgba(0,0,0,0.4);
}

/* ── Post slider shortcode ────────────────────────────────────────────────── */

.post-slider-wrap { position: relative; margin-bottom: 2rem; }
.post-slider-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: var(--radius);
}
.post-slider-track::-webkit-scrollbar { display: none; }
.post-slider-slide {
  flex-shrink: 0;
  width: 100%;
  min-height: 360px;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: var(--radius);
  text-decoration: none;
}
.post-slider-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-slider-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.7) 55%, transparent 100%);
}
.post-slider-title {
  display: block;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.post-slider-title:hover { color: #fff; text-decoration: underline; }
.post-slider-summary { color: rgba(255,255,255,0.82); font-size: 0.88rem; line-height: 1.5; }
.post-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.post-slider-btn:hover { background: rgba(0,0,0,0.7); }
.post-slider-btn--prev { left: 0.6rem; }
.post-slider-btn--next { right: 0.6rem; }
.post-slider-dots { display: flex; justify-content: center; gap: 6px; margin-top: 0.75rem; }
.post-slider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-input);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.post-slider-dot.active { background: var(--accent); }

/* ── Pagination ───────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}
.pagination-btn {
  color: var(--accent);
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.pagination-btn:hover { background: var(--bg-hover); text-decoration: none; }
.pagination-info { color: var(--text-muted); }

/* ── Recent posts section (home and recent-posts shortcode) ───────────────── */

.recent-posts-section > p { margin-top: 0.5rem; font-size: 0.9rem; }

@media (max-width: 700px) {
  .landing-hero h1 { font-size: 2rem; }
  .editorial-pick-inner { grid-template-columns: 1fr; }
  .landing-block-inner { grid-template-columns: 1fr; }
  .landing-block-image img { max-height: 200px; object-fit: cover; }
  .post-slider-slide { min-height: 260px; }
}

/* ── Embed mode ────────────────────────────────────────────────────────────── */
/* Applied by SharePage when ?embed=1 is detected. Hides site chrome so the   */
/* page renders cleanly inside an <iframe>.                                    */

body.embed-mode .site-header,
body.embed-mode .site-footer,
body.embed-mode .corner-ribbon,
body.embed-mode #dev-ribbon,
body.embed-mode #fb-btn,
body.embed-mode #fb-panel,
body.embed-mode .subnav {
  display: none !important;
}

body.embed-mode {
  min-height: 0;
  padding-bottom: 0.5rem;
}

body.embed-mode .site-main {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

body.embed-mode .container {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* ── Share page ────────────────────────────────────────────────────────────── */

body.embed-mode .share-header { display: none; }

/* ── YouTube embed (privacy facade) ─────────────────────────────────────────
   No YouTube contact until the user clicks. Thumbnail served from static/.    */

figure.yt-embed {
  margin: 1.5rem 0;
}

figure.yt-embed--inline {
  float: right;
  margin: 0 0 1rem 1.5rem;
}

.yt-embed__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}

.yt-embed__frame--portrait {
  aspect-ratio: 9 / 16;
}

.yt-embed__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.yt-embed__frame:hover .yt-embed__thumb,
.yt-embed__frame:focus-visible .yt-embed__thumb {
  opacity: 0.85;
}

.yt-embed__notice {
  position: absolute;
  bottom: 20%;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.3rem;
  text-align: center;
  padding: 0.2rem 0.5rem;
  pointer-events: none;
}

.yt-embed__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.yt-embed__play svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transition: transform 0.15s;
}

.yt-embed__frame:hover .yt-embed__play svg,
.yt-embed__frame:focus-visible .yt-embed__play svg {
  transform: scale(1.1);
}

.yt-embed__frame:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

figure.yt-embed figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

@media (max-width: 480px) {
  figure.yt-embed--inline {
    float: none;
    margin-left: 0;
    margin-right: 0;
  }
  /* Landscape: expand to full width */
  figure.yt-embed--inline:not(.yt-embed--portrait) {
    max-width: 100% !important;
  }
  /* Portrait (Shorts): stay at the specified width and center */
  figure.yt-embed--inline.yt-embed--portrait {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Ends float wrapping after a constrained/floated embed. See the {{< clear >}}
   shortcode. */
.clear-floats {
  clear: both;
}

/* Full-width article sections must never wrap beside a floated embed
   (figure.yt-embed--inline floats right). */
.post-references,
.post-slider-wrap {
  clear: both;
}

/* A new section heading breaks fully below a floated embed instead of wrapping
   beside it. Scoped to direct children so shortcode labels (.landing-label,
   nested in their own wrappers) are not affected. */
.post-content > h2,
.post-content > h3,
.page-content > h2,
.page-content > h3 {
  clear: both;
}

ul.tag-terms {
  list-style-type: none;
}

ul.tag-terms > li {
  font-size: 1.5rem;
  font-weight: bold;
}

ul.tag-terms > li > ul {
  font-size: 1rem;
  font-weight: normal;
}

/* ── Spoiler (click-to-reveal) ───────────────────────────────────────────── */

.spoiler {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-left: 3px solid var(--color-warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.spoiler-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.spoiler-label > p:last-child { margin-bottom: 0; }

/* The summary IS the button, which is what makes this work without JS.
   Two rules kill the disclosure triangle: any `display` other than `list-item`
   drops it in Firefox/Chrome, and `::-webkit-details-marker` covers the older
   WebKit that ignores the display change. */
.spoiler-button {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.spoiler-button::-webkit-details-marker { display: none; }

.spoiler-button:hover { background: var(--accent-dim); }

.spoiler-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Only the label for the current state is shown; the button stays in place and
   keeps focus when toggled, so the reveal never strands a keyboard user. */
.spoiler-details[open] .spoiler-button-show,
.spoiler-details:not([open]) .spoiler-button-hide { display: none; }

.spoiler-details[open] .spoiler-button {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-input);
  padding: 7px 17px;   /* 1px less than closed, to absorb the border */
  font-weight: 500;
}

.spoiler-details[open] .spoiler-button:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.spoiler-content {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.spoiler-content > :last-child { margin-bottom: 0; }
