/* ============================================================================
   magazine.css — the Grosso magazine reader (MAGAZINE.md, items 172–176)
   ----------------------------------------------------------------------------
   Base rules style the SERVER document (no JS): a scroll-snap strip of page
   pictures, then the article. `.mag--js` + one of `.mag--gl | --flat | --scroll`
   is added by src/runtime/magazine/reader.js. Colors come from the edition
   (--mag-bg / --mag-accent on #mag) and the site tokens (--gu-*).
   ============================================================================ */

.mag {
  --mag-ink: #f3efe6;
  --mag-dim: color-mix(in srgb, var(--mag-ink) 68%, transparent);
  --mag-line: color-mix(in srgb, var(--mag-accent, #be9a66) 30%, transparent);
  --mag-panel: color-mix(in srgb, var(--mag-bg, #0a1233) 82%, #000);
  --mag-tap: 44px;
  --mag-pw: 612px; --mag-ph: 792px;
  display: block;
  color: var(--mag-ink);
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--mag-accent, #be9a66) 14%, transparent), transparent 60%),
    radial-gradient(90% 60% at 50% 100%, color-mix(in srgb, #000 40%, transparent), transparent 70%),
    var(--mag-bg, #0a1233);
  font-family: var(--gu-font-text, system-ui, sans-serif);
  overflow-x: clip;
}
.mag *, .mag *::before, .mag *::after { box-sizing: border-box; }
/* The min-width:0 rule (site.css): every flex/grid parent below lists its children here. */
:where(.mag-toolbar, .mag-tb__grp, .mag-pages, .mag-calc__live, .mag-calc__nums, .mag-opt,
       .mag-search, .mag-go, .mag-pop__head, .mag-grid ol, .mag-article, .mag-reader) > * { min-width: 0; }

.mag-sr, .mag-tb__t {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Reader shell ─────────────────────────────────────────────────────── */
.mag-reader {
  position: relative;
  padding: clamp(10px, 2vw, 22px) clamp(8px, 2vw, 24px) clamp(14px, 3vw, 32px);
  display: flex; flex-direction: column; gap: 12px;
}
.mag-toolbar {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 14px;
  font-family: var(--gu-font-display, system-ui, sans-serif);
}
.mag-toolbar > a { color: var(--mag-ink); padding: 12px 10px; min-height: var(--mag-tap); display: inline-flex; align-items: center; }
.mag-tb__grp {
  display: flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 999px;
  background: color-mix(in srgb, #000 28%, transparent);
  border: 1px solid var(--mag-line);
}
.mag-tb {
  appearance: none; border: 0; background: transparent; color: var(--mag-ink);
  min-width: var(--mag-tap); height: var(--mag-tap); padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: background-color 140ms, color 140ms, transform 140ms;
  font: 600 0.9rem/1 var(--gu-font-display, system-ui, sans-serif);
}
.mag-tb svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.mag-tb:hover:not(:disabled) { background: color-mix(in srgb, var(--mag-accent) 22%, transparent); }
.mag-tb:active:not(:disabled) { transform: scale(0.95); }
.mag-tb:disabled { opacity: 0.35; cursor: default; }
.mag-tb[aria-pressed="true"], .mag-tb.is-on { background: var(--mag-accent); color: #0b1330; }
.mag :focus-visible { outline: 3px solid var(--mag-accent); outline-offset: 2px; }
.mag-count { min-width: 92px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.mag-count__n { color: var(--mag-dim); font-weight: 500; }

/* ── Stage ────────────────────────────────────────────────────────────── */
.mag-stage { position: relative; }
.mag--gl .mag-stage { height: clamp(340px, var(--mag-fit, calc(100svh - 230px)), 1100px); }
.mag--gl .mag-pages { display: none; }
.mag-book { position: absolute; inset: 0; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.mag-book.is-zoomed { cursor: grab; }
.mag-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mag-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mag--gridopen .mag-book, .mag--gridopen .mag-pages { visibility: hidden; }

/* Page overlays: text layer + hotspots, in PDF points, scaled as one unit. */
.mag-pv { position: absolute; pointer-events: none; }
.mag-frame > .mag-pv { inset: 0; }
.mag-text {
  position: absolute; left: 0; top: 0; width: var(--mag-pw); height: var(--mag-ph);
  transform: scale(var(--mag-s, 1)); transform-origin: 0 0;
  line-height: 1; overflow: hidden;
}
/* A drag on the page turns it (1x) or pans it (zoomed) — everywhere, including
   over text, because nearly all of a brochure page IS text. The layer still
   carries find-in-page, search highlights and read-aloud. Selecting text off the
   page is the toolbar's Select text tool (.mag--select); the article below is always
   selectable. (verify-human 2026-09-30: text-first drags never turned.) */
.mag-text span {
  position: absolute; white-space: pre; color: transparent; transform-origin: 0 0;
  /* Click-through unless the Select text tool is on: the book container handles
     drags, and in scroll view the spans sat over the page link (phone hit-probe). */
  pointer-events: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.mag-book.mag--select .mag-text span { pointer-events: auto; cursor: text; user-select: text; -webkit-user-select: text; }
.mag-book.mag--select { touch-action: auto !important; user-select: text; -webkit-user-select: text; }
.mag-sel[aria-pressed="true"] { background: var(--mag-accent); color: #0a1233; }
.mag-book.mag--dragging, .mag-book.mag--dragging * { cursor: grabbing; }
.mag-text span::selection { background: rgb(20 77 163 / 0.35); color: transparent; }
.mag-hots { position: absolute; inset: 0; }
.mag-hot {
  position: absolute; pointer-events: auto;
  --bw: max(var(--hw), var(--mag-tap)); --bh: max(var(--hh), var(--mag-tap));
  width: var(--bw); height: var(--bh);
  /* Centred on its anchor, but clamped so the 44px tap box never hangs off the
     page: an anchor on a page's bottom band (page 2's "Explore our event space
     tiers") put it 6px past the edge (the scene audit found it). */
  left: clamp(calc(var(--bw) / 2), var(--hx), calc(100% - var(--bw) / 2));
  top: clamp(calc(var(--bh) / 2), var(--hy), calc(100% - var(--bh) / 2));
  transform: translate(-50%, calc(-50% + var(--dy, 0px)));   /* --dy: separateHotspots() */
  border: 0; background: transparent; padding: 0; margin: 0; cursor: pointer;
  border-radius: 10px; color: #0b1330;
  outline: 1.5px solid transparent;
  transition: background-color 160ms, outline-color 160ms, box-shadow 160ms;
}
.mag-hot::after {
  /* The affordance: a small gold beacon on the hotspot's corner. */
  content: ""; position: absolute; right: -5px; top: -5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--mag-accent); box-shadow: 0 0 0 3px rgb(255 255 255 / 0.85), 0 2px 6px rgb(0 0 0 / 0.4);
}
@media (prefers-reduced-motion: no-preference) {
  .mag-hot::after { animation: magBeacon 2.4s ease-in-out infinite; }
}
@keyframes magBeacon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.mag-hot:hover, .mag-hot:focus-visible {
  background: color-mix(in srgb, var(--mag-accent) 22%, transparent);
  outline-color: var(--mag-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--mag-accent) 30%, transparent);
}
.mag-hot__ico { display: none; }
.mag-hot__label {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  white-space: nowrap; pointer-events: none; opacity: 0;
  background: #0b1330; color: #fff; border: 1px solid var(--mag-accent);
  font: 600 13px/1 var(--gu-font-display, system-ui, sans-serif); padding: 8px 10px; border-radius: 999px;
  transition: opacity 160ms, transform 160ms;
}
.mag-hot:hover .mag-hot__label, .mag-hot:focus-visible .mag-hot__label { opacity: 1; transform: translate(-50%, 0); }

/* ── Strip (no JS, and the flat view) ─────────────────────────────────── */
.mag-pages {
  list-style: none; margin: 0; padding: 8px max(4vw, calc(50% - min(44vw, 34svh))) 18px;
  display: flex; gap: clamp(12px, 2vw, 28px);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 4vw;
  scrollbar-color: var(--mag-accent) transparent;
}
.mag-page {
  flex: 0 0 auto; scroll-snap-align: center; position: relative;
  /* --mag-fit is the measured room under the stage (reader.fitStage); the
     26px is the strip's own vertical padding. 68svh is the no-JS guess. */
  width: calc(min(88vw, (var(--mag-fit, 68svh) - 26px) * 0.7727) * var(--mag-z, 1));
  content-visibility: auto; contain-intrinsic-size: auto 480px;
}
.mag-page a, .mag-frame { display: block; position: relative; }
.mag-page picture, .mag-page img {
  display: block; width: 100%; height: auto; aspect-ratio: 612 / 792;
  background: var(--bg, #fff);
}
.mag-page img { box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.65), 0 2px 6px rgb(0 0 0 / 0.35); border-radius: 2px; }

/* ── Scroll view (phones, feature 24) ─────────────────────────────────── */
.mag--scroll .mag-pages {
  display: grid; gap: 28px; overflow: visible; padding: 4px 0 24px; scroll-snap-type: none;
}
.mag--scroll .mag-page { width: min(100%, 720px); margin-inline: auto; contain-intrinsic-size: auto 1400px; }
.mag--scroll .mag-page > .mag-sec { margin-top: 18px; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .mag--scroll .mag-frame {
      animation: magRise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}
@keyframes magRise {
  from { opacity: 0.25; transform: translateY(28px) scale(0.965); }
  to { opacity: 1; transform: none; }
}

/* ── Grid (feature 18) ────────────────────────────────────────────────── */
.mag-grid { position: absolute; inset: 0; overflow: auto; padding: 6px; }
.mag--flat .mag-grid, .mag--scroll .mag-grid { position: relative; inset: auto; }
.mag-grid[hidden] { display: none; }
.mag-grid ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(132px, 40%), 1fr));
}
.mag-grid button {
  appearance: none; border: 0; background: none; padding: 0; width: 100%; cursor: pointer; color: var(--mag-ink);
  display: grid; gap: 6px; justify-items: center; font: 600 0.85rem/1 var(--gu-font-display, system-ui, sans-serif);
}
.mag-grid img {
  width: 100%; height: auto; aspect-ratio: 320 / 414; display: block; border-radius: 3px;
  box-shadow: 0 10px 24px -8px rgb(0 0 0 / 0.7); transition: transform 180ms var(--gu-ease, ease);
}
.mag-grid button:hover img, .mag-grid button:focus-visible img { transform: translateY(-3px); outline: 2px solid var(--mag-accent); }
::view-transition-group(mag-page) { animation-duration: 380ms; animation-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }

/* ── Popovers ─────────────────────────────────────────────────────────── */
.mag-pop {
  margin: 0; inset: auto; position: fixed; top: 72px; right: max(16px, calc(50% - 560px));
  width: min(420px, calc(100vw - 32px)); max-height: min(70svh, 640px); overflow: auto;
  background: var(--mag-panel); color: var(--mag-ink);
  border: 1px solid var(--mag-line); border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgb(0 0 0 / 0.75);
  padding: 8px 14px 14px;
}
.mag-pop--legacy { z-index: 50; }
.mag-pop[hidden] { display: none; }
.mag-pop::backdrop { background: rgb(0 0 0 / 0.25); }
.mag-pop--go { width: min(300px, calc(100vw - 32px)); }
.mag-pop__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mag-pop__h { margin: 0; font: 700 0.95rem/1.2 var(--gu-font-display, system-ui, sans-serif); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mag-accent); }
.mag-toc-list { list-style: none; margin: 4px 0 0; padding: 0; }
.mag-toc-list button {
  width: 100%; min-height: var(--mag-tap); display: flex; justify-content: space-between; gap: 12px; align-items: center;
  text-align: left; appearance: none; border: 0; border-bottom: 1px solid var(--mag-line); background: none;
  color: var(--mag-ink); padding: 10px 6px; cursor: pointer; font: 500 0.98rem/1.3 var(--gu-font-text, system-ui, sans-serif);
}
.mag-toc-list .d1 button { padding-left: 22px; color: var(--mag-dim); }
.mag-toc-list button:hover { background: color-mix(in srgb, var(--mag-accent) 14%, transparent); }
.mag-toc-p { color: var(--mag-accent); font-variant-numeric: tabular-nums; font-weight: 700; }
.mag-search { display: flex; gap: 4px; align-items: center; margin-top: 6px; }
.mag-search input, .mag-go input {
  flex: 1; min-height: var(--mag-tap); font-size: 16px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--mag-line); background: rgb(0 0 0 / 0.3); color: var(--mag-ink);
}
.mag-search__status { margin: 8px 2px; color: var(--mag-dim); font-size: 0.9rem; }
.mag-search__res { list-style: none; margin: 0; padding: 0; }
.mag-search__res button {
  width: 100%; min-height: var(--mag-tap); display: grid; grid-template-columns: auto 1fr; gap: 10px; text-align: left;
  appearance: none; border: 0; border-bottom: 1px solid var(--mag-line); background: none; color: var(--mag-ink);
  padding: 8px 4px; cursor: pointer; font: 0.92rem/1.35 var(--gu-font-text, system-ui, sans-serif);
}
.mag-search__res button[aria-current] { background: color-mix(in srgb, var(--mag-accent) 18%, transparent); }
.mag-search__res mark { background: var(--mag-accent); color: #0b1330; border-radius: 2px; padding: 0 1px; }
.mag-res__p { color: var(--mag-accent); font-weight: 700; white-space: nowrap; }
.mag-go { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 0 2px; }
.mag-go label { width: 100%; font-weight: 600; }
.mag-btn {
  min-height: var(--mag-tap); padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--mag-accent); color: #0b1330; font: 700 0.95rem/1 var(--gu-font-display, system-ui, sans-serif);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.mag-btn:hover { filter: brightness(1.08); }

.mag-toast {
  position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 32px); overflow-wrap: anywhere;
  background: #0b1330; color: #fff; border: 1px solid var(--mag-accent); border-radius: 999px;
  padding: 10px 18px; font: 600 0.9rem/1.3 var(--gu-font-display, system-ui, sans-serif);
  transition: opacity 200ms, transform 200ms; z-index: 5;
}
.mag-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Full screen ──────────────────────────────────────────────────────── */
.mag-reader:fullscreen, .mag-reader.is-pseudo-fs {
  background: var(--mag-bg, #0a1233); padding: 10px; overflow: auto;
}
.mag-reader.is-pseudo-fs { position: fixed; inset: 0; z-index: 1000; }
.mag--gl .mag-reader:fullscreen .mag-stage, .mag--gl .mag-reader.is-pseudo-fs .mag-stage { height: calc(100dvh - 90px); }

/* ── Search / read-aloud highlights (CSS Custom Highlight API) ─────────── */
::highlight(mag-hit) { background-color: rgb(190 154 102 / 0.38); }
::highlight(mag-hit-cur) { background-color: #e7c78f; color: #0b1330; }
::highlight(mag-hit-page) { background-color: rgb(231 170 60 / 0.5); }
::highlight(mag-tts) { background-color: rgb(190 154 102 / 0.6); color: #0b1330; }

/* ── Article (every word of the edition as HTML) ──────────────────────── */
.mag-article {
  max-width: 76ch; margin: 0 auto; padding: clamp(24px, 5vw, 64px) clamp(16px, 4vw, 24px) clamp(40px, 6vw, 80px);
  line-height: 1.65; font-size: var(--gu-text-base, 1rem);
}
.mag-article header h1 {
  font-family: var(--gu-font-display, system-ui, sans-serif); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; line-height: 1.05; font-size: var(--gu-text-3xl, 2.2rem); margin: 0 0 8px;
  overflow-wrap: break-word;
}
.mag-issue { color: var(--mag-accent); font: 700 0.85rem/1.2 var(--gu-font-display, system-ui, sans-serif); letter-spacing: 0.16em; text-transform: uppercase; }
.mag-summary { color: var(--mag-dim); font-size: 1.08em; }
.mag-article h2, .mag-article h3, .mag-article h4, .mag-article h5 {
  font-family: var(--gu-font-display, system-ui, sans-serif); line-height: 1.2; overflow-wrap: break-word;
}
.mag-article a { color: #e7c78f; }
.mag-toc { border: 1px solid var(--mag-line); border-radius: 12px; padding: 12px 18px; margin: 28px 0; }
.mag-toc ol { margin: 0; padding-left: 1.2em; }
.mag-toc li { padding: 4px 0; }
.mag-toc a { display: inline-block; padding: 8px 0; }
.mag-toc__d1 { margin-left: 1.2em; }
.mag-sec {
  border-top: 1px solid var(--mag-line); padding-top: 22px; margin-top: 30px;
  content-visibility: auto; contain-intrinsic-size: auto 900px;
}
.mag--scroll .mag-page > .mag-sec { border-top: 0; padding: 0 4px; }
.mag-sec h2 { font-size: var(--gu-text-2xl, 1.6rem); margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.mag-sec__summary { color: var(--mag-dim); font-style: italic; }
.mag-kicker { color: var(--mag-accent); font-weight: 700; letter-spacing: 0.04em; }
.mag-sec__view { display: inline-flex; align-items: center; min-height: var(--mag-tap); font-weight: 600; }
.mag-faq { margin-top: 40px; content-visibility: auto; contain-intrinsic-size: auto 800px; }
.mag-faq details { border-bottom: 1px solid var(--mag-line); }
.mag-faq summary { cursor: pointer; padding: 12px 0; min-height: var(--mag-tap); font-weight: 600; }

/* ── Calculator (feature 27) ──────────────────────────────────────────── */
.mag-calc { margin-top: 48px; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--mag-line); border-radius: 16px; background: rgb(0 0 0 / 0.22); scroll-margin-top: calc(var(--gu-nav-header-h, 73px) + 16px); transition: box-shadow 400ms; }
.mag-calc.is-flash { box-shadow: 0 0 0 4px var(--mag-accent); }
.mag-calc h2 { margin-top: 0; text-transform: uppercase; letter-spacing: 0.05em; }
.mag-calc__table { width: 100%; border-collapse: collapse; font-size: 0.92rem; display: block; overflow-x: auto; }
.mag-calc__table caption { text-align: left; color: var(--mag-dim); padding-bottom: 6px; }
.mag-calc__table th, .mag-calc__table td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--mag-line); vertical-align: top; }
.mag-calc__table a { display: inline-block; padding: 4px 0; }
.mag-calc__live { display: grid; gap: 16px; margin-top: 22px; }
.mag-calc fieldset { border: 1px solid var(--mag-line); border-radius: 12px; padding: 8px 12px 10px; margin: 0; display: grid; gap: 2px; }
.mag-calc legend { font: 700 0.8rem/1 var(--gu-font-display, system-ui, sans-serif); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mag-accent); padding: 0 6px; }
.mag-opt {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 4px 10px; align-items: center;
  min-height: var(--mag-tap); padding: 4px 2px; cursor: pointer;
}
.mag-opt input { width: 22px; height: 22px; accent-color: var(--mag-accent); margin: 0; }
.mag-opt__price { color: var(--mag-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mag-opt--wide { border: 1px solid var(--mag-line); border-radius: 12px; padding: 4px 12px; }
.mag-cite {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--mag-tap); min-width: var(--mag-tap);
  color: var(--mag-accent) !important; font: 700 0.8rem/1 var(--gu-font-display, system-ui, sans-serif); text-decoration: none;
  white-space: nowrap;
}
.mag-cite:hover { text-decoration: underline; }
.mag-calc__nums { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.mag-calc__nums label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.mag-calc__nums input { width: 120px; min-height: var(--mag-tap); font-size: 16px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--mag-line); background: rgb(0 0 0 / 0.3); color: var(--mag-ink); }
.mag-calc__nums label[hidden] { display: none; }
.mag-calc__out { border-top: 2px solid var(--mag-accent); padding-top: 12px; display: grid; gap: 10px; }
.mag-calc__lines { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.mag-calc__lines th { text-align: left; font-weight: 600; padding: 4px 8px 4px 0; }
.mag-calc__lines td { padding: 4px 6px; color: var(--mag-dim); }
.mag-calc__lines td:last-child { text-align: right; color: var(--mag-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mag-calc__total { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font: 700 1.05rem/1.2 var(--gu-font-display, system-ui, sans-serif); text-transform: uppercase; letter-spacing: 0.05em; }
.mag-calc__total output { font-size: clamp(1.6rem, 4vw, 2.2rem); color: var(--mag-accent); font-variant-numeric: tabular-nums; }
.mag-calc__deps, .mag-calc__fine { margin: 0; color: var(--mag-dim); font-size: 0.9rem; }
.mag-calc__req { justify-self: start; }

@media (max-width: 520px) {
  .mag-opt { grid-template-columns: auto 1fr auto; }
  .mag-opt__price { grid-column: 2; }
  .mag-calc__lines td:nth-child(2) { display: none; }
  .mag-toolbar { gap: 6px; }
  .mag-count { min-width: 80px; }
}

/* ── Video dialog (feature 26) ────────────────────────────────────────── */
.mag-video { width: min(960px, calc(100vw - 24px)); border: 1px solid var(--mag-line); border-radius: 14px; background: var(--mag-panel); color: var(--mag-ink); padding: 8px 12px 12px; }
.mag-video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.mag-video::backdrop { background: rgb(0 0 0 / 0.7); }

@media (prefers-reduced-motion: reduce) {
  .mag *, .mag *::before, .mag *::after { transition-duration: 0ms !important; animation: none !important; }
}

/* ── Server markup as built (MAGAZINE.md "Server as built") ───────────── */
.mag-crumbs { max-width: var(--gu-max-width, 78rem); margin-inline: auto; padding: 10px var(--gu-gutter, 16px); }
.mag-body .mag-crumbs ol { flex-wrap: wrap; }
.mag-article__kicker { color: var(--mag-accent); font: 700 0.8rem/1.3 var(--gu-font-display, system-ui, sans-serif); letter-spacing: 0.16em; text-transform: uppercase; margin: 0 0 10px; }
.mag-article__title {
  font-family: var(--gu-font-display, system-ui, sans-serif); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; line-height: 1.05; font-size: var(--gu-text-3xl, 2.2rem); margin: 0 0 10px; overflow-wrap: break-word;
}
.mag-article__issue { color: var(--mag-dim); margin: 0 0 14px; }
.mag-article__summary { font-size: 1.06em; }
.mag-article__byline { color: var(--mag-accent); font-weight: 600; }
.mag-toc__title { font: 700 0.85rem/1.2 var(--gu-font-display, system-ui, sans-serif) !important; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mag-accent); margin: 4px 0 6px; }
.mag-toc__item { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--mag-line); padding: 0; }
.mag-toc ol { list-style: none; padding: 0; }
.mag-toc__item[data-depth="1"] { padding-left: 1.2em; }
.mag-toc__item a { flex: 1; text-decoration: none; min-height: var(--mag-tap); display: flex; align-items: center; }
.mag-toc__item a:hover { text-decoration: underline; }
.mag-toc__page { color: var(--mag-accent); font-weight: 700; font-variant-numeric: tabular-nums; align-self: center; }
.mag-list { padding-left: 1.2em; }
.mag-sec__actions { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mag-action {
  display: inline-flex; align-items: center; min-height: var(--mag-tap); padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--mag-accent); color: var(--mag-ink) !important; text-decoration: none;
  font: 600 0.88rem/1.2 var(--gu-font-display, system-ui, sans-serif); overflow-wrap: anywhere;
}
.mag-action:hover { background: color-mix(in srgb, var(--mag-accent) 22%, transparent); }
.mag-faq__src { font-size: 0.9rem; }
.mag-faq__item p { margin: 0 0 12px; }
/* The no-JS toolbar: plain links as pills. */
.mag-toolbar > .mag-btn { font-size: 0.8rem; padding: 0 16px; text-decoration: none; display: inline-flex; align-items: center; }
.mag-toolbar > .mag-btn[aria-disabled="true"] { opacity: 0.4; }
/* Calculator (server form, enhanced by calc.js) */
.mag-calc__group th { color: var(--mag-accent); font: 700 0.78rem/1.2 var(--gu-font-display, system-ui, sans-serif); letter-spacing: 0.12em; text-transform: uppercase; padding-top: 14px; }
.mag-calc__note { display: block; color: var(--mag-dim); font-size: 0.85rem; }
.mag-calc__form { display: grid; gap: 12px; margin-top: 22px; }
.mag-calc__field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0; }
.mag-calc__field label { font-weight: 600; min-width: 5.5em; }
.mag-calc__form select, .mag-calc__form input[type="number"] {
  min-height: var(--mag-tap); font-size: 16px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--mag-line); background: rgb(0 0 0 / 0.35); color: var(--mag-ink); max-width: 100%;
}
.mag-calc__form select { flex: 1 1 18rem; min-width: 0; }
.mag-calc__form input[type="number"] { width: 7.5rem; }
.mag-calc__form select option { background: #0b1330; color: #fff; }
.mag-calc__addons { display: grid; gap: 0; }
.mag-calc__addon, .mag-calc__weekend { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: 0; min-height: var(--mag-tap); }
.mag-calc__addon input, .mag-calc__weekend input { width: 22px; height: 22px; accent-color: var(--mag-accent); margin: 0; flex: none; }
.mag-calc__addon label, .mag-calc__weekend label { flex: 1 1 12rem; cursor: pointer; padding: 10px 0; }
.mag-calc__addon .mag-cite, .mag-calc__weekend .mag-cite, .mag-calc__basecite .mag-cite { min-height: var(--mag-tap); }
.mag-calc__result { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin: 6px 0 0; padding-top: 12px; border-top: 2px solid var(--mag-accent); font: 700 1rem/1.2 var(--gu-font-display, system-ui, sans-serif); text-transform: uppercase; letter-spacing: 0.05em; }
.mag-calc__total { font-size: clamp(1.7rem, 4vw, 2.4rem); color: var(--mag-accent); font-variant-numeric: tabular-nums; }
.mag-calc__live { display: grid; gap: 12px; }
.mag-calc__deposits { margin: 12px 0 0; }
.mag-calc__disclaimer { color: var(--mag-dim); font-size: 0.9rem; }

/* Everything the reader scrolls to clears the sticky site header. */
.mag-calc__form, .mag-reader, .mag-sec, .mag-pages > li { scroll-margin-top: calc(var(--gu-nav-header-h, 73px) + 12px); }

/* ── Archive: /magazine/ (feature list of every edition) ─────────────────── */
.mag--archive {
  max-width: var(--gu-max-width, 1200px); margin-inline: auto;
  padding: clamp(32px, 6vw, 72px) var(--gu-gutter, 16px) clamp(48px, 8vw, 96px);
}
.mag-archive__header { max-width: var(--gu-measure, 68ch); margin-bottom: clamp(28px, 5vw, 48px); }
.mag-archive__title {
  font-family: var(--gu-font-display, system-ui, sans-serif); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; line-height: 1.05; font-size: clamp(2rem, 5vw, 3.25rem); margin: 0 0 12px; overflow-wrap: break-word;
}
.mag-archive__lede { color: var(--gu-fg-muted, #b9bfcc); font-size: var(--gu-text-lg, 1.15rem); margin: 0; }
.mag-archive__h {
  font-family: var(--gu-font-display, system-ui, sans-serif); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: var(--gu-text-sm, 0.9rem); color: var(--gu-accent, #be9a66); margin: 0 0 20px;
}
.mag-archive__list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(20px, 3vw, 32px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.mag-card { container-type: inline-size; min-width: 0; max-width: none; }  /* site.css caps li at the prose measure */
.mag-card__link {
  display: grid; gap: 20px; height: 100%; color: inherit; text-decoration: none;
  padding: clamp(16px, 3vw, 28px); border-radius: 18px; border: 1px solid rgb(190 154 102 / 0.28);
  background: linear-gradient(160deg, color-mix(in srgb, var(--mag-bg, #0a1233) 85%, #fff 4%), rgb(0 0 0 / 0.25));
  transition: transform var(--gu-dur-fast, 160ms) var(--gu-ease, ease), border-color 160ms, box-shadow 160ms;
}
.mag-card__link:hover, .mag-card__link:focus-visible { transform: translateY(-3px); border-color: var(--mag-accent, #be9a66); box-shadow: 0 18px 40px rgb(0 0 0 / 0.35); }
.mag-card__link:focus-visible { outline: 3px solid var(--mag-accent, #be9a66); outline-offset: 3px; }
.mag-card__cover { display: block; max-width: 320px; width: 100%; justify-self: center; }
.mag-card__cover img {
  display: block; width: 100%; height: auto; border-radius: 4px;
  box-shadow: 0 2px 0 rgb(255 255 255 / 0.6), 0 20px 44px rgb(0 0 0 / 0.5);
}
.mag-card__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mag-card__issue { font-family: var(--gu-font-display, system-ui, sans-serif); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; color: var(--mag-accent, #be9a66); font-weight: 700; }
.mag-card__title { font-family: var(--gu-font-display, system-ui, sans-serif); font-weight: 800; text-transform: uppercase; font-size: clamp(1.5rem, 4cqi, 2.4rem); line-height: 1.05; margin: 0; overflow-wrap: break-word; }
.mag-card__subtitle { font-size: 1.05rem; font-weight: 600; }
.mag-card__summary { color: var(--gu-fg-muted, #b9bfcc); line-height: 1.6; }
.mag-card__meta { font-size: 0.85rem; color: var(--gu-fg-muted, #b9bfcc); }
.mag-card__cta {
  align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 10px 22px; border-radius: 999px; background: var(--mag-accent, #be9a66); color: #0a1233;
  font-family: var(--gu-font-display, system-ui, sans-serif); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.9rem;
}
.mag-card__draft { color: #ffb4a8; font-weight: 700; text-transform: uppercase; font-size: 0.75rem; }
/* The newest edition is the feature: full row, cover beside the story. */
.mag-card:first-child { grid-column: 1 / -1; }
@container (min-width: 640px) {
  .mag-card:first-child .mag-card__link { grid-template-columns: minmax(200px, 320px) 1fr; align-items: center; gap: clamp(24px, 5cqi, 56px); }
  .mag-card:first-child .mag-card__summary { font-size: 1.05rem; max-width: 58ch; }
}

/* The magazine's breadcrumb links are real tap targets on a phone (44px). */
.mag-crumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
