/* Topics, watch and method. Tokens and primitives (frame, panel, chip, ledger, vid, disclose, kv) live in base.css.
   Every rule here sits under a page wrapper or a topics-/topic-/watch-/method- class. No shadows, no numbered markers. */

.topics-page, .topic-page, .watch-page, .method-page { padding-bottom: clamp(56px, 7vw, 120px); }

/* ---------- #/topics: a stage card per topic ---------- */
.topics-group { padding-top: clamp(28px, 3.6vw, 64px); }
.topics-group > header { display: grid; gap: 8px; margin-bottom: clamp(18px, 2vw, 30px); max-width: 80ch; }
.topics-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(14px, 1.8vw, 26px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.topics-grid.mixed { align-items: start; }                     /* a row of framed and text-only cards keeps each card its own height */
.topics-card { position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; transition: border-color var(--dur) var(--ease); }
.topics-card:hover { border-color: var(--fg-3); }
.topics-card:has(h3 a:focus-visible) { outline: 2px solid var(--amber); outline-offset: 3px; }
.topics-img .frame { border-radius: 0; }
.topics-txt { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: clamp(16px, 1.6vw, 24px); }
.topics-txt h3 { font-size: var(--pp-subhead); }
.topics-txt h3 a { text-decoration: none; }
.topics-txt h3 a::after { content: ""; position: absolute; inset: 0; }
.topics-txt h3 a:focus-visible { outline: none; }
.topics-card:hover h3 a { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.topics-txt .dek { font-size: var(--pp-body); line-height: 1.5; }
.topics-txt .tags { margin-top: auto; padding-top: 6px; }
@media (prefers-reduced-motion: no-preference) {
  .topics-img .frame-img > img { transition: transform 900ms var(--ease); }
  .topics-card:hover .frame:not(.recon) .frame-img > img { transform: scale(1.03); }
}

/* ---------- #/topic/<id>: the story on the stage, the record on paper ---------- */
.topic-head .tags { margin-top: 4px; }

/* frames from the topic's cases: a short strip, each linking to its case */
.topic-strip { list-style: none; margin: clamp(4px, 1vw, 12px) 0 0; padding: 0; display: grid; gap: clamp(12px, 1.4vw, 20px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.topic-fr { position: relative; min-width: 0; }
.topic-fr-a { position: absolute; inset: 0; z-index: 1; }
.topic-fr-a:focus-visible { outline: none; }
.topic-fr:has(.topic-fr-a:focus-visible) { outline: 2px solid var(--amber); outline-offset: 3px; }
@media (max-width: 720px) {
  .topic-strip { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; scrollbar-width: thin; }
  .topic-fr { scroll-snap-align: start; }
  .topic-fr:has(.topic-fr-a:focus-visible) { outline-offset: -2px; }
}

/* a chapter: its heading in the margin, its body beside it */
.topic-story { margin-top: clamp(28px, 3.4vw, 56px); }
.topic-page .topic-sec { display: grid; gap: 14px clamp(24px, 4vw, 72px); padding-block: clamp(22px, 2.6vw, 40px); border-top: 1px solid var(--line); }
.topic-sec > h2 { font-size: var(--pp-section); }
.topic-sec-b { min-width: 0; max-width: 42rem; }
.topic-sec-b .prose { max-width: none; }
.topic-lead { font: 650 var(--pp-body)/1 var(--ui); font-stretch: 90%; letter-spacing: 0; }
.topic-sec-b .ledger { margin-top: 18px; }
.topic-sec-b .ledger li a { grid-template-columns: 84px 1fr; }
.topic-sec-b .ledger .lm { grid-column: 2; justify-content: flex-start; }
@media (min-width: 1000px) {
  .topic-page .topic-sec { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); }
  .topic-sec > h2 { position: sticky; top: 84px; align-self: start; }
}

/* paper panels: claims, documents, files, archives */
.topic-panel { margin-top: clamp(24px, 3vw, 44px); }
.topic-panel > h2 { font-size: var(--pp-section); }
.topic-panel > .prov { margin: 8px 0 18px; max-width: 72ch; }
.topic-ct { border-top: 2px solid var(--ink); }
.topic-cr { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .8fr) minmax(0, 1.35fr); border-bottom: 1px solid var(--line); }
.topic-cr > * { min-width: 0; padding: 16px 22px 16px 0; }
.topic-cr > * + * { padding-left: 22px; border-left: 1px solid var(--line); }
.topic-ch > * { padding-block: 9px; font: 600 var(--t-small)/1.3 var(--ui); font-stretch: 90%; color: var(--fg-2); }
.topic-cr p { margin: 0 0 .55em; font-family: var(--serif); font-size: var(--pp-body); line-height: 1.5; }
.topic-cr p:last-child { margin-bottom: 0; }
.topic-cr .prov { font-family: var(--ui); font-size: var(--t-small); line-height: 1.4; }
.topic-c1 p { font-size: var(--pp-body); line-height: 1.45; font-weight: 450; }
.topic-cr .chip { margin-bottom: 8px; }
@media (max-width: 860px) {
  .topic-ch { display: none; }
  .topic-cr { grid-template-columns: minmax(0, 1fr); padding-block: 10px; }
  .topic-cr > *, .topic-cr > * + * { padding: 8px 0; border-left: 0; }
  .topic-cr > [data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font: 600 var(--pp-meta)/1.2 var(--ui); font-stretch: 90%; color: var(--fg-2); }
}
.topic-off { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.topic-off li { display: grid; gap: 8px; align-content: start; min-width: 0; padding: 14px 16px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 2px; }
.topic-off li p { margin: 0; }
.topic-off-t { font: 600 var(--pp-body)/1.35 var(--ui); font-stretch: 94%; overflow-wrap: anywhere; }
.topic-says { font-family: var(--serif); font-size: var(--pp-body); line-height: 1.5; color: var(--fg-2); }
.topic-recs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.topic-more { margin-top: 14px; background: var(--paper-2); }
.topic-more > .topic-recs { margin-top: 4px; }

/* the stage again: coverage, remaining cases, sources */
.topic-block { display: grid; gap: 14px; margin-top: clamp(40px, 5vw, 88px); }
.topic-block > h2 { font-size: var(--pp-section); }
.topic-block > .prov { margin: 0; max-width: 72ch; }
.topic-more-cases { max-width: 56rem; }
.topic-srcs { display: grid; gap: 28px clamp(20px, 3vw, 48px); grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); margin-top: 6px; }
.topic-srcs h3 { margin-bottom: 10px; font-size: var(--pp-body); }
.topic-page .srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: var(--pp-body); line-height: 1.4; overflow-wrap: anywhere; }
.topic-page .srcs small { color: var(--fg-2); }

/* ---------- #/watch ---------- */
.watch-filters { display: grid; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.watch-q input { width: min(100%, 520px); height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg-2); color: var(--fg); font: 500 var(--pp-body) var(--ui); }
.watch-q input::placeholder { color: var(--fg-3); }
.watch-q input:focus { border-color: var(--fg-2); }
.watch-opts { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.watch-filters fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.watch-filters .chips label { position: relative; }                /* the hidden input stays inside its label, so focus never scrolls the page */
.watch-filters .chips label:has(:focus-visible) { outline: 2px solid var(--amber); outline-offset: 3px; }
.watch-n { margin: 0; font: 600 var(--t-ui)/1.3 var(--ui); font-stretch: 94%; }
.watch-kind { padding-top: clamp(28px, 3.4vw, 56px); }
.watch-kind > h2 { margin-bottom: 16px; }
.watch-group { display: grid; gap: 14px clamp(20px, 3vw, 48px); padding-block: 22px 26px; border-top: 1px solid var(--line); }
.watch-gh { display: grid; gap: 4px; align-content: start; min-width: 0; }
.watch-gh h3 { font-size: var(--pp-subhead); }
.watch-gh h3 a { text-decoration: none; }
.watch-gh h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.watch-gh h3:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.watch-gh .prov { margin: 0; }
.watch-empty { padding-block: 40px; color: var(--fg-2); }
.watch-empty .btn { margin-left: 8px; }
.watch-more { margin: 0; padding-block: 28px 8px; border-top: 1px solid var(--line); }
@media (max-width: 600px) {
  .watch-page .vid { grid-template-columns: 124px minmax(0, 1fr); column-gap: 12px; align-items: start; }
  .watch-page .vid > * { grid-column: 2; }
  .watch-page .vid > .vid-face { grid-column: 1; grid-row: 1 / span 3; }
  .watch-page .vid-ch { left: 8px; top: 6px; max-width: 92%; font-size: var(--pp-meta); }
  .watch-page .vid-len { right: 6px; bottom: 6px; padding: 3px 5px; font-size: var(--pp-meta); }
  .watch-page .vid-play { top: 66%; width: 28px; height: 28px; margin: -14px 0 0 -14px; }       /* below the channel name, clear of the length */
  .watch-page .vid-play::after { left: 10px; top: 7px; border-left-width: 9px; border-top-width: 7px; border-bottom-width: 7px; }
  .watch-page .vid:has(.vid-frame) { grid-template-columns: minmax(0, 1fr); }          /* a playing video gets the full width */
  .watch-page .vid:has(.vid-frame) > * { grid-column: 1; grid-row: auto; }
}
@media (min-width: 1000px) {
  .watch-group { grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); }
  .watch-gh { position: sticky; top: 84px; align-self: start; }
}

/* ---------- #/method: a reading page in the serif ---------- */
.method-body { max-width: 66ch; font-family: var(--serif); font-size: var(--pp-body); line-height: 1.6; }
.method-toc { max-width: 100ch; margin-bottom: clamp(4px, 1vw, 12px); }
.method-body section { padding-top: clamp(30px, 3.6vw, 60px); }
.method-body h2 { margin-bottom: .5em; font-size: var(--pp-section); scroll-margin-top: 84px; }
.method-body h3 { margin: 1.7em 0 .4em; }
.method-body p, .method-body ul { margin: 0 0 1em; }
.method-body ul { padding-left: 1.2em; }
.method-body li { margin-bottom: .6em; }
.method-body a { text-decoration-color: color-mix(in srgb, var(--fg) 45%, transparent); }
.method-body .prov, .method-body .kv { font-family: var(--ui); }
.method-dl { display: grid; gap: 24px; margin: 1.1em 0 1.3em; }
.method-dl > div { display: grid; gap: 6px; }
.method-dl dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.method-dl dt .chip { font-size: var(--pp-meta); }
.method-dl dd { margin: 0; }
.method-list { list-style: none; padding: 0; }
.method-list li { margin-bottom: .45em; font-size: var(--pp-body); line-height: 1.45; }
.method-body details.disclose { margin-top: 1em; }
.method-ex { display: grid; gap: 14px; margin: 1.4em 0 1.6em; }
.method-ex .sheet h3 { margin-top: 0; }
