/* ==========================================================
   Blog — post reader + journal index
   Extends site/styles.css; uses the same design tokens.
   ========================================================== */

/* Post layout */
.post-wrap {
  max-width: 760px;
  margin: 40px auto 80px;
  padding: 0 24px;
  color: var(--fg);
}
.post-head {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 40px;
}
.post-back {
  display: inline-block;
  font: 500 13px var(--font-sans);
  color: var(--amethyst-700);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color 180ms;
}
.post-back:hover { color: var(--amethyst-800); }
.post-date {
  font: 600 11px var(--font-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  margin: 0 0 16px;
}
.post-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--fg-strong);
  margin: 0 0 28px;
  text-wrap: balance;
}
.post-hero-img {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(40, 36, 24, 0.18);
  background: var(--bone-100);
}
.post-hero-img img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Prose */
.post-body {
  font: 400 18px/1.75 var(--font-sans);
  color: var(--ink-800);
}
.post-body > * + * { margin-top: 1.1em; }
.post-body h1, .post-body h2, .post-body h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  color: var(--fg-strong);
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-top: 2em;
}
.post-body h1 { font-size: 2.25rem; line-height: 1.15; }
.post-body h2 { font-size: 1.85rem; line-height: 1.2; }
.post-body h3 { font-size: 1.45rem; line-height: 1.25; font-weight: 600; }
.post-body p  { margin: 0 0 1em; }
.post-body strong { color: var(--fg-strong); font-weight: 600; }
.post-body em { font-style: italic; }
.post-body a  {
  color: var(--amethyst-700);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 180ms;
}
.post-body a:hover {
  color: var(--amethyst-800);
  text-decoration-thickness: 2px;
}
.post-body ul, .post-body ol {
  padding-left: 1.25em;
  margin: 1em 0;
}
.post-body li {
  margin: 0.5em 0;
  padding-left: 0.25em;
}
.post-body li::marker { color: var(--amethyst-600); }
.post-body blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--amethyst-400);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3em;
  line-height: 1.45;
  color: var(--fg-strong);
}
.post-body p.spacer {
  margin: 0;
  line-height: 0.6em;
  opacity: 0;
}
.post-figure {
  margin: 2.5em 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bone-100);
  box-shadow: 0 20px 50px -20px rgba(40, 36, 24, 0.15);
}
.post-figure img { width: 100%; height: auto; display: block; }
.post-figure figcaption {
  padding: 14px 20px;
  font: 400 14px/1.5 var(--font-sans);
  color: var(--fg-muted);
  background: var(--bone-100);
  border-top: 1px solid var(--hairline);
}
.post-body hr {
  border: 0;
  border-top: 1px dashed var(--hairline);
  margin: 2.5em 0;
}

.post-foot {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
}

/* Journal index */
.index-hero {
  padding: 100px 24px 60px;
}
.index-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.index-hero .v2-eyebrow { margin-left: auto; margin-right: auto; }
.index-hero h1 {
  font-size: clamp(3rem, 6.5vw, 5.5rem);
  margin: 20px auto 24px;
}
.index-hero .v2-lead {
  margin: 0 auto;
  max-width: 58ch;
}

.post-index-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 120px;
}
.post-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: 0 20px 50px -20px rgba(40, 36, 24, 0.12);
  text-decoration: none;
  color: inherit;
  transition: transform 260ms cubic-bezier(0.22,1,0.36,1),
              box-shadow 260ms cubic-bezier(0.22,1,0.36,1);
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 40px 70px -20px rgba(40, 36, 24, 0.22);
}
.post-card-img {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bone-100);
}
.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.22,1,0.36,1);
}
.post-card:hover .post-card-img img { transform: scale(1.05); }
.post-card-body { padding: 24px 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.post-card-date {
  margin: 0;
  font: 600 11px var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amethyst-700);
}
.post-card-body h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--fg-strong);
  text-wrap: balance;
}
.post-card-excerpt {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-muted);
}
.post-card-more {
  margin-top: 8px;
  font: 500 13px var(--font-sans);
  color: var(--amethyst-700);
}

@media (max-width: 960px) {
  .post-index-grid { grid-template-columns: 1fr 1fr; }
  .index-hero { padding: 60px 20px 40px; }
  .post-wrap { padding: 0 20px; margin-top: 20px; }
  .post-body { font-size: 17px; }
}
@media (max-width: 600px) {
  .post-index-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   Enhanced reading experience (applied to any .post-body)
   ========================================================== */

/* Two-column post layout with TOC sidebar */
.post-layout {
  max-width: 1200px;
  margin: 40px auto 80px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.post-layout .post-wrap { max-width: none; margin: 0; padding: 0; }

/* Scroll progress bar (top of viewport) */
.post-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  z-index: 50;
  pointer-events: none;
}
.post-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--forest-600), var(--amethyst-600));
  transform-origin: 0 50%;
  transition: width 120ms linear;
}

/* Reading meta row: date · read time · words */
.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin: 0 0 20px;
  font: 600 11px var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amethyst-700);
}
.post-meta-row .pmr-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--amethyst-400);
  letter-spacing: 0;
}
.post-meta-row .pmr-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--amethyst-100);
  border-radius: 999px;
  color: var(--amethyst-800);
}

/* TOC sidebar */
.post-toc {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
  font: 500 13px var(--font-sans);
}
.post-toc-label {
  font: 600 10px var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hairline);
}
.post-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-reset: toc;
}
.post-toc li.toc-h3 { padding-left: 14px; }
.post-toc a {
  display: block;
  position: relative;
  padding: 6px 12px 6px 14px;
  color: var(--fg-muted);
  text-decoration: none;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition: color 180ms, border-color 180ms, background 180ms;
  border-radius: 0 10px 10px 0;
}
.post-toc a:hover { color: var(--fg-strong); background: var(--bone-100); }
.post-toc a.active {
  color: var(--amethyst-800);
  border-left-color: var(--amethyst-600);
  background: var(--amethyst-100);
}
.post-toc li.toc-h3 a { font-size: 12.5px; color: var(--fg-muted); }

/* Mobile TOC — collapsible disclosure */
.post-toc-mobile {
  display: none;
  margin: 24px 0 32px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(8px);
}
.post-toc-mobile > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 12px var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amethyst-700);
}
.post-toc-mobile > summary::-webkit-details-marker { display: none; }
.post-toc-mobile > summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 400;
  color: var(--amethyst-600);
  transition: transform 200ms;
}
.post-toc-mobile[open] > summary::after { transform: rotate(45deg); }
.post-toc-mobile ol {
  list-style: none;
  margin: 0;
  padding: 8px 12px 16px;
  max-height: 60vh;
  overflow-y: auto;
}
.post-toc-mobile li { margin: 2px 0; }
.post-toc-mobile li.toc-h3 { padding-left: 14px; }
.post-toc-mobile a {
  display: block;
  padding: 8px 12px;
  color: var(--fg);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
}
.post-toc-mobile a:hover { background: var(--bone-100); color: var(--fg-strong); }
.post-toc-mobile a.active { background: var(--amethyst-100); color: var(--amethyst-800); }

/* Section dividers between major h2s */
.post-body .section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 3.25em 0 2em;
  color: var(--amethyst-400);
}
.post-body .section-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline) 40%, var(--hairline) 60%, transparent);
}
.post-body .section-divider .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.post-body .section-divider .dot.m { opacity: 1; width: 7px; height: 7px; }
.post-body .section-divider svg { color: var(--amethyst-500); }

/* Pull-quote callouts (lifted from bolded fragments — no content changed) */
.post-body aside.pull-quote {
  margin: 2.5em 0 2.5em;
  padding: 26px 28px 26px 32px;
  border-left: 3px solid var(--amethyst-500);
  background: linear-gradient(90deg, var(--amethyst-100), rgba(245, 239, 248, 0));
  border-radius: 0 18px 18px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.45em;
  line-height: 1.4;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
  position: relative;
}
.post-body aside.pull-quote::before {
  content: '"';
  position: absolute;
  top: -8px;
  left: 18px;
  font-size: 64px;
  line-height: 1;
  color: var(--amethyst-400);
  opacity: 0.55;
  font-family: var(--font-serif);
}

/* Offset scroll position so the anchor header isn't hidden under the nav */
.post-body h2, .post-body h3 { scroll-margin-top: 110px; }

/* Prev/next post navigation */
.post-adjacent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 56px;
}
.post-adjacent a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 220ms, box-shadow 220ms, border-color 220ms;
}
.post-adjacent a:hover {
  transform: translateY(-3px);
  border-color: var(--amethyst-300);
  box-shadow: 0 20px 40px -16px rgba(40, 36, 24, 0.14);
}
.post-adjacent a.next { text-align: right; }
.post-adjacent .label {
  font: 600 10px var(--font-sans);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amethyst-700);
}
.post-adjacent .title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.25;
  color: var(--fg-strong);
  letter-spacing: -0.01em;
}

/* ==========================================================
   TOC grouped by Part (desktop sidebar + mobile disclosure)
   ========================================================== */
.post-toc .toc-grouped,
.post-toc-mobile .toc-grouped {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.post-toc .toc-part,
.post-toc-mobile .toc-part {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 0 8px;
  border-bottom: 1px dashed transparent;
  transition: border-color 240ms;
}
.post-toc .toc-part:last-child,
.post-toc-mobile .toc-part:last-child { border-bottom: none; padding-bottom: 0; }
.post-toc .toc-part.active { border-bottom-color: var(--hairline); }

/* Override the default .post-toc a rules for the Part header */
.post-toc .toc-part-header,
.post-toc-mobile .toc-part-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border-left: 0 !important;
  background: transparent;
  color: var(--fg-muted);
  line-height: 1.15;
  transition: background 220ms, color 220ms;
}
.post-toc .toc-part-header:hover,
.post-toc-mobile .toc-part-header:hover {
  background: var(--bone-100);
  color: var(--fg-strong);
}
.post-toc .toc-part.active .toc-part-header,
.post-toc-mobile .toc-part.active .toc-part-header {
  color: var(--fg-strong);
  background: transparent;
}

.post-toc .toc-part-num,
.post-toc-mobile .toc-part-num {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 11px var(--font-sans);
  color: var(--amethyst-700);
  background: var(--amethyst-100);
  border-radius: 50%;
  transition: background 240ms, color 240ms, box-shadow 240ms;
}
.post-toc .toc-part.active .toc-part-num,
.post-toc-mobile .toc-part.active .toc-part-num {
  background: linear-gradient(135deg, var(--amethyst-600), var(--amethyst-700));
  color: var(--bone-50);
  box-shadow: 0 0 0 4px rgba(140, 106, 160, 0.18);
}

.post-toc .toc-part-label,
.post-toc-mobile .toc-part-label {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.post-toc .toc-part-kicker,
.post-toc-mobile .toc-part-kicker {
  font: 600 9px var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  margin-bottom: 2px;
}
.post-toc .toc-part-title,
.post-toc-mobile .toc-part-title {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.005em;
  line-height: 1.15;
}

.post-toc .toc-part-items,
.post-toc-mobile .toc-part-items {
  list-style: none;
  margin: 0;
  padding: 2px 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}
.post-toc .toc-part-items::before,
.post-toc-mobile .toc-part-items::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--hairline);
}
.post-toc .toc-part.active .toc-part-items::before,
.post-toc-mobile .toc-part.active .toc-part-items::before { background: var(--amethyst-300); }
.post-toc .toc-part-items .toc-h3,
.post-toc-mobile .toc-part-items .toc-h3 { padding-left: 14px; }

/* Mobile disclosure tweaks */
.post-toc-mobile .toc-grouped { gap: 14px; }
.post-toc-mobile .toc-part-header { padding: 6px 8px; }
.post-toc-mobile .toc-part-items { padding-left: 30px; }
.post-toc-mobile .toc-part-items::before { left: 18px; }

/* ==========================================================
   Chapter / Part banners
   ========================================================== */
.post-body .post-part {
  position: relative;
  margin: 4.5em -32px 2.75em;
  padding: 56px 40px 48px;
  background:
    radial-gradient(circle at 20% 30%, rgba(220, 205, 230, 0.7), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(240, 211, 191, 0.6), transparent 60%),
    linear-gradient(135deg, var(--amethyst-100), var(--clay-100));
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  text-align: center;
  box-shadow: 0 20px 50px -24px rgba(40, 36, 24, 0.18);
  overflow: hidden;
}
.post-body .post-part::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 64px; height: 3px;
  background: linear-gradient(90deg, var(--amethyst-500), var(--clay-500));
  border-radius: 0 0 6px 6px;
}
.post-body .post-part .part-label {
  font: 700 11px var(--font-sans);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  margin: 0 0 14px;
}
.post-body .post-part .part-title-name {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: clamp(2.25rem, 4.5vw, 3.25rem);
  letter-spacing: -0.025em;
  color: var(--fg-strong);
  margin: 0 0 14px;
  line-height: 1.05;
  text-wrap: balance;
  background: linear-gradient(135deg, var(--amethyst-800), var(--clay-700) 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.post-body .post-part .part-subtitle {
  font: 400 17px/1.5 var(--font-sans);
  color: var(--fg-muted);
  max-width: 48ch;
  margin: 0 auto;
}

/* ==========================================================
   Stat callouts — oversized numbers as marginalia
   ========================================================== */
.post-body .stat-callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 22px 22px;
  background: linear-gradient(160deg, var(--amethyst-100) 0%, var(--clay-100) 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: 0 18px 40px -20px rgba(40, 36, 24, 0.22),
              0 2px 6px rgba(40, 36, 24, 0.05);
  text-align: center;
}
.post-body .stat-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 64px;
  line-height: 0.95;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--amethyst-700), var(--clay-700));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  white-space: nowrap;
}
.post-body .stat-num.stat-num-md { font-size: 46px; }
.post-body .stat-num.stat-num-sm { font-size: 34px; }
.post-body .stat-unit {
  font-size: 0.42em;
  margin-left: 2px;
  vertical-align: 0.35em;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0;
}
.post-body .stat-caption {
  font: 500 12.5px/1.5 var(--font-sans);
  color: var(--fg-muted);
  letter-spacing: -0.002em;
  max-width: 22ch;
}

/* Desktop marginalia: float right, breakout past paragraph edge */
@media (min-width: 1100px) {
  .post-body .stat-callout {
    float: right;
    clear: right;
    width: 210px;
    margin: 0.25em -56px 1.25em 28px;
    shape-outside: margin-box;
  }
}

/* Narrow desktop / tablet / mobile: centered block between paragraph lines */
@media (max-width: 1099px) {
  .post-body .stat-callout {
    float: none;
    width: auto;
    max-width: 360px;
    margin: 1.75em auto 1.75em;
    padding: 30px 26px 26px;
  }
  .post-body .stat-num { font-size: 58px; }
}
@media (max-width: 520px) {
  .post-body .stat-callout {
    max-width: none;
    margin: 1.5em 0;
    padding: 26px 22px 22px;
  }
  .post-body .stat-num { font-size: 52px; }
  .post-body .stat-caption { font-size: 13px; max-width: 24ch; }
}

/* ==========================================================
   At-a-glance strip beneath each Part banner
   ========================================================== */
.post-body .part-glance {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: -1.25em -24px 3em;
  position: relative;
  z-index: 2;
}
.post-body .glance-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px 22px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 14px 36px -18px rgba(40, 36, 24, 0.22),
              0 2px 6px rgba(40, 36, 24, 0.05);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 240ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 240ms;
}
.post-body .glance-card:hover {
  transform: translateY(-4px);
  border-color: var(--amethyst-200);
  box-shadow: 0 28px 60px -22px rgba(40, 36, 24, 0.3),
              0 4px 10px rgba(40, 36, 24, 0.06);
}
.post-body .glance-from {
  margin: 0;
  font: 600 10px var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  line-height: 1.4;
}
.post-body .glance-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.45;
  color: var(--fg-strong);
  letter-spacing: -0.005em;
  flex: 1;
  text-wrap: pretty;
}
.post-body .glance-jump {
  margin-top: 4px;
  font: 600 11px var(--font-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  align-self: flex-start;
  transition: color 180ms, transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
.post-body .glance-card:hover .glance-jump {
  color: var(--amethyst-800);
  transform: translateX(2px);
}

@media (max-width: 820px) {
  .post-body .part-glance { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 600px) {
  .post-body .part-glance { margin: -0.75em -16px 2em; }
  .post-body .glance-quote { font-size: 16px; }
}

/* ==========================================================
   Lead paragraphs + drop caps
   ========================================================== */
.post-body .lead-paragraph {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25em;
  line-height: 1.5;
  color: var(--fg-strong);
  letter-spacing: -0.005em;
  max-width: 58ch;
  margin-top: 1.5em;
  text-wrap: pretty;
}
.post-body .lead-paragraph strong {
  font-weight: 600;
  color: var(--amethyst-800);
}

.post-body .part-opener {
  margin-top: 0.5em;
}
.post-body .part-opener::first-letter {
  float: left;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 5.25em;
  line-height: 0.85;
  margin: 0.08em 0.12em 0 0;
  padding-right: 0.05em;
  background: linear-gradient(135deg, var(--amethyst-700), var(--clay-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================
   Glossary terms + popover
   ========================================================== */
.post-body .gloss-term {
  background-image: linear-gradient(to right, var(--amethyst-400) 60%, transparent 60%);
  background-size: 6px 1px;
  background-repeat: repeat-x;
  background-position: 0 100%;
  padding-bottom: 2px;
  cursor: help;
  transition: color 180ms, background-image 180ms;
  outline: none;
}
.post-body .gloss-term:hover,
.post-body .gloss-term:focus-visible {
  color: var(--amethyst-800);
  background-image: linear-gradient(to right, var(--amethyst-700) 60%, transparent 60%);
}
.post-body .gloss-term:focus-visible {
  box-shadow: 0 0 0 3px rgba(140, 106, 160, 0.25);
  border-radius: 3px;
}

.gloss-popover {
  position: absolute;
  z-index: 60;
  padding: 14px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 24px 60px -16px rgba(40, 36, 24, 0.28),
              0 4px 12px rgba(40, 36, 24, 0.08);
  font: 400 14px/1.5 var(--font-sans);
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 180ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
.gloss-popover.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.gloss-popover .term {
  font: 600 11px var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  margin: 0 0 6px;
}
.gloss-popover .def {
  margin: 0;
  color: var(--fg);
  font-family: var(--font-sans);
}

/* Responsive */
@media (max-width: 1024px) {
  .post-layout { grid-template-columns: 1fr; gap: 0; }
  .post-toc { display: none; }
  .post-toc-mobile { display: block; }
}
@media (max-width: 600px) {
  .post-adjacent { grid-template-columns: 1fr; }
  .post-adjacent a.next { text-align: left; }
  .post-body aside.pull-quote { font-size: 1.25em; padding: 22px 20px 22px 22px; }
  .post-body .post-part {
    margin: 3em -20px 2em;
    padding: 40px 24px 32px;
    border-radius: 20px;
  }
  .post-body .part-opener::first-letter { font-size: 4.5em; }
  .post-body .lead-paragraph { font-size: 1.15em; }
  .gloss-popover { max-width: calc(100vw - 24px) !important; }
}

/* ==========================================================
   Reader preferences — size, line spacing, theme
   Classes applied to <body> by blog-enhance.js
   ========================================================== */

/* Text size (applies to article body; headings keep their sizes) */
body.reader-size-sm .post-body { font-size: 16px; }
body.reader-size-md .post-body { font-size: 18px; }
body.reader-size-lg .post-body { font-size: 20px; }
body.reader-size-xl .post-body { font-size: 22px; }

/* Line spacing */
body.reader-lh-roomy .post-body { line-height: 1.95; }
body.reader-lh-roomy .post-body p { margin-bottom: 1.25em; }

/* Sepia theme — warms the article area only; nav/TOC/footer stay on brand */
body.reader-theme-sepia {
  background: #f3e4c7;
}
body.reader-theme-sepia .v2-blobs { opacity: 0.35; }
body.reader-theme-sepia .post-wrap,
body.reader-theme-sepia .post-layout {
  background: transparent;
}
body.reader-theme-sepia .post-body {
  color: #2e2512;
}
body.reader-theme-sepia .post-body strong { color: #201910; }
body.reader-theme-sepia .post-body h1,
body.reader-theme-sepia .post-body h2,
body.reader-theme-sepia .post-body h3,
body.reader-theme-sepia .post-title {
  color: #2a1f0e;
}
body.reader-theme-sepia .post-toc,
body.reader-theme-sepia .post-toc-mobile {
  background: rgba(250, 238, 217, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 18px;
  padding-left: 12px;
  padding-right: 4px;
}

/* Floating toolbar button */
.reader-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 40;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--surface);
  box-shadow: 0 14px 30px -10px rgba(40, 36, 24, 0.25),
              0 2px 6px rgba(40, 36, 24, 0.08);
  color: var(--fg-strong);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reader-toggle:hover,
.reader-toggle:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -12px rgba(40, 36, 24, 0.32),
              0 4px 8px rgba(40, 36, 24, 0.1);
  outline: none;
}
.reader-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(140, 106, 160, 0.3),
              0 14px 30px -10px rgba(40, 36, 24, 0.25);
}
.reader-toggle-ico {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--amethyst-700);
  line-height: 1;
}

/* Preferences panel */
.reader-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 41;
  width: 288px;
  padding: 20px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  box-shadow: 0 28px 60px -18px rgba(40, 36, 24, 0.32),
              0 4px 10px rgba(40, 36, 24, 0.08);
  animation: reader-pop-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.reader-panel[hidden] { display: none; }
.reader-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.reader-panel-title {
  font: 600 10px var(--font-sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amethyst-700);
  margin: 0;
}
.reader-panel-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 0 4px;
  transition: color 160ms;
}
.reader-panel-close:hover { color: var(--fg-strong); }
.reader-row {
  margin-bottom: 14px;
}
.reader-row-label {
  font: 600 10px var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 6px;
}
.reader-seg {
  display: grid;
  gap: 3px;
  padding: 3px;
  background: var(--bone-100);
  border-radius: 10px;
}
.reader-opt {
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: 500 13px var(--font-sans);
  color: var(--fg-strong);
  cursor: pointer;
  transition: background 160ms, color 160ms, box-shadow 160ms;
}
.reader-opt:hover {
  background: rgba(255, 255, 255, 0.55);
}
.reader-opt.on {
  background: var(--surface);
  color: var(--amethyst-800);
  box-shadow: 0 1px 3px rgba(40, 36, 24, 0.08),
              0 1px 2px rgba(40, 36, 24, 0.05);
}
.reader-opt-sm { font-size: 11px; }
.reader-opt-lg { font-size: 17px; }
.reader-reset {
  width: 100%;
  margin-top: 4px;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font: 500 10px var(--font-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.reader-reset:hover {
  background: var(--amethyst-100);
  border-color: var(--amethyst-300);
  color: var(--amethyst-800);
}

@keyframes reader-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 520px) {
  .reader-toggle { bottom: 16px; right: 16px; width: 48px; height: 48px; }
  .reader-panel { bottom: 76px; right: 16px; left: 16px; width: auto; }
}

/* =========================================================
   Sidebar simplification — MINI_TOC posts
   Hide h3 entries from the main sidebar and render an inline
   "In this section" mini-TOC inside each h2 section that has
   3+ h3 children. Scoped via body[data-mini-toc].
   ========================================================= */
body[data-mini-toc] .post-toc .toc-h3 { display: none; }
body[data-mini-toc] .post-toc-mobile .toc-h3 { display: none; }

.section-mini-toc {
  margin: 1.25rem 0 2rem;
  padding: 0.9rem 1.1rem;
  background: var(--bone-100);
  border-left: 3px solid var(--amethyst-600);
  border-radius: 4px;
}
.section-mini-toc__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--forest-800);
  margin: 0 0 0.5rem;
  font-weight: 600;
}
.section-mini-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.25rem 1.25rem;
}
.section-mini-toc a {
  color: var(--clay-700);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.4;
  display: block;
  padding: 0.15rem 0;
}
.section-mini-toc a:hover { color: var(--amethyst-700); }

/* =========================================================
   Body callout cards — CALLOUTS posts
   Promote <p><strong>Label:</strong> body</p> into a styled
   <aside class="callout-card"> via transformCallouts().
   ========================================================= */
.callout-card {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--bone-50), #fff);
  border-left: 4px solid var(--forest-800);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.callout-card__label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--forest-800);
  margin: 0 0 0.35rem;
}
.callout-card__body {
  margin: 0;
  color: var(--ink-800);
  font-size: 0.98rem;
  line-height: 1.55;
}

/* =========================================================
   Post body h4 — sub-subsection marker
   Used for nutrient / mechanism items demoted below h3
   (e.g. Zinc, Magnesium under Root Cause #4). Distinct
   from h3: smaller, less assertive weight, amethyst accent.
   ========================================================= */
.post-body h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--amethyst-700);
  margin: 1.5rem 0 0.5rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

/* =========================================================
   Post disclaimer — YMYL trust footer
   Shown beneath every blog post body, muted styling so it
   doesn't compete with content but stays legible.
   ========================================================= */
.post-disclaimer {
  margin: 2.5rem 0 1rem;
  padding: 1rem 1.25rem;
  background: var(--bone-100);
  border-left: 3px solid var(--bone-400);
  border-radius: 4px;
}
.post-disclaimer p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--bone-600);
}
.post-disclaimer strong {
  color: var(--forest-800);
}

/* =========================================================
   Podcast companion card
   Simple single-column layout: badge, title, description,
   Spotify player, fallback link. Rendered below the byline.
   ========================================================= */
.post-podcast {
  margin: 1.5rem 0 2rem;
  padding: 1.15rem 1.35rem 1rem;
  background: linear-gradient(180deg, #fff, var(--bone-50));
  border: 1px solid var(--amethyst-200);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(46, 30, 62, 0.04);
}
.post-podcast__meta { margin: 0 0 0.85rem; }
.post-podcast__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem;
  background: rgba(140, 106, 160, 0.14);
  color: var(--amethyst-700);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0 0 0.55rem;
  line-height: 1;
}
.post-podcast__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--forest-800);
  margin: 0 0 0.3rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.post-podcast__desc {
  margin: 0;
  color: var(--ink-800);
  font-size: 0.9rem;
  line-height: 1.5;
}
.post-podcast__player {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  margin: 0 0 0.5rem;
}
.post-podcast__link {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--amethyst-700);
  text-decoration: none;
  font-weight: 500;
}
.post-podcast__link:hover { text-decoration: underline; }

/* =========================================================
   Audio badge on blog-index post cards
   Icon-only circle pinned to the top-right of the post image
   when a post has a companion podcast episode.
   ========================================================= */
.post-card-img { position: relative; }
.post-card-audio {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  background: rgba(28, 26, 20, 0.78);
  color: var(--bone-50);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: transform 180ms ease-out, background-color 180ms ease-out;
}
.post-card:hover .post-card-audio {
  transform: scale(1.08);
  background: rgba(28, 26, 20, 0.92);
}

/* =========================================================
   Infographic break-out figure
   Full-bleed visual that extends beyond the prose column with
   a gradient frame, subtle caption, and click-to-zoom lightbox.
   ========================================================= */
.post-infographic {
  margin: 2rem auto;
  max-width: 100%;
}
.post-infographic__frame {
  display: block;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 220ms ease-out, box-shadow 220ms ease-out;
  box-shadow: 0 12px 28px -14px rgba(46, 30, 62, 0.28);
}
.post-infographic__frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 56px -24px rgba(46, 30, 62, 0.4);
}
.post-infographic__frame img {
  display: block;
  width: 100%;
  height: auto;
}
.post-infographic__zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(28, 26, 20, 0.78);
  color: var(--bone-50);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.post-infographic__zoom::before {
  content: "\2922";
  font-size: 0.85rem;
  line-height: 1;
}
.post-infographic__frame:hover .post-infographic__zoom,
.post-infographic__frame:focus-visible .post-infographic__zoom {
  background: rgba(46, 30, 62, 0.92);
}
.post-infographic figcaption {
  margin: 0.9rem auto 0;
  max-width: 60ch;
  text-align: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--bone-700);
}

/* Lightbox: full-viewport enlarged view triggered by clicking the frame */
.post-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10500;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(14, 12, 8, 0.92);
  padding: 2rem;
  cursor: zoom-out;
}
body.has-post-lightbox .post-lightbox { display: flex; }
body.has-post-lightbox { overflow: hidden; }
.post-lightbox__frame {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-lightbox__frame img {
  max-width: 100%;
  max-height: 90vh;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.post-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color 150ms;
}
.post-lightbox__close:hover { background: rgba(255, 255, 255, 0.22); }
