/* =============================================================================
   Nexus — a modern literary archive theme
   All theme tokens live at the top. Change them here to retheme the whole site.
   ============================================================================= */

:root {
  /* ---------- Color (warm paper + dark charcoal + muted accents) ----------- */
  --paper:        #F6F1E6;    /* page background */
  --paper-2:      #EFE8D9;    /* quiet surfaces (cards, rails) */
  --paper-3:      #E6DECB;    /* deeper surface */
  --ink:          #28261F;    /* body text — not pure black */
  --ink-2:        #5A5246;    /* secondary / meta text */
  --ink-3:        #8B8170;    /* tertiary / captions */
  --rule:         #D9CFBD;    /* borders, dividers */
  --rule-strong:  #B8AC93;
  --accent:       #2E5D59;    /* dark teal */
  --accent-ink:   #1F4542;    /* accent on hover */
  --accent-2:     #8A5A3B;    /* bronze / copper secondary accent */
  --highlight:    #F1E4C4;    /* soft highlight for callouts */
  --danger:       #8B3A3A;

  /* ---------- Typography ----------
     Ghost 6's font picker (Admin → Design → Typography) injects
     `--gh-font-heading` and `--gh-font-body` via {{ghost_head}} when the
     user picks something other than "Theme default". We reference those
     variables here so the picker actually has an effect, falling back to
     Nexus's serif defaults (Cormorant Garamond + Source Serif 4) when
     no override is set.

     Notes:
     - Ghost's picker only covers heading + body. UI / metadata text
       stays on Inter regardless — small chrome shouldn't shift around
       when you experiment with reading fonts.
     - Type scale (--fs-*), line heights, and the drop cap are tuned for
       serifs. Picking a sans-serif body font will work, but the rhythm
       was designed for serifs; expect a different (not necessarily
       worse) feel. */
  --font-display: var(--gh-font-heading, 'Cormorant Garamond', 'Georgia', serif);
  --font-body:    var(--gh-font-body, 'Source Serif 4', 'Georgia', serif);
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Fluid type scale: min (mobile) → max (desktop) via viewport width */
  --fs-meta:    0.78rem;
  --fs-body:    clamp(1.0625rem, 0.98rem + 0.35vw, 1.1875rem);   /* 17 → 19 */
  --fs-lead:    clamp(1.1875rem, 1.06rem + 0.55vw, 1.375rem);
  --fs-h4:      clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --fs-h3:      clamp(1.25rem, 1.12rem + 0.6vw, 1.5rem);
  --fs-h2:      clamp(1.5rem, 1.25rem + 1.1vw, 2rem);
  --fs-h1:      clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  --fs-display: clamp(2.25rem, 1.3rem + 4.2vw, 4.25rem);

  --lh-tight:   1.15;
  --lh-body:    1.65;
  --lh-display: 1.08;

  /* ---------- Spacing / layout ---------- */
  --gutter:     clamp(1.1rem, 1rem + 1.2vw, 2rem);
  --stack-sm:   0.5rem;
  --stack:      1rem;
  --stack-md:   1.5rem;
  --stack-lg:   2.5rem;
  --stack-xl:   4rem;
  --stack-2xl:  6rem;

  --content-width:   40rem;    /* ~640px — classic long-read column */
  --wide-width:      56rem;    /* pullouts, galleries */
  --shell-width:     74rem;    /* overall page shell */
  --rail-width:      15rem;    /* desktop TOC rail */

  --radius-sm:  4px;
  --radius:     6px;
  --radius-lg:  10px;

  --shadow-card: 0 1px 0 rgba(30, 26, 18, 0.04), 0 6px 24px -12px rgba(30, 26, 18, 0.16);

  --ease:       cubic-bezier(.2,.6,.2,1);
}

/* ============================================================================= */
/* Base reset */
/* ============================================================================= */

*, *::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.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-feature-settings: "kern", "liga", "onum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; height: auto; display: block; }
svg { display: block; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--stack-lg) 0; }

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.18s var(--ease);
}
a:hover { color: var(--accent-ink); }

::selection { background: var(--highlight); color: var(--ink); }

button { font: inherit; cursor: pointer; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; z-index: 1000;
  font-family: var(--font-ui); font-size: 0.9rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

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

/* ============================================================================= */
/* Layout shell */
/* ============================================================================= */

.shell {
  width: 100%;
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.site-main { min-height: 60vh; }

/* ============================================================================= */
/* Site header & nav */
/* ============================================================================= */

.site-header {
  padding: clamp(1rem, 0.5rem + 1vw, 1.5rem) 0;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(120%) blur(6px);
  background-color: rgba(246, 241, 230, 0.88);
}

.site-header__inner {
  display: flex; align-items: center;
  gap: 1rem;
}

.site-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.site-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 1.25rem; align-items: center;
}
.site-nav a {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  letter-spacing: 0.01em;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* Submenus.
   Built client-side by main.js when a nav item's label starts with `--`.
   The parent <li> gets `.has-submenu`, and a nested <ul.site-nav__submenu>
   is appended to it. Desktop: dropdown panel revealed on hover/focus.
   Mobile (inside the open menu): nested indented list, always visible. */
.site-nav .has-submenu { position: relative; }

/* Chevron after parent links that have a submenu. Only added when JS
   has actually identified children, so links without children stay clean. */
.site-nav .has-submenu > a::after {
  content: "";
  display: inline-block;
  margin-left: 0.4em;
  width: 0.4em;
  height: 0.4em;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.7;
}

.site-nav .site-nav__submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 781px) {
  .site-nav .site-nav__submenu {
    position: absolute;
    top: 100%;
    left: -0.75rem;
    min-width: 12rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem 0;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px -16px rgba(0, 0, 0, 0.25);
    z-index: 60;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  }
  .site-nav .has-submenu:hover > .site-nav__submenu,
  .site-nav .has-submenu:focus-within > .site-nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .site-nav .site-nav__submenu li { width: 100%; }
  .site-nav .site-nav__submenu a {
    display: block;
    padding: 0.5rem 0.9rem;
    width: 100%;
    font-size: 0.88rem;
    border-bottom: 0;
  }
  .site-nav .site-nav__submenu a:hover {
    color: var(--accent);
    background: var(--paper-2);
    border-bottom-color: transparent;
  }
}

/* Search button. `margin-left: auto` does the work previously done by
   justify-content: space-between on the header — it pushes itself (and
   everything after it) to the right edge. Icon-only, quiet by default,
   accent border + color on hover/focus. */
.site-search {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.site-search:hover,
.site-search:focus-visible {
  color: var(--accent);
  border-color: var(--rule);
  outline: none;
}
.site-search svg { display: block; }

.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--rule);
  padding: 0.45rem 0.6rem; border-radius: var(--radius-sm);
  color: var(--ink);
}
.nav-toggle:hover { border-color: var(--rule-strong); }

@media (max-width: 780px) {
  .site-header__inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 0.4rem; }
  .site-nav {
    flex-basis: 100%;
    display: none;
    border-top: 1px solid var(--rule);
    margin-top: 0.75rem; padding-top: 0.75rem;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul {
    flex-direction: column; align-items: flex-start; gap: 0;
    width: 100%;
  }
  .site-nav li { width: 100%; }
  .site-nav a { display: block; width: 100%; padding: 0.75rem 0; font-size: 1rem; }

  /* Mobile submenus: nested, indented, always visible (the menu itself
     is the toggle). Hide the desktop chevron — context makes the
     hierarchy obvious from indentation alone. */
  .site-nav .has-submenu > a::after { display: none; }
  .site-nav .site-nav__submenu {
    display: flex;
    flex-direction: column;
    padding: 0 0 0.25rem 1rem;
    margin-left: 0.25rem;
    border-left: 1px solid var(--rule);
  }
  .site-nav .site-nav__submenu a {
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--ink-3);
  }
  .site-nav .site-nav__submenu a:hover {
    color: var(--ink);
  }
}

/* ============================================================================= */
/* Site footer */
/* ============================================================================= */

.site-footer {
  margin-top: var(--stack-2xl);
  padding: var(--stack-xl) 0 var(--stack-lg);
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ink-2);
}
.site-footer__grid {
  display: grid;
  gap: var(--stack-lg);
  grid-template-columns: 1.2fr 1fr 1fr;
}
@media (max-width: 780px) {
  .site-footer__grid { grid-template-columns: 1fr; }
}
.site-footer h4 {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0.25rem 0; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer__bottom {
  margin-top: var(--stack-lg);
  padding-top: var(--stack);
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--ink-3);
}
.site-footer .site-title { font-size: 1.5rem; }

/* ============================================================================= */
/* Homepage */
/* ============================================================================= */

.home-intro {
  padding: clamp(3rem, 4vw + 2rem, 6rem) 0 clamp(2rem, 3vw + 1rem, 4rem);
  border-bottom: 1px solid var(--rule);
}
.home-intro__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  max-width: 18ch;
}
.home-intro__title em { color: var(--accent); font-style: italic; font-weight: 500; }
.home-intro__lead {
  font-size: var(--fs-lead);
  color: var(--ink-2);
  max-width: 44ch;
  margin: 0 0 1.75rem;
  line-height: 1.45;
}
.home-intro__paths {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  font-family: var(--font-ui);
}

.section {
  padding: var(--stack-xl) 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: var(--stack-md);
  flex-wrap: wrap;
}
.section__eyebrow {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.4rem;
}
.section__title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 600;
  line-height: var(--lh-tight);
  margin: 0;
  color: var(--ink);
}
.section__title em { color: var(--accent); font-style: italic; font-weight: 500; }
.section__link {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
}
.section__link:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Paths / featured cards grid */
.paths {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.path {
  display: block;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.path:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--paper);
}
.path__eyebrow {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.path__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
.path__desc {
  color: var(--ink-2); font-size: 0.95rem; margin: 0;
  line-height: 1.5;
}

/* Featured series list (structured, text-first) */
.series-list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Umbrella-grouped series in the archive: stacked groups, each with a head */
.series-groups { display: block; }
.series-umbrella-group { margin: 0 0 var(--stack-lg); }
.series-umbrella-group__head {
  border-top: 1px solid var(--rule-strong);
  padding-top: 0.75rem;
  margin-bottom: 1rem;
}
.series-umbrella-group__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1.1rem + 0.8vw, 1.75rem);
  font-weight: 600; font-style: italic;
  color: var(--accent);
  margin: 0;
  line-height: 1.2;
}
.series-umbrella-group__title a {
  color: inherit; text-decoration: none;
  border-bottom: 1px solid transparent;
}
.series-umbrella-group__title a:hover {
  border-bottom-color: var(--accent);
}
.series-umbrella-group__desc {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0.25rem 0 0;
  max-width: 52ch;
}
.series-card {
  border-top: 2px solid var(--accent);
  padding-top: 1rem;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.series-card__kicker {
  font-family: var(--font-ui); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
}
.series-card__title {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 600;
  line-height: 1.2; margin: 0;
}
.series-card__title a { color: var(--ink); text-decoration: none; }
.series-card__title a:hover { color: var(--accent); }
.series-card__desc { color: var(--ink-2); font-size: 0.95rem; margin: 0; }
.series-card__meta {
  font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-3);
  margin-top: 0.3rem;
}

/* Topics (tag cloud-lite, text-first) */
.topics {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem;
}
.topic {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  line-height: 1;
  transition: all 0.18s var(--ease);
}
.topic:hover { border-color: var(--accent); color: var(--accent); background: var(--paper); }
.topic__count {
  color: var(--ink-3);
  margin-left: 0.4rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
}

/* Recent posts: text-first list */
.post-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.post-list > li + li {
  border-top: 1px solid var(--rule);
}
.post-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1.5rem;
  padding: 1.25rem 0;
  align-items: baseline;
}
.post-list-item__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  grid-column: 1;
}
.post-list-item__title a { color: var(--ink); text-decoration: none; }
.post-list-item__title a:hover { color: var(--accent); }
.post-list-item__excerpt {
  grid-column: 1;
  margin: 0.25rem 0 0;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 62ch;
}
.post-list-item__meta {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--ink-3);
  white-space: nowrap;
  text-align: right;
  display: flex; flex-direction: column; gap: 0.2rem;
  align-self: start;
  padding-top: 0.4rem;
}
.post-list-item__meta .type {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
}
@media (max-width: 640px) {
  .post-list-item { grid-template-columns: 1fr; }
  .post-list-item__meta {
    grid-column: 1; grid-row: auto;
    text-align: left; flex-direction: row; gap: 0.75rem;
    padding-top: 0;
  }
}

/* Post cards (used on home "recent") with optional thumbnail */
.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule);
}
.post-card:last-child { border-bottom: 0; }
.post-card__thumb {
  width: 100%; aspect-ratio: 3 / 2;
  overflow: hidden; border-radius: var(--radius);
  background: var(--paper-2);
  margin-bottom: 0.75rem;
  display: none; /* thumbnails opt-in; archives stay text-first */
}
.post-card--with-thumb .post-card__thumb { display: block; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__meta {
  font-family: var(--font-ui); font-size: 0.78rem; color: var(--ink-3);
  letter-spacing: 0.06em;
}
.post-card__meta .type {
  color: var(--accent); text-transform: uppercase; font-weight: 600;
  letter-spacing: 0.14em; font-size: 0.7rem; margin-right: 0.75rem;
}
.post-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 1.1rem + 0.6vw, 1.7rem);
  font-weight: 600; line-height: 1.25; margin: 0.2rem 0 0.35rem;
}
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--ink-2); font-size: 1rem; line-height: 1.55; margin: 0; max-width: 60ch; }

/* ============================================================================= */
/* Buttons */
/* ============================================================================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
  min-height: 44px;  /* accessible tap target */
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.btn--ghost {
  background: transparent; color: var(--ink);
}
.btn--ghost:hover { background: var(--paper-2); border-color: var(--ink); color: var(--ink); }
.btn--accent {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn--accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--sm { padding: 0.5rem 0.85rem; font-size: 0.82rem; min-height: 36px; }

/* ============================================================================= */
/* Subscribe block */
/* ============================================================================= */

.subscribe {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  margin: var(--stack-xl) auto;
  max-width: var(--wide-width);
  text-align: left;
}
.subscribe__eyebrow {
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
  margin: 0 0 0.5rem;
}
.subscribe__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);
  font-weight: 600; line-height: 1.2; margin: 0 0 0.5rem;
  max-width: 26ch;
}
.subscribe__title em { color: var(--accent); font-style: italic; font-weight: 500; }
.subscribe__lead { color: var(--ink-2); margin: 0 0 1.25rem; max-width: 50ch; }
.subscribe__form {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: stretch;
}
.subscribe__form input[type=email] {
  flex: 1 1 16rem;
  font: inherit; font-family: var(--font-ui);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--rule-strong);
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
}
.subscribe__form input[type=email]:focus { border-color: var(--accent); outline: none; }

/* State machine driven by Ghost Portal.
   Portal adds .success / .error / .loading classes to the form on submit. */
.subscribe__btn-loading { display: none; }
.subscribe__form.loading .subscribe__btn-label { display: none; }
.subscribe__form.loading .subscribe__btn-loading { display: inline; }
.subscribe__form.loading button[type=submit] { opacity: 0.7; pointer-events: none; }

.subscribe__note {
  font-family: var(--font-ui); font-size: 0.85rem;
  margin: 0.75rem 0 0;
  display: none;
}
.subscribe__note--success { color: var(--accent); font-weight: 500; }
.subscribe__note--error   { color: #b4452a; }
.subscribe__form.success + .subscribe__note--success { display: block; }
.subscribe__form.error   ~ .subscribe__note--error   { display: block; }
.subscribe__form.success { display: none; }

.subscribe__footer {
  font-family: var(--font-ui); font-size: 0.82rem; color: var(--ink-3);
  margin: 1rem 0 0;
}
.subscribe__footer a {
  color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
.subscribe__footer a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Accessible visually-hidden helper */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ============================================================================= */
/* Post — shared layout */
/* ============================================================================= */

.post {
  /* data attributes drive feature flags */
}

/* Post HERO — Essay / Review cinematic variant */
.post-hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}
.post-hero--cinematic {
  min-height: 72svh;
  display: flex; align-items: flex-end;
  padding: clamp(2.5rem, 4vw, 6rem) 0 clamp(2rem, 3vw, 4rem);
  margin-top: -1px; /* butt-up to header border */
}
.post-hero__img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  background-color: var(--ink);
}
.post-hero__overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg,
      rgba(20,18,14,0.10) 0%,
      rgba(20,18,14,0.00) 22%,
      rgba(20,18,14,0.00) 48%,
      rgba(20,18,14,0.55) 85%,
      rgba(20,18,14,0.72) 100%
    );
}
.post-hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.post-hero__eyebrow {
  font-family: var(--font-ui);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.82);
  margin: 0 0 1rem;
  display: inline-flex; gap: 0.6rem; align-items: center;
}
.post-hero__eyebrow::before {
  content: ""; display: inline-block;
  width: 1.5rem; height: 1px; background: rgba(255,255,255,0.6);
}
.post-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.3rem + 3.6vw, 4rem);
  font-weight: 600; line-height: 1.05; letter-spacing: -0.005em;
  margin: 0; color: #fff;
  max-width: 22ch;
  text-wrap: balance;
}
.post-hero__title em { font-style: italic; color: #fff; font-weight: 500; }
.post-hero__dek {
  font-family: var(--font-body); font-style: italic;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.35rem);
  line-height: 1.4;
  color: rgba(255,255,255,0.92);
  margin: 1rem 0 0;
  max-width: 48ch;
}
.post-hero__meta {
  margin-top: 1.5rem;
  color: rgba(255,255,255,0.8);
}
.post-hero__meta .post-meta { color: inherit; }

@media (max-width: 780px) {
  .post-hero--cinematic {
    min-height: 60svh;
  }
  .post-hero__overlay {
    background:
      linear-gradient(180deg,
        rgba(20,18,14,0.15) 0%,
        rgba(20,18,14,0.00) 25%,
        rgba(20,18,14,0.55) 78%,
        rgba(20,18,14,0.78) 100%
      );
  }
}

/* Banner hero — used by Note / Series / Hub / Letter / Guide with an image */
.post-hero--banner {
  background: transparent; color: inherit;
  margin: 0 0 var(--stack-md);
  padding: 0;
}
.post-hero--banner .post-hero__img {
  position: relative; inset: auto;
  aspect-ratio: 21 / 9;
  width: 100%;
  background-size: cover; background-position: center;
  background-color: var(--paper-2);
  border-radius: 0;
}
@media (max-width: 780px) {
  .post-hero--banner .post-hero__img { aspect-ratio: 16 / 9; }
}

/* Text-first header (no image, or compact types) */
.post-header {
  max-width: var(--content-width);
  margin: clamp(2rem, 2vw + 1rem, 4rem) auto clamp(1.5rem, 1vw + 1rem, 2.5rem);
  padding: 0 var(--gutter);
  text-align: left;
}
.post-header--centered { text-align: center; max-width: 52rem; }
.post-header__eyebrow {
  font-family: var(--font-ui);
  font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.9rem;
}
.post-header__title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 600; line-height: 1.08; letter-spacing: -0.005em;
  margin: 0;
  text-wrap: balance;
}
.post-header__title em { font-style: italic; color: var(--accent); font-weight: 500; }
.post-header__dek {
  font-family: var(--font-body); font-style: italic;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.45; color: var(--ink-2);
  margin: 1rem 0 0; max-width: 46ch;
}
.post-header__meta { margin-top: 1.25rem; }

/* Body + floating TOC rail.
   The TOC is positioned as an overlay (absolute child of .post-body-wrap),
   so content stays viewport-centered regardless of whether the rail shows.
   The rail hovers over the right margin, and can gently overlap the outer
   edges of wide/full breakout cards — that overlap is intentional and the
   rail's backdrop tint keeps it legible. */
.post-body-wrap {
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: clamp(1.5rem, 2vw + 1rem, 3rem) var(--gutter) 0;
  position: relative;
}

/* Bare pages (Beta editor: "Hide page title and feature image")
   Let full-width Koenig cards sit flush against the site chrome. */
.post--bare .post-body-wrap {
  padding: 0;
  max-width: none;
}
.post--bare .post-body {
  max-width: none;
}
.post--bare .post-content > :first-child.kg-width-full {
  margin-top: 0;
}
.post--bare .post-content > :last-child.kg-width-full {
  margin-bottom: 0;
}
.post--bare .post-content .kg-width-full + .kg-width-full {
  margin-top: 0;
}
/* Non-full-width content inside a bare page still needs a readable column */
.post--bare .post-content > :not(.kg-width-full):not(.kg-width-wide) {
  max-width: var(--content-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.post-body {
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
}

/* Post meta — small UI row */
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  font-family: var(--font-ui); font-size: 0.84rem; color: var(--ink-3);
}
.post-meta a { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; }
.post-meta a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.post-meta .type {
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 0.72rem; color: var(--accent);
}
.post-meta .sep { color: var(--rule-strong); }

/* ============================================================================= */
/* Post content — long-read typography */
/* ============================================================================= */

.post-content {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
}
.post-content > * + * { margin-top: 1.1em; }
.post-content p { margin: 0; }
.post-content p + p { margin-top: 1.1em; }

.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--ink);
  letter-spacing: -0.005em;
  scroll-margin-top: 5rem;
}
.post-content h2 {
  font-size: var(--fs-h2);
  /* No auto-divider above section headings. Authors who want a visible
     break should insert a Koenig divider in the editor; it renders via
     `.post-content hr` (• • •). */
  margin: 2.4em 0 0.5em;
}
.post-content h3 { font-size: var(--fs-h3); margin: 1.8em 0 0.4em; }
.post-content h4 { font-size: var(--fs-h4); margin: 1.6em 0 0.3em; font-weight: 600; }

.post-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post-content a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.post-content blockquote {
  margin: 1.75em 0;
  padding: 0.2em 0 0.2em 1.4em;
  border-left: 2px solid var(--accent);
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-2);
  font-size: 1.05em;
  line-height: 1.55;
}
.post-content blockquote p { margin: 0; }
.post-content blockquote p + p { margin-top: 0.9em; }
.post-content blockquote cite {
  display: block; margin-top: 0.75em;
  font-style: normal; font-family: var(--font-ui);
  font-size: 0.82rem; color: var(--ink-3);
  letter-spacing: 0.02em;
}

.post-content ul, .post-content ol { padding-left: 1.3em; margin: 1.1em 0; }
.post-content li { margin: 0.35em 0; }
.post-content li::marker { color: var(--ink-3); }

.post-content hr {
  margin: 2.5em auto;
  border: 0; height: 0;
  text-align: center;
  border-top: 0;
}
.post-content hr::before {
  content: "• • •";
  color: var(--rule-strong);
  font-size: 0.9rem; letter-spacing: 0.8em;
}

.post-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}
.post-content pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86rem;
  background: #1d1b16; color: #e8e3d2;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
  margin: 1.5em 0;
}
.post-content pre code {
  background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit;
}

.post-content figure {
  margin: 1.75em 0;
}
.post-content figure img { width: 100%; border-radius: var(--radius); }
.post-content figcaption {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--ink-3);
  margin-top: 0.5rem;
  text-align: center;
}

/* Ghost Koenig "wide" and "full" cards break out of the content column.
   Because .post-body is always viewport-centered (the TOC rail no longer
   participates in layout), the breakout math is simple: translate 50% to
   land the card's center on the viewport's center. The TOC rail may sit
   over the right edge of wide/full cards; see .toc-rail for the backdrop
   tint that keeps it readable. */
.post-content .kg-width-wide {
  margin-left: 50%;
  transform: translateX(-50%);
  width: min(var(--wide-width), calc(100vw - 2*var(--gutter)));
}
.post-content .kg-width-full {
  margin-left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 100vw;
  border-radius: 0;
}
.post-content .kg-width-full img { border-radius: 0; }

/* Ghost embed card — YouTube, Vimeo, Twitter/X, etc.
   YouTube's oEmbed response includes width="200" height="113" on the iframe,
   which collapses the embed to a thumbnail without CSS. Force the iframe
   (and object/video, for rarer embeds) to fill the card at a 16:9 aspect
   ratio. Koenig centers the figure, so no extra margin math is needed.
   Non-video embeds (e.g. Twitter/X blockquote-style) don't use iframes in
   the same way, so this doesn't affect them. */
.post-content .kg-embed-card {
  /* Block margins only; see .kg-signup-card for the shorthand warning. */
  margin-top: 1.75em;
  margin-bottom: 1.75em;
  display: flex;
  justify-content: center;
}
.post-content .kg-embed-card > iframe,
.post-content .kg-embed-card > video,
.post-content .kg-embed-card > object {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
}
/* Some embeds (Instagram, Tweets via blockquote) sit inside .kg-embed-card
   without an iframe. Don't force aspect-ratio on those. */
.post-content .kg-embed-card > :not(iframe):not(video):not(object) {
  max-width: 100%;
}

/* Ghost bookmark card.
   Default Ghost markup is a flex row: text content on the left,
   thumbnail on the right, with a small metadata row at the bottom that
   includes a favicon (.kg-bookmark-icon). Without explicit sizing the
   favicon gets stretched by the surrounding flex layout into a long
   oval, which is the visual bug we're fixing here.

   Notes:
   - Block margins only on the figure (see .kg-signup-card warning re:
     `margin: X Y` shorthand stomping the wide/full alignment math).
   - The whole card is a single anchor — we let it inherit text color
     and only highlight on hover via border + accent on the title. */
.post-content .kg-bookmark-card {
  margin-top: 1.75em;
  margin-bottom: 1.75em;
}
.post-content .kg-bookmark-container {
  display: flex;
  align-items: stretch;
  min-height: 130px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.post-content .kg-bookmark-container:hover,
.post-content .kg-bookmark-container:focus-visible {
  border-color: var(--rule-strong);
  box-shadow: 0 1px 0 var(--rule), 0 6px 18px -12px rgba(0, 0, 0, 0.18);
  outline: none;
}
.post-content .kg-bookmark-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 1rem 1.25rem;
  min-width: 0; /* allow text to truncate inside the flex row */
}
.post-content .kg-bookmark-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 0.35rem;
}
.post-content .kg-bookmark-container:hover .kg-bookmark-title,
.post-content .kg-bookmark-container:focus-visible .kg-bookmark-title {
  color: var(--accent);
}
.post-content .kg-bookmark-description {
  font-family: var(--font-body);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0 0 0.75rem;
  /* Two-line clamp keeps cards visually consistent regardless of how
     much description the source page exposes. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-content .kg-bookmark-metadata {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--ink-3);
}
/* The fix. Lock the favicon to a small square and stop flex from
   stretching it. `flex: 0 0 auto` prevents the parent flexbox from
   resizing it; explicit width+height+object-fit defends against any
   inline sizing the upstream HTML might (or might not) provide. */
.post-content .kg-bookmark-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0 0.25rem 0 0;
  border-radius: 3px;
  object-fit: contain;
}
.post-content .kg-bookmark-author,
.post-content .kg-bookmark-publisher {
  display: inline-flex;
  align-items: center;
}
/* Bullet between author and publisher when both are present. */
.post-content .kg-bookmark-publisher::before {
  content: "·";
  margin: 0 0.5rem;
  color: var(--ink-3);
}
.post-content .kg-bookmark-thumbnail {
  flex: 0 0 200px;
  max-width: 35%;
  position: relative;
  overflow: hidden;
  background: var(--paper-2);
}
.post-content .kg-bookmark-thumbnail img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* On narrower viewports, stack the thumbnail above the content rather
   than letting it shrink awkwardly next to the text. */
@media (max-width: 600px) {
  .post-content .kg-bookmark-container {
    flex-direction: column-reverse;
    min-height: 0;
  }
  .post-content .kg-bookmark-thumbnail {
    flex-basis: auto;
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }
}

/* Ghost callout card — editorial treatment */
.post-content .kg-callout-card {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  /* Block margins only; see note on .kg-signup-card. */
  margin-top: 1.75em;
  margin-bottom: 1.75em;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
.post-content .kg-callout-card .kg-callout-text {
  font-family: var(--font-body);
  color: var(--ink);
}

/* Ghost Koenig signup card — theme-matched defaults that still defer to the
   editor. We provide warm paper background + subtle border as the DEFAULT
   (no !important). The moment you pick a Background color in the card's
   editor panel, Ghost writes an inline style that has higher specificity and
   wins — so author choices still work. For the button accent, set
   Ghost Admin → Settings → Branding → Accent color to match the theme. */
.post-content .kg-signup-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  /* Only set the block margins. Inline margins are owned by the Koenig
     width classes (.kg-width-wide / .kg-width-full) which use margin-left: 50%
     combined with a transform to break out and viewport-center the card.
     Using `margin: 2rem 0` here would reset margin-left to 0 and collapse
     the breakout math. */
  margin-top: 2rem;
  margin-bottom: 2rem;
  overflow: hidden;  /* so any inner bg respects the radius */
}
.post-content .kg-signup-card-heading {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em;
}
.post-content .kg-signup-card-subheading {
  font-family: var(--font-body) !important;
  font-weight: 400 !important;
}
.post-content .kg-signup-card-form input[type="email"] {
  font-family: var(--font-ui);
  border-radius: var(--radius);
}
.post-content .kg-signup-card-form button {
  font-family: var(--font-ui);
  font-weight: 500;
  border-radius: var(--radius);
}
.post-content .kg-signup-card-disclaimer {
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

/* Optional drop cap — only on Essay, applied via data attribute */
[data-dropcap="true"] .post-content > p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 4.6em;
  line-height: 0.85;
  padding: 0.08em 0.12em 0 0;
  margin-top: 0.06em;
  color: var(--accent);
}

/* ============================================================================= */
/* TOC — sticky right rail (desktop) + mobile disclosure */
/* ============================================================================= */

/* TOC rail: an overlay that floats in the right margin.
   .toc-rail-wrap is absolutely positioned and spans the full height of the
   post body, so it doesn't participate in the content layout at all.
   .toc-rail inside it uses position: sticky to follow the reader while the
   article is on screen, then scrolls away with the article footer. */
.toc-rail-wrap {
  display: none;
  position: absolute;
  top: clamp(1.5rem, 2vw + 1rem, 3rem);
  /* Pin the rail's right edge to the viewport's right edge (minus a gutter),
     not the shell's right edge. On wide monitors the shell is centered with
     plenty of outer margin, so the rail extends past the shell's right via
     a negative `right` value; on narrower viewports (viewport <= shell) the
     outer margin is zero and the rail just sits a gutter from the edge.
     This keeps the rail out over genuinely empty space and off the content. */
  right: calc(var(--gutter) - max(0px, (100vw - var(--shell-width)) / 2));
  bottom: 0;
  width: var(--rail-width);
  pointer-events: none;
}
@media (min-width: 1100px) {
  .post-body-wrap--has-rail .toc-rail-wrap { display: block; }
}

.toc-rail {
  display: none;
  position: sticky;
  top: 6rem;
  padding: 0.75rem 0.9rem 0.9rem 1.25rem;
  border-left: 1px solid var(--rule);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-2);
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  /* Warm paper tint with a soft blur keeps the TOC legible when it drifts
     over the outer edge of a wide or full Koenig card. */
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: auto;
}
.toc-rail.is-active { display: block; }
.toc-rail__title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.6rem;
}
.toc-rail ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-rail li { margin: 0.3rem 0; }
.toc-rail li.depth-3 { padding-left: 0.9rem; font-size: 0.8rem; }
.toc-rail a {
  color: var(--ink-2);
  text-decoration: none;
  display: block;
  padding: 0.1rem 0;
  border-left: 2px solid transparent;
  margin-left: -1.25rem;
  padding-left: 1.1rem;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.toc-rail a:hover { color: var(--ink); }
.toc-rail a.is-current {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* Mobile TOC */
.toc-mobile {
  display: none;
  margin: 0 auto var(--stack-md);
  max-width: var(--content-width);
  padding: 0.25rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-ui);
}
.toc-mobile.is-active { display: block; }
@media (min-width: 1100px) {
  .post-body-wrap--has-rail .toc-mobile { display: none !important; }
}
.toc-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 0;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-2);
  min-height: 44px;
}
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after {
  content: "+"; font-weight: 400; color: var(--ink-3); font-size: 1.1rem;
  transition: transform 0.2s var(--ease);
}
.toc-mobile[open] summary::after { content: "−"; }
.toc-mobile ol { list-style: none; padding: 0 0 0.9rem; margin: 0; font-size: 0.92rem; }
.toc-mobile li { margin: 0.4rem 0; }
.toc-mobile li.depth-3 { padding-left: 1rem; font-size: 0.88rem; }
.toc-mobile a { color: var(--ink); text-decoration: none; line-height: 1.4; }
.toc-mobile a:hover { color: var(--accent); }

/* ============================================================================= */
/* Reading progress bar */
/* ============================================================================= */

.reading-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.reading-progress.is-active { opacity: 1; }
.reading-progress__bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  opacity: 0.85;
  transition: width 0.12s linear;
}

/* ============================================================================= */
/* Post footer (tags + author) */
/* ============================================================================= */

.post-footer {
  max-width: var(--content-width);
  margin: var(--stack-xl) auto 0;
  padding: 0 var(--gutter);
}
.post-tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  font-family: var(--font-ui); font-size: 0.8rem;
  margin: 0 0 var(--stack-lg);
}
.post-tags a {
  color: var(--ink-2);
  text-decoration: none;
  border: 1px solid var(--rule);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}
.post-tags a:hover { color: var(--accent); border-color: var(--accent); }

/* Share row — sits below the author card. Quiet text links, not icon blobs.
   The author-card already draws a border-bottom, so no border-top needed. */
.post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  margin: var(--stack-md) 0 0;
  font-family: var(--font-ui);
  font-size: 0.84rem;
}
.post-share__label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.post-share__links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem;
}
.post-share__links a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.post-share__links a:hover,
.post-share__links a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

.author-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  padding: var(--stack-md) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  align-items: center;
}
.author-card__avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--paper-2); overflow: hidden;
  display: block;
  transition: box-shadow 0.2s ease;
}
.author-card__avatar:hover,
.author-card__avatar:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
}
.author-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-card__name {
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 600; margin: 0 0 0.15rem;
}
.author-card__name a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.author-card__name a:hover,
.author-card__name a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}
.author-card__bio {
  font-family: var(--font-body);
  color: var(--ink-2);
  font-size: 0.95rem; line-height: 1.5;
  margin: 0;
}
.author-card__more {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  margin: 0.5rem 0 0;
}
.author-card__more a {
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.author-card__more a:hover,
.author-card__more a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
  outline: none;
}

/* ============================================================================= */
/* Series navigation */
/* ============================================================================= */

.series-nav {
  max-width: var(--content-width);
  margin: var(--stack-lg) auto 0;
  padding: 1.25rem var(--gutter);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  font-family: var(--font-ui);
}
.series-nav__label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 0.4rem;
}
.series-nav__series { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; margin: 0 0 0.75rem; }
.series-nav__series a { color: var(--ink); text-decoration: none; }
.series-nav__series a:hover { color: var(--accent); }
.series-nav__controls {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
  margin-top: 0.75rem;
}
@media (max-width: 520px) { .series-nav__controls { grid-template-columns: 1fr; } }
.series-nav__btn {
  display: block; padding: 0.7rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none; color: var(--ink);
  min-height: 54px;
}
.series-nav__btn:hover { border-color: var(--accent); color: var(--accent); }
.series-nav__btn .dir {
  display: block;
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600;
}
.series-nav__btn .title {
  display: block;
  font-family: var(--font-body); font-size: 0.95rem;
  margin-top: 0.2rem; line-height: 1.35;
}
.series-nav__btn--next { text-align: right; }

/* ============================================================================= */
/* Comments shell */
/* ============================================================================= */

.comments-section {
  max-width: var(--content-width);
  margin: var(--stack-xl) auto 0;
  padding: var(--stack-lg) var(--gutter) 0;
  border-top: 1px solid var(--rule);
}
.comments-section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: var(--stack);
}
.comments-section__title {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 600; margin: 0;
}
.comments-section__note {
  font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-3);
}
.comments-section__placeholder {
  min-height: 6rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--ink-3);
  font-family: var(--font-ui); font-size: 0.85rem;
  background: var(--paper-2);
}
.comments-section--disabled { display: none; }
.comments-section--empty .comments-section__placeholder {
  display: block;
}

/* When a provider has mounted, the placeholder should go away */
.comments-section.is-mounted .comments-section__placeholder { display: none; }

/* ============================================================================= */
/* Archive page */
/* ============================================================================= */

.archive {
  max-width: var(--shell-width);
  margin: 0 auto;
  padding: var(--stack-xl) var(--gutter);
}
.archive__header { margin-bottom: var(--stack-lg); border-bottom: 1px solid var(--rule); padding-bottom: var(--stack-md); }
.archive__title { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; margin: 0; }
.archive__title em { color: var(--accent); font-style: italic; font-weight: 500; }
.archive__title--compact { font-size: clamp(2rem, 1.5rem + 1.5vw, 2.6rem); }
.archive__intro { max-width: 48ch; color: var(--ink-2); margin: 0.75rem 0 0; font-size: var(--fs-lead); font-style: italic; }

.archive__author-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: center;
}
.archive__author-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--paper-2); overflow: hidden;
}
.archive__author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.archive__filters {
  display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem;
  margin: var(--stack) 0 var(--stack-lg);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}
.archive__filter {
  color: var(--ink-2); text-decoration: none;
  padding: 0.3rem 0.6rem; border-radius: 999px;
  border: 1px solid transparent;
}
.archive__filter:hover { color: var(--ink); }
.archive__filter.is-active { background: var(--ink); color: var(--paper); }

.archive__group {
  margin: 0 0 var(--stack-2xl);
  scroll-margin-top: 5rem;
}
.archive__group-label {
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  font-weight: 500; font-style: italic;
  color: var(--ink);
  margin: 0 0 0.4rem;
  line-height: 1;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}
.archive__group--peaks .archive__group-label {
  color: var(--accent);
}
.archive__group-meta {
  font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-3);
  margin: 0 0 var(--stack);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* Make the in-page archive nav sticky so readers can jump sections while scrolling */
.archive__filters {
  position: sticky;
  top: 4.25rem;
  z-index: 20;
  background: var(--paper);
  padding: 0.75rem 0;
  margin: var(--stack) 0 var(--stack-lg);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: saturate(120%) blur(6px);
  background-color: rgba(246, 241, 230, 0.9);
}

/* ============================================================================= */
/* Hub / Start Here — grouped sections */
/* ============================================================================= */

.hub-group {
  margin: var(--stack-xl) auto;
  max-width: var(--wide-width);
}
.hub-group__head {
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
  margin-bottom: var(--stack);
}
.hub-group__title {
  font-family: var(--font-display);
  font-size: var(--fs-h2); font-weight: 600;
  margin: 0;
}
.hub-group__desc { color: var(--ink-2); margin: 0.5rem 0 0; font-size: 1rem; max-width: 52ch; }

/* ============================================================================= */
/* Pagination */
/* ============================================================================= */

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin: var(--stack-xl) auto;
  padding: 0 var(--gutter);
  max-width: var(--shell-width);
  font-family: var(--font-ui); font-size: 0.9rem;
}
.pagination a { color: var(--ink); text-decoration: none; }
.pagination a:hover { color: var(--accent); }
.pagination__info { color: var(--ink-3); }

/* ============================================================================= */
/* Compact / Note variant adjustments */
/* ============================================================================= */

[data-type="note"] .post-header__title { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.25rem); }
[data-type="note"] .post-content { font-size: 1.05rem; }
[data-type="note"] .post-body { max-width: 36rem; }

/* Letter — intimate */
[data-type="letter"] .post-header__eyebrow { color: var(--accent-2); }
[data-type="letter"] .post-header__title em { color: var(--accent-2); }

/* Series */
[data-type="series"] .post-header__eyebrow { color: var(--accent); }

/* Guide — utilitarian but still editorial */
[data-type="guide"] .last-updated {
  font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-3);
  margin: 0.5rem 0 0;
  letter-spacing: 0.06em;
}

/* Hub */
[data-type="hub"] .post-header { text-align: left; max-width: var(--wide-width); }
[data-type="hub"] .post-body { max-width: var(--wide-width); }

/* ============================================================================= */
/* Error / 404 */
/* ============================================================================= */

.error {
  max-width: 40rem; margin: 6rem auto; padding: 0 var(--gutter);
  text-align: center;
}
.error__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 2rem + 8vw, 8rem);
  line-height: 1; color: var(--accent); font-style: italic; font-weight: 500;
  margin: 0;
}
.error__title {
  font-family: var(--font-display);
  font-size: var(--fs-h2); font-weight: 600; margin: 0.5rem 0;
}
.error__lead { color: var(--ink-2); margin: 0 0 1.5rem; font-size: var(--fs-lead); }

/* ============================================================================= */
/* Print */
/* ============================================================================= */

@media print {
  .site-header, .site-footer, .reading-progress, .toc-rail-wrap, .toc-rail, .toc-mobile, .comments-section, .subscribe, .series-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .post-body { max-width: none; }
}
