/* Threads. The index lists every throughline; a thread page moves between the two surfaces, the stage for the story
   and paper for the record, joined by a hairline down the left rail. It ends on paper: where the record stands. */

/* ---------- the chain: four small cards in material order; the document card sits on paper ---------- */
.th-chain { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 780px; }
.th-chain li { display: grid; align-content: start; gap: 3px; min-width: 0; padding: 8px 10px 9px; border: 1px solid var(--line); border-radius: 2px; }
.th-chain span { font: 500 var(--pp-meta)/1.2 var(--ui); font-stretch: 88%; color: var(--fg-3); }
.th-chain b { font: 600 var(--pp-meta)/1.25 var(--ui); font-stretch: 90%; color: var(--fg); overflow-wrap: anywhere; }
.th-chain .th-c-document { background: var(--paper); border-color: var(--paper); }
.th-chain .th-c-document span { color: var(--ink-2); }
.th-chain .th-c-document b { color: var(--ink); }
@media (max-width: 720px) { .th-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- #/threads ---------- */
.th-list { list-style: none; margin: 0 auto; padding-top: 0; padding-bottom: clamp(48px, 6vw, 112px); }
.th-list > li { border-top: 1px solid var(--line); }
.th-list > li:last-child { border-bottom: 1px solid var(--line); }
.th-list a { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: clamp(16px, 2.6vw, 44px); align-items: start; padding: clamp(22px, 2.8vw, 40px) 0; text-decoration: none; }
.th-doc .duo { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--paper-2); border-radius: 2px; }
.th-doc .duo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.th-doc .duo.none { display: grid; place-items: center; padding: 8px; font: 500 var(--pp-meta)/1.3 var(--ui); font-stretch: 88%; color: var(--ink-3); text-align: center; overflow-wrap: anywhere; }
.th-doc .th-slip { align-content: start; gap: 6px; padding: 12px 8px; }   /* a cover slip: the document's name and where it lives */
.th-doc .th-slip b { font: 600 var(--pp-meta)/1.25 var(--ui); font-stretch: 88%; color: var(--ink); }
.th-doc .th-slip span { font-size: var(--pp-meta); }
.th-t { display: grid; gap: 10px; min-width: 0; }
.th-t > b { font: 500 var(--pp-section)/1.06 var(--serif); letter-spacing: -.012em; text-wrap: balance; }
.th-list a:hover .th-t > b { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.th-meta { font: 600 var(--t-small)/1.2 var(--ui); font-stretch: 88%; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.th-dek { font: 400 var(--pp-body)/1.5 var(--serif); color: var(--fg-2); max-width: 66ch; }
.th-t .th-chain { margin-top: 6px; }
@media (max-width: 720px) {
  .th-list a { grid-template-columns: 64px minmax(0, 1fr); }
  .th-dek { font-size: var(--pp-body); }
}

/* ---------- #/thread/<id>: the stage header ---------- */
.th-stage { display: grid; gap: 18px; padding-block: clamp(36px, 5.6vw, 100px) clamp(20px, 2.6vw, 44px); }
.th-stage h1 { max-width: 16ch; }
.th-stage .dek { max-width: 64ch; }
.th-stage .th-chain { margin-top: 8px; }
.th-back { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font: 500 var(--t-ui)/1.3 var(--ui); font-stretch: 90%; color: var(--fg-2); }

/* ---------- the steps, joined by the thread ---------- */
.th-steps { list-style: none; margin: 0; padding: 0 0 clamp(12px, 2vw, 32px); }
.th-step { position: relative; display: grid; grid-template-columns: clamp(128px, 13vw, 196px) minmax(0, 1fr); column-gap: clamp(16px, 3vw, 56px);
  max-width: var(--maxw); margin: 0 auto; padding: clamp(32px, 4.4vw, 76px) var(--gutter); transition: opacity 700ms var(--ease); }
.th-step::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) + 3px); border-left: 1px solid var(--line); }
.th-step:first-child::before { top: clamp(32px, 4.4vw, 76px); }
.th-step.is-past { opacity: .6; }
.th-rail { position: relative; display: grid; align-content: start; gap: 4px; margin: 0; padding-left: 22px; }
.th-rail::before { content: ""; position: absolute; left: 0; top: .42em; width: 7px; height: 7px; background: var(--bone-2); }
.th-document .th-rail::before { background: var(--paper); }
.th-kind { font: 650 var(--t-ui)/1.2 var(--ui); font-stretch: 86%; }
.th-date { font: 500 var(--t-small)/1.3 var(--ui); font-stretch: 88%; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.th-body { display: grid; gap: 20px; align-content: start; min-width: 0; max-width: 1000px; }
.th-body > .prose { max-width: 66ch; }
.th-body .prose p:last-child { margin-bottom: 0; }
.th-story .prose { font-size: var(--pp-subhead); line-height: 1.55; }

/* document: the record on paper, the scan as released beside its provenance */
.th-paper { display: grid; grid-template-columns: minmax(110px, 220px) minmax(0, 1fr); gap: clamp(16px, 2.2vw, 30px); align-items: start; max-width: 820px; margin: 0; }
.th-scan { display: block; text-decoration: none; }
.th-paper .duo { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--paper-2); border: 1px solid var(--rule-2); }
.th-paper .duo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.th-paper .duo:not(.paper) { aspect-ratio: 4 / 3; background: #000; }
.th-paper.is-text { grid-template-columns: minmax(0, 1fr); max-width: 720px; }
.th-host { font: 600 var(--pp-meta)/1.2 var(--ui); font-stretch: 88%; color: var(--ink-3); }
.th-paper figcaption { display: grid; gap: 8px; align-content: start; min-width: 0; }
.th-paper figcaption b { font: 600 var(--pp-subhead)/1.28 var(--ui); font-stretch: 92%; color: var(--ink); }
.th-paper figcaption > span:not(.tags) { font-size: var(--t-small); color: var(--ink-2); line-height: 1.4; }
.th-open { justify-self: start; margin-top: 4px; font: 600 var(--t-ui)/1.2 var(--ui); font-stretch: 92%; color: var(--ink); }
.th-document .frame { max-width: 1000px; }

/* voice and series: the video beside its annotation */
.th-pair { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: clamp(18px, 2.6vw, 44px); align-items: start; }
.th-pair .vid h4 { font-size: var(--pp-body); }
@media (max-width: 960px) { .th-pair { grid-template-columns: minmax(0, 1fr); } .th-pair .vid { max-width: 520px; } }

/* quote: the words set large */
.th-quote blockquote, .th-voice blockquote { max-width: 32ch; font-size: var(--pp-section); line-height: 1.24; }

/* frame: the reconstruction runs full width, the rail above it */
.th-frame { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
.th-frame .th-rail { grid-auto-flow: column; justify-content: start; gap: 16px; align-items: baseline; }
.th-frame .frame { position: relative; z-index: 1; margin-inline: calc(var(--gutter) * -1); border-radius: 0; }   /* paint over the rail's hairline */
.th-frame .frame .slate, .th-frame .frame .chyron { padding-inline: var(--gutter); }
.th-frame .th-body { max-width: none; }
.th-frame .th-body > :not(.frame) { max-width: 66ch; margin-left: calc(clamp(128px, 13vw, 196px) + clamp(16px, 3vw, 56px)); }

/* links into the archive and the source line */
.th-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 70ch; }
.th-links li { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 12px; font: 500 var(--t-small)/1.35 var(--ui); font-stretch: 92%; }
.th-links span { color: var(--fg-3); }
.th-cite { margin: 0; max-width: 80ch; }
.th-cite a { color: var(--fg-2); }

/* ---------- the end: where the record stands, on paper ---------- */
.th-end { padding-block: clamp(24px, 4vw, 72px); }
.th-standing { display: grid; gap: 16px; max-width: 860px; padding: clamp(22px, 3.2vw, 52px); }
.th-standing .prose { font-size: var(--pp-body); color: var(--ink); }
.th-deeper { margin: 0; font: 500 var(--t-small)/1.5 var(--ui); font-stretch: 92%; color: var(--ink-2); }
.th-next { padding-bottom: clamp(48px, 6vw, 112px); }
.th-next a { display: grid; gap: 6px; max-width: 860px; padding: 24px 0 0; border-top: 1px solid var(--line); text-decoration: none; }
.th-next span { font: 500 var(--t-small)/1.2 var(--ui); font-stretch: 90%; color: var(--fg-2); }
.th-next b { font: 500 var(--pp-section)/1.1 var(--serif); }
.th-next a:hover b { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--accent); text-underline-offset: 5px; }

/* ---------- phones: plain stacked sections ---------- */
@media (max-width: 720px) {
  .th-step { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .th-step::before { display: none; }
  .th-rail { grid-auto-flow: column; justify-content: start; gap: 12px; align-items: baseline; padding-left: 15px; }
  .th-rail::before { top: .38em; }
  .th-frame .th-body > :not(.frame) { margin-left: 0; }
  .th-paper { grid-template-columns: 96px minmax(0, 1fr); }
  .th-links li { grid-template-columns: 74px minmax(0, 1fr); }
}
