/* Stories page (/stories/). One idea, taken from the header: a thin aqua fiber line runs down the page and each
   story is a red signal dot on it. The story's place, date and number sit to the left of the line; the story itself
   to the right. Flat color and line only (rule 9: no gradients, glass, emoji bullets, fake terminals or animated
   numbers). */

:root { --signal: #c8392b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --signal: #ff5a48; } }
:root[data-theme="dark"] { --signal: #ff5a48; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stories-page { --side: 12.5rem; --gap: 3rem; }
.stories-page main, .stories-page footer { max-width: 62rem; margin: 0 auto; padding: 0 16px; }
.stories-page main > section, .stories-page main > header { border-top: 0; }

.st-head { padding: 2.6rem 0 2.2rem; }
.st-head h2 { margin: 0 0 .4rem; }
.st-head p { margin: 0; color: var(--muted); font-size: 1.05rem; }

/* The fiber line, centered in the gap between the two columns */
.st-list { list-style: none; margin: 0; padding: 0; position: relative; }
.st-list::before { content: ""; position: absolute; top: .7rem; bottom: 2.5rem; left: calc(var(--side) + var(--gap) / 2 - 1px); width: 2px; background: var(--accent); opacity: .5; }
.story { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); column-gap: var(--gap); margin: 0; padding: 0 0 3.4rem; position: relative; }
.story::before { content: ""; position: absolute; top: .55rem; left: calc(var(--side) + var(--gap) / 2 - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px var(--paper); }

/* Left of the line: where, when, and the story's number */
.st-side { text-align: right; padding-top: .15rem; }
.st-where { display: flex; justify-content: flex-end; align-items: center; gap: .45rem; margin: 0; font: 600 .86rem/1.3 var(--sans); }
.st-where .logo { width: 1.35rem; height: 1.35rem; border-radius: 3px; flex: none; }
.st-when { margin: .2rem 0 0; font: .84rem/1.3 var(--sans); color: var(--muted); }
.st-fig { margin: 1.1rem 0 0; }
.st-fig strong { display: block; font: 700 2rem/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--ink); }
.st-fig span { display: block; margin-top: .35rem; font: .82rem/1.4 var(--sans); color: var(--muted); }

/* Right of the line: the story, in Noah's words */
.st-main h3 { margin: 0 0 .7rem; font: 700 1.4rem/1.25 var(--serif); }
.story-lead .st-main h3 { font-size: clamp(1.6rem, 3vw, 2.05rem); }
.st-text p { margin: 0 0 .85rem; max-width: 40rem; line-height: 1.7; }
.st-text p:last-child { margin-bottom: 0; }
.st-quote { margin: 1.3rem 0 0; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid var(--signal); max-width: 38rem; }
.st-quote blockquote { margin: 0; font: italic 1.2rem/1.5 var(--serif); }
.st-quote figcaption { margin-top: .4rem; font: .84rem/1.4 var(--sans); color: var(--muted); }

/* After the stories: the career route map, and the way back to the one-page resume */
.st-route { padding: 1rem 0 2rem; }
.st-map { border: 1px solid var(--rule); padding: 1.2rem 1.4rem .6rem; margin: 0 0 1rem; }
.route-map.big .rm-run { stroke-width: 14; }

/* Phones: one column, the line along the left edge */
@media (max-width: 44rem) {
  .story { grid-template-columns: 1fr; padding: 0 0 2.6rem 1.9rem; }
  .st-list::before { left: 5px; }
  .story::before { left: 0; }
  .st-side { text-align: left; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; margin-bottom: .6rem; }
  .st-where { justify-content: flex-start; }
  .st-when { margin: 0; }
  .st-fig { flex-basis: 100%; margin: .5rem 0 0; display: flex; align-items: baseline; gap: .6rem; }
  .st-fig strong { font-size: 1.5rem; flex: none; }
  .st-fig span { margin: 0; }
}

/* Story photo galleries */
.st-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .85rem; margin: 1.25rem 0 0; max-width: 42rem; }
.st-gallery.is-single { max-width: 24rem; }
.st-gallery.is-lead { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-gallery.is-lead .st-shot:first-child { grid-column: 1 / -1; }
.st-shot { margin: 0; border: 1px solid var(--rule); background: var(--paper); display: flex; flex-direction: column; }
.st-shot img { width: 100%; height: 14rem; object-fit: cover; display: block; background: var(--wash); }
.st-gallery.is-lead .st-shot:first-child img { height: 22rem; }
.st-gallery.is-pair .st-shot img { height: 20rem; }
.st-shot.is-contain img { object-fit: contain !important; background: #0b0f12; padding: .35rem; }
.st-gallery.is-single .st-shot img { height: auto; max-height: 24rem; object-fit: contain; }
@media (max-width: 34rem) { .st-gallery.is-lead { grid-template-columns: 1fr; } .st-gallery.is-lead .st-shot:first-child img { height: 15rem; } }
.st-shot figcaption { margin: 0; padding: .45rem .65rem; font: .8rem/1.35 var(--sans); color: var(--muted); border-top: 1px solid var(--rule); }

@media print {
  .st-list::before, .story::before { display: none; }
  .story { break-inside: avoid; }
}
