/* Meanwhile - component styles
 *
 * Extracted from the design's per-component injected <style> blocks. Lives in
 * one stylesheet so the Builder Page can be edited without inline <style>.
 * Class hooks (mw-*) match the markup the home Builder Page renders.
 */

/* ─── Page shell (sidebar + content grid) ────────────────────────────── */
html, body { background: var(--bg-color); }
html, body, #root, .mw-app { min-height: 100%; margin: 0; }

.mw-app {
  position: relative;
  z-index: 1;
  background: transparent;
}
.mw-app::before {
  /* Faint paper grain anchored to viewport - costs nothing, sells the brand. */
  content: '';
  position: fixed; inset: 0;
  background-image:
    radial-gradient(rgba(44,44,44,0.025) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  pointer-events: none;
  z-index: 0;
}

/* Fixed-position contour canvas sits behind everything */
#mw-contours {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.mw-page {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  background: transparent;
  position: relative;
  z-index: 1;
}
.mw-main { position: relative; min-width: 0; }
.mw-content {
  max-width: 920px;
  margin: 0 auto;
  padding: 8px 56px 200px;
  position: relative;
}
.mw-break { margin: 48px 0; background: var(--rule-color); }
.mw-mono-strong { font-family: var(--font-mono); font-weight: 500; color: var(--text-color); }

/* ─── Wordmark / logo ────────────────────────────────────────────────── */
.mw-wordmark {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--heading-color);
  display: inline-flex;
  align-items: baseline;
  line-height: 1;
}
.mw-wordmark-link { text-decoration: none; color: inherit; }
.mw-cursor { animation: mw-blink 1.2s steps(2, start) infinite; margin-left: 1px; }
@keyframes mw-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mw-cursor { animation: none; } }

/* ─── Sidebar ───────────────────────────────────────────────────────── */
.mw-sidebar {
  width: 240px;
  min-height: 100vh;
  border-right: 1px solid var(--rule-color);
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: transparent;
  font-family: var(--font-ui);
  position: sticky;
  top: 0;
  align-self: start;
}
.mw-sidebar-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-bottom: 4px; }
.mw-sidebar-meta {
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  opacity: 0.7;
  line-height: 1;
}

.mw-side-section { display: flex; flex-direction: column; gap: 6px; }
.mw-side-label { color: var(--text-muted); margin-bottom: 2px; }

.mw-nav-item {
  display: flex; align-items: center;
  padding: 6px 8px 6px 4px;
  border-radius: 3px;
  color: var(--text-color);
  text-decoration: none;
  transition: background 160ms ease-out, color 160ms ease-out;
  font-size: 15px;
}
.mw-nav-item:hover { background: rgba(90, 106, 74, 0.06); }
.mw-nav-item .mw-nav-label { font-family: var(--font-ui); font-weight: 500; letter-spacing: 0.01em; }
.mw-nav-item.is-active { background: var(--primary-light); color: var(--primary); }

/* Page-map tree - connected solid lines */
.mw-pagemap {
  list-style: none;
  margin: 0;
  padding: 0 0 0 14px;
  position: relative;
  display: flex; flex-direction: column;
}
.mw-pagemap::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--rule-color);
}
.mw-pagemap-item { margin: 0; padding: 0; position: relative; }
.mw-pagemap-link {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 4px 4px 14px;
  color: var(--text-light);
  text-decoration: none;
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: 0.005em;
  border-radius: 2px;
  transition: color 260ms cubic-bezier(.4, 0, .2, 1), background 260ms cubic-bezier(.4, 0, .2, 1);
  position: relative;
}
.mw-pagemap-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 1px;
  background: var(--rule-color);
}
.mw-pagemap-link:hover { color: var(--primary); background: rgba(90, 106, 74, 0.04); }

.mw-side-links { display: flex; flex-direction: column; gap: 2px; }
.mw-side-link {
  color: var(--text-color);
  text-decoration: none;
  font-size: 13.5px;
  padding: 3px 4px 3px 0;
  transition: color 160ms ease-out;
}
.mw-side-link:hover { color: var(--primary); }

/* ─── Top ribbon + visitor badge ─────────────────────────────────────── */
.mw-topribbon {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 16px 56px 0;
  gap: 16px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}
.mw-ribbon-left { padding-top: 4px; }

.mw-visitor { text-align: right; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.mw-visitor-tag {
  color: var(--primary);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  font-size: 11.5px;
  text-transform: none;
}
.mw-visitor-line2 { display: inline-flex; flex-wrap: wrap; gap: 6px; color: var(--text-muted); font-size: 11.5px; }

/* ─── Snapshot hero ──────────────────────────────────────────────────── */
/* Phase 16-02 TILE-08: hero band is full-bleed across the content column.
   Negative margins pull the article out of .mw-content's 56px side padding
   (24px at the @media (max-width: 760px) breakpoint) so the canvas reaches
   the inner edges of the central column with no whitespace either side.
   padding-top: 24px is preserved so the wordmark has its existing 24px
   buffer; the canvas (position:absolute inset:0) still reaches the top of
   the article box regardless, because absolute inset:0 covers the full
   border-box including padding. The band's own min-height keeps the canvas
   visible on narrow viewports where the wordmark wraps.

   Phase 16-03 Choice C: canvas extended to top of page via upward margin.
   margin-top: -120px pulls the article above the ribbon and content
   padding-top region (ribbon approx 50px + 8px content-top-padding +
   safety margin). padding-top: 144px compensates so the wordmark stays in
   the same visible vertical position. The canvas (inset:0 absolute child)
   automatically expands to cover the enlarged box. .mw-content gains
   position:relative so the negative margin is scoped. .mw-topribbon gains
   z-index:1 so its text paints above the canvas background. */
.mw-snapshot {
  position: relative;
  min-height: 420px;
  margin-top: -120px;
  padding-top: 144px;
  margin-left: -56px;
  margin-right: -56px;
  padding-left: 56px;
  padding-right: 56px;
}
@media (max-width: 760px) {
  .mw-snapshot {
    margin-top: -80px;
    padding-top: 104px;
    margin-left: -24px;
    margin-right: -24px;
    padding-left: 24px;
    padding-right: 24px;
  }
}
.mw-snapshot > .mw-hero-tiles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  display: block;
}
.mw-snap-stage {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 0 24px;
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
}
.mw-giant {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(72px, 13vw, 168px);
  line-height: 0.95;
  margin: 6px 0;
  letter-spacing: -0.035em;
  color: var(--heading-color);
  font-style: italic;
  cursor: pointer;
  outline: none;
}
.mw-giant:focus-visible { outline: 2px solid var(--primary); outline-offset: 6px; border-radius: 3px; }
.mw-giant-inner {
  display: inline-block;
  padding: 0 8px;
  transition: color 360ms cubic-bezier(.4, 0, .2, 1), text-shadow 360ms cubic-bezier(.4, 0, .2, 1);
}
.mw-giant-inner.is-on { color: var(--primary); }

.mw-word-row {
  display: flex; align-items: center; gap: 16px;
  width: 100%; max-width: 720px; margin: 0 auto;
}
.mw-word-btn {
  flex-shrink: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 11px;
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 3px;
  transition: color 270ms cubic-bezier(.4, 0, .2, 1), background 270ms cubic-bezier(.4, 0, .2, 1);
}
.mw-word-btn:hover { color: var(--text-color); background: rgba(90, 106, 74, 0.05); }
.mw-word-btn.is-on { color: var(--primary); background: var(--primary-light); }
.mw-word-bar { flex: 1; height: 1px; background: var(--rule-color); }

.mw-snap-caption { max-width: 56ch; margin: 16px auto 0; text-align: center; color: var(--text-color); }
.mw-snap-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }

/* ─── Section heads ──────────────────────────────────────────────────── */
.mw-sec-head { margin: 40px 0 24px; display: flex; flex-direction: column; gap: 6px; }
.mw-sec-title { margin: 0; }
.mw-sec-subtitle { color: var(--text-color); }
.mw-sec-head-find {
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.mw-find-hint {
  font-style: italic;
  color: var(--text-muted);
  padding-bottom: 4px;
  white-space: nowrap;
}

/* ─── HoverExpand pattern ────────────────────────────────────────────── */
.mw-hx {
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background 240ms cubic-bezier(.4, 0, .2, 1), border-color 240ms cubic-bezier(.4, 0, .2, 1);
}
.mw-hx:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }
.mw-hx-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 330ms cubic-bezier(.4, 0, .2, 1), opacity 300ms cubic-bezier(.4, 0, .2, 1);
  opacity: 0;
}
.mw-hx-more-inner { overflow: hidden; min-height: 0; }
.mw-hx.is-open .mw-hx-more { grid-template-rows: 1fr; opacity: 1; }
.mw-hx.is-open .mw-hx-more-inner { padding-top: 8px; }
.mw-hx.is-pinned { background: rgba(90, 106, 74, 0.04); }
.mw-hx-pin {
  position: absolute;
  top: 10px; right: 10px;
  color: var(--primary);
  font-size: 9px;
  line-height: 1;
  transition: opacity 240ms cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}
.mw-hx-pin.is-available { opacity: 0; color: var(--text-muted); }
.mw-hx:hover .mw-hx-pin.is-available,
.mw-hx:focus-visible .mw-hx-pin.is-available { opacity: 0.55; }
.mw-hx-pin.is-pinned { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .mw-hx-more { transition: none; } }

/* ─── Category rows ──────────────────────────────────────────────────── */
.mw-rows { display: flex; flex-direction: column; border-top: 1px solid var(--rule-color); }
.mw-row {
  position: relative;
  border-bottom: 1px solid var(--rule-color);
  padding: 22px 20px 20px;
  display: block;
}
.mw-row-top { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: baseline; }
.mw-row-lead { display: flex; flex-direction: column; gap: 3px; }
.mw-row-chapter { color: var(--primary); }
.mw-row-title { grid-row: 1; grid-column: 2; }
.mw-row-short { grid-row: 2; grid-column: 2; color: var(--text-light); max-width: 58ch; }
.mw-row-pinhint {
  position: absolute;
  right: 10px; top: 30px;
  font-size: 10px;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  letter-spacing: 0.02em;
  text-align: right;
  transition: opacity 260ms cubic-bezier(.4, 0, .2, 1);
}
.mw-row:hover .mw-row-pinhint,
.mw-row:focus-within .mw-row-pinhint { opacity: 0.7; }
.mw-row-more { padding: 6px 0 6px 190px; max-width: 62ch; }
.mw-row-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.mw-btn-flex {
  min-width: 0;
  width: auto;
  white-space: nowrap;
  height: auto;
  min-height: 30px;
  padding: 6px 14px;
  line-height: 1.25;
}

/* ─── Now items (latest letter, latest blog) ─────────────────────────── */
.mw-now-item { display: flex; flex-direction: column; gap: 10px; }
.mw-now-head { display: flex; align-items: baseline; gap: 12px; }
.mw-now-meta { color: var(--text-muted); }
.mw-now-title { margin: 0; max-width: 28ch; }
.mw-now-lede { max-width: 60ch; color: var(--text-color); }
.mw-now-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ─── Endeavour section ──────────────────────────────────────────────── */
.mw-endeavour-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: start; }
.mw-endeavour-copy { display: flex; flex-direction: column; gap: 14px; }
.mw-fact-panel {
  display: flex; flex-direction: column; gap: 0;
  padding: 16px 20px;
  border: 1px solid var(--rule-color);
  background: var(--fg-color);
  border-radius: 3px;
}
.mw-fact-row { padding: 12px 4px; }
.mw-fact-row .t-label { color: var(--text-muted); margin-bottom: 4px; }
.mw-fact-more { font-size: 15px; margin: 0; color: var(--text-light); }

/* ─── Approach section ───────────────────────────────────────────────── */
.mw-approach-body { display: flex; flex-direction: column; gap: 28px; }
.mw-approach-lede {
  font-size: 40px;
  line-height: 1.2;
  font-family: var(--font-serif);
  max-width: 22ch;
  text-wrap: pretty;
  color: var(--heading-color);
}
.mw-approach-em { font-style: italic; color: var(--text-light); }
.mw-approach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule-color); }
.mw-tile {
  display: block;
  padding: 18px 20px 20px;
  border-right: 1px solid var(--rule-color);
  border-bottom: 1px solid var(--rule-color);
}
.mw-tile:last-child { border-right: 0; }
.mw-tile .t-label { color: var(--text-muted); margin-bottom: 6px; }
.mw-tile-title { margin: 2px 0 6px; }
.mw-tile-short { color: var(--text-light); }
.mw-tile-more { font-size: 15px; margin: 0; color: var(--text-light); }

/* ─── Footer ─────────────────────────────────────────────────────────── */
.mw-footer {
  display: grid; grid-template-columns: 1.1fr 1fr 1.4fr;
  gap: 32px;
  padding: 32px 0 0;
}
.mw-footer-col { display: flex; flex-direction: column; gap: 4px; }
.mw-footer-col .t-label { margin-bottom: 6px; }
.mw-footer-col-nav { flex-direction: row; flex-wrap: wrap; gap: 16px 18px; align-items: flex-start; }
.mw-footer-credit { color: var(--text-muted); line-height: 1.6; }

/* On narrow screens (mobile / collapsed sidebar) layout adjustments */
@media (max-width: 720px) {
  .mw-page { grid-template-columns: 1fr; }
  .mw-sidebar {
    position: static;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--rule-color);
    min-height: auto;
  }
  .mw-content { padding: 8px 24px 200px; }
  .mw-topribbon { padding: 16px 24px 0; }
  .mw-row-top { grid-template-columns: 1fr; }
  .mw-row-title, .mw-row-short { grid-column: 1; }
  .mw-row-more { padding-left: 0; }
  .mw-endeavour-grid { grid-template-columns: 1fr; gap: 24px; }
  .mw-approach-grid { grid-template-columns: 1fr; }
  .mw-tile { border-right: 0; }
}

/* ─── Pencil draw tool (Phase 07) ────────────────────────────────────── */
/* Full-viewport overlay. Click-through by default; pencil-tool.js toggles
   pointer-events to 'auto' on the inner <canvas> when draw mode is on.
   Sits ABOVE page content (z-index 1). With the dock removed in
   Phase 13 NEW, the overlay is the topmost interactive element
   so draw mode no longer competes with another fixed element. */
.mw-pencil-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
.mw-pencil-overlay.is-drawing {
  /* The inner <canvas> sets its own pointer-events:auto via JS; this
     class is for testability / future hooks. */
}

/* Toolbar: positioned fixed in the upper-right of the viewport, OUTSIDE
   .mw-app so it is not trapped in .mw-app's z-index:1 stacking context.
   z-index 49 so it sits above the overlay (40).
   pointer-events:auto unconditionally so the toggle button is always
   reachable, even when the overlay below it is capturing pointer events.
   top: 52px sits the toolbar on the line BELOW the top ribbon's weather
   string (ribbon has 16px top padding + ~32px content). Originally 18px
   in Phase 07 but that overlapped the visitor-badge text; corrected
   2026-04-27 per issue 20260427-pencil-toolbar-overlaps-ribbon.md. */
.mw-pencil-toolbar {
  position: fixed;
  top: 52px;
  right: 24px;
  z-index: 49;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  pointer-events: auto;
}

/* Buttons: invisible by default (icon colour matches background), become
   visible on hover. is-active state uses dark grey + sage border for the
   currently selected mode. */
.mw-pencil-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 5px;
  font: inherit;
  cursor: pointer;
  color: rgba(44, 44, 44, 0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  transition: color 120ms, background 120ms, border-color 120ms;
}
.mw-pencil-btn:hover {
  color: rgba(44, 44, 44, 0.78);
  background: var(--fg-color, #fff);
  border-color: var(--border-color, #ccc);
}
.mw-pencil-btn.is-active {
  color: var(--text-color, #2c2c2c);
  background: var(--fg-color, #fff);
  border-color: var(--primary, #6b8a6f);  /* sage border for active mode */
}
.mw-pencil-btn-clear {
  /* Clear is a text button, not an icon. Slightly wider, label-style. */
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  padding: 5px 8px;
  min-width: 0;
}
.mw-pencil-btn-clear.is-armed {
  /* Two-step confirm: amber tint signals one more click commits. */
  color: rgba(196, 136, 47, 0.95);  /* amber from the design palette */
  border-color: rgba(196, 136, 47, 0.45);
  background: rgba(196, 136, 47, 0.06);
}

/* prefers-reduced-motion: belt-and-braces. tokens.css line 135-137 already
   blanket-disables transitions when this media query matches; restating
   here for documentation and so a future tokens.css change does not
   regress this affordance. */
@media (prefers-reduced-motion: reduce) {
  .mw-pencil-btn { transition: none; }
}

/* ----- Phase 08: peaceful weather modal --------------------------------- */

/* Trigger styling (WEATHER-01): pointer, no underline, no border, inherited colour. */
.mw-weather-trigger {
  cursor: pointer;
  text-decoration: none;
  border-bottom: 0;
  color: inherit;
  background: transparent;
  padding: 0;
  font: inherit;
}
.mw-weather-trigger:hover,
.mw-weather-trigger:focus-visible {
  text-decoration: none;
  border-bottom: 0;
  color: inherit;
  outline: none;
}
.mw-weather-trigger:focus-visible {
  /* Subtle keyboard focus ring: calm, not loud. */
  outline: 1px dotted currentColor;
  outline-offset: 2px;
}

/* Dialog: full-bleed. Top layer via showModal() sidesteps z-index containment. */
dialog.mw-peaceful-dialog {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}
dialog.mw-peaceful-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
dialog.mw-peaceful-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas wrap: centred, bounded at 80vw / 80vh, warm paper background. */
.mw-peaceful-canvas-wrap {
  position: relative;
  width: min(80vw, 1200px);
  height: min(80vh, 900px);
  background: var(--mw-paper, #FAFAF8);
  border-radius: 4px;
  overflow: hidden;
}
.mw-peaceful-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Legend: small monospace, bottom-left, semi-transparent white. */
.mw-peaceful-legend {
  position: fixed;
  bottom: 24px;
  left: 24px;
  font-family: var(--mw-font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}
.mw-peaceful-legend > div { white-space: nowrap; }

/* Close button: top-right corner, plain lowercase text, monospace. */
.mw-peaceful-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--mw-font-mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  cursor: pointer;
  padding: 6px 10px;
}
.mw-peaceful-close:hover,
.mw-peaceful-close:focus-visible {
  color: #fff;
  outline: 1px dotted currentColor;
  outline-offset: 2px;
}

/* Reduced-motion: suppress modal transition. Harmonograph gate is in JS (T1). */
@media (prefers-reduced-motion: reduce) {
  dialog.mw-peaceful-dialog,
  dialog.mw-peaceful-dialog::backdrop {
    transition: none;
    animation: none;
  }
}

/* ─── Content-page reading rhythm (blog posts + deeper Builder Pages) ──────
   Applies to every /blog/<slug> post and every deeper page (intent-spec,
   inference-audit, capability-licensing, timeline, moving-lens,
   moving-lens/method, research-arm, failure-modes). Both render their intro
   through .mw-content-lede and their prose inside .mw-blog-body. */

/* Lede: distinct from body, but deliberately NOT the 56px .t-hero giant, so a
   long intro cannot fill the screen. ~23px serif at a relaxed line-height. */
.mw-content-lede {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 23px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--heading-color);
  max-width: 60ch;
  margin: 0 0 1.25em;
}

/* Paragraph spacing: Frappe's website bundle zeroes <p> margins, so content
   paragraphs ran together with no gap. Restore a readable ~1em gap between
   paragraphs inside the shared content-body wrapper. */
.mw-blog-body p { margin: 0 0 1em; }
.mw-blog-body p:last-child { margin-bottom: 0; }

/* Letter pages use their own .mw-letter-body wrapper; mirror the blog rule so
   /letters/<slug> prose gets the same readable paragraph rhythm. */
.mw-letter-body p { margin: 0 0 1em; }
.mw-letter-body p:last-child { margin-bottom: 0; }

/* Link visibility inside content bodies -- reported as a defect twice, must
   not regress. Links must look like links: accent blue + underline. Scoped
   to prose containers only, so the site's other link treatments (.mw-nav-item,
   .mw-pagemap-link, .mw-side-link) are untouched. :not(.link) additionally
   protects the many existing body/meta links across older pages (Reflecting,
   Timeline, Moving Lens, Capability Licensing, and others) that already opt
   into the .link pill-underline treatment explicitly -- .mw-blog-body a and
   .t-meta a alone would outrank the single-class .link selector on
   specificity and silently reskin every one of them. Bare/unstyled anchors
   (the actual "invisible link" case) still get full coverage. */
.mw-blog-body a:not(.link),
.mw-content-lede a:not(.link),
.t-meta a:not(.link) {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-color: rgba(58, 107, 159, 0.45);
  text-underline-offset: 2px;
  transition: text-decoration-color 160ms ease-out, color 160ms ease-out;
}
.mw-blog-body a:not(.link):hover,
.mw-content-lede a:not(.link):hover,
.t-meta a:not(.link):hover {
  text-decoration-color: var(--accent-blue);
}
.mw-blog-body a:not(.link):visited,
.mw-content-lede a:not(.link):visited,
.t-meta a:not(.link):visited {
  color: rgba(58, 107, 159, 0.72);
}

/* Readability column: cap the prose measure independently of .mw-content's
   920px column, so a full-width viewport doesn't stretch body copy past a
   comfortable line length. line-height mirrors .t-body's 1.65 explicitly,
   since not every .mw-blog-body caller also carries the .t-body class. */
.mw-blog-body {
  max-width: 768px;
  line-height: 1.65;
}

/* Headings inside prose. Deliberately distinct from the page-level
   .t-page/.t-section scale, so a body <h2> reads as "inside the article"
   rather than as another chapter heading. */
.mw-blog-body h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.25;
  color: var(--heading-color);
  margin: 1.8em 0 0.6em;
}
.mw-blog-body h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 21px;
  line-height: 1.3;
  color: var(--heading-color);
  margin: 1.6em 0 0.5em;
}
.mw-blog-body h4 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.35;
  color: var(--heading-color);
  margin: 1.4em 0 0.4em;
}
.mw-blog-body h2:first-child,
.mw-blog-body h3:first-child,
.mw-blog-body h4:first-child {
  margin-top: 0;
}

/* Lists */
.mw-blog-body ul,
.mw-blog-body ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}
.mw-blog-body ul:last-child,
.mw-blog-body ol:last-child {
  margin-bottom: 0;
}
.mw-blog-body li { margin: 0 0 0.4em; }
.mw-blog-body li:last-child { margin-bottom: 0; }
.mw-blog-body li > ul,
.mw-blog-body li > ol {
  margin-top: 0.4em;
}

/* Blockquote */
.mw-blog-body blockquote {
  margin: 1.4em 0;
  padding: 0.1em 0 0.1em 1.2em;
  border-left: 3px solid var(--border-color);
  color: var(--text-light);
  font-style: italic;
}
.mw-blog-body blockquote p:last-child { margin-bottom: 0; }

/* Inline code + code blocks */
.mw-blog-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--control-bg);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}
.mw-blog-body pre {
  font-family: var(--font-mono);
  font-size: 0.85em;
  line-height: 1.5;
  background: var(--control-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1em 1.2em;
  margin: 0 0 1em;
  overflow-x: auto;
}
.mw-blog-body pre code {
  background: none;
  border: 0;
  padding: 0;
}

/* Horizontal rule: same tone as the shared .rule divider, given breathing
   room appropriate to a mid-article break rather than a section join. */
.mw-blog-body hr {
  height: 1px;
  border: 0;
  background: var(--rule-color);
  margin: 2em 0;
}

/* Tables. display:block + overflow-x:auto lets a wide table scroll on
   narrow viewports without needing a wrapper element the fixture HTML
   doesn't have. */
.mw-blog-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-family: var(--font-ui);
  font-size: 14px;
}
.mw-blog-body th,
.mw-blog-body td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.mw-blog-body th {
  background: var(--control-bg);
  font-weight: 600;
  color: var(--heading-color);
}
.mw-blog-body tbody tr:nth-child(even) td {
  background: rgba(44, 44, 44, 0.02);
}

/* Inline figures (reviewed diagrams + the code-map image) placed inside content
   bodies. The wrapper gives vertical breathing room; the caption reads as quiet
   metadata under the visual. */
.mw-figure { margin: 2rem 0; }
.mw-figure figcaption {
  margin-top: 0.5rem;
  color: var(--text-muted, #6A6A6A);
  font-size: 0.85rem;
}

