/* ==========================================================================================================
   Jump Me Back · readable layer (UI/UX pass 2, Nov 27 2026). Kept as the LAST stylesheet by js/typefloor.js.
   Fixes found by measuring every chapter of 12 dates (1944–2023) at 360/390/430/768/1024/1440/1920:
   text cut off or truncated, labels too small, headers crowding the screen edge, the cramped desktop Cars layout.
   One scale on top of polish.css tokens: text floor 14px on phones / 13px wider (js/typefloor.js), labels 13–14px,
   body 15–17px; spacing stays on --sp-*. Square corners, no new motion.
   ========================================================================================================== */

/* ---------- shared type steps ---------- */
#era { --t-kicker: 13px; --t-kicker-ls: .16em; --t-btn: 14px; --t-btn-ls: .1em; }
@media (max-width: 599px) { #era { --t-kicker: 14px; --t-kicker-ls: .1em; --t-how: 15px; --t-sub: 16px; } }
#era.era-80s { --t-kicker: 17px; --t-kicker-ls: .06em; --t-btn: 18px; --t-btn-ls: .04em; }

/* nav: the Next label never truncates — on narrow phones the arrow goes and the letter-spacing tightens */
@media (max-width: 420px) {
  #era .dk-next { padding: 0 var(--sp-3); letter-spacing: .06em; justify-content: center; }
  #era .dk-next > span[aria-hidden="true"] { display: none; }
  #era .dk-next .dk-nl { overflow: visible; text-overflow: clip; }
}

/* arrival: the song line under the date wraps instead of trailing off in an ellipsis */
#era .ch-arrive .sp-meta { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.4; }

/* ==========================================================================================================
   CARS — desktop was a three-column squeeze (rail | car | chart) forced to fit with no scrolling, so the photo became a
   tall sliver and the spec text dropped to 10–11px. Now: the cars run across the top, the photo keeps a true 3:2 frame
   beside a roomy spec sheet, and "Then vs. today" sits underneath. The stage scrolls if a short screen needs it.
   ========================================================================================================== */
#era .cv { --gap: clamp(12px, 1.6vw, 24px); padding: clamp(12px, 1.6vw, 24px); }
#era .cv-pick { padding: 10px 12px; min-height: 56px; }
#era .cv-pt b { font-size: 16px; line-height: 1.2; }
#era .cv-pt small { font-size: 14px; }
#era .cv-rk, #era .cv-dl dt, #era .cv-ck, #era .cv .cv-stk { font-size: 13px; letter-spacing: .08em; line-height: 1.35; }
#era .cv-dl dd { font-size: 17px; line-height: 1.3; }
#era .cv small { font-size: 14px; line-height: 1.35; margin-top: 4px; }
#era .cv-src, #era .cv-ph figcaption, #era .cv-basis { font-size: 13px; line-height: 1.45; }
#era .cv-say, #era .cv-note, #era .cv-banner { font-size: 15px; line-height: 1.45; }
#era .cv-bl { font-size: 14px; line-height: 1.3; } #era .cv-bv { font-size: 16px; }
#era .cv-bt { height: 12px; }
#era .cv-dl { gap: 12px 20px; } #era .cv-dl > div { padding-top: 8px; }
#era .cv-ph-f { aspect-ratio: 3 / 2; }
#era .cv-ph-s .cv-ph-f { aspect-ratio: 16 / 10; }
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  #era .ch-cars .ch-stage { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  #era .ch-cars .cv-mount { height: auto; }
  #era .cv { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  #era .cv-rail { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); overflow: visible; }
  #era .cv-feat { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); height: auto; align-items: start; }
  #era .cv-ph { height: auto; grid-template-rows: auto auto; }
  #era .cv-ph-f { height: auto; }
  #era .cv-cmp { overflow: visible; }
  #era .cv-chart { display: block; columns: 2; column-gap: calc(var(--gap) * 2); }
  #era .cv-chart > * { break-inside: avoid; margin-bottom: 8px; }
  #era .cv-chart > .cv-ck ~ .cv-ck { break-before: column; margin-top: 6px; }
  #era .cv-chart > .cv-src { column-span: all; }
  #era .cv-nm { font-size: clamp(26px, 2.6vw, 40px); }
  #era .cv-brochure .cv-nm { font-size: clamp(18px, 1.7vw, 26px); }
  /* the short-desktop squeeze in cars.css no longer applies: the stage scrolls instead */
  #era .cv-mag .cv-dl, #era .cv-web .cv-dl { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 999px), (max-aspect-ratio: 5/4) {
  #era .ch-cars .cv-ph-f { aspect-ratio: 3 / 2; }
}
@media (max-width: 420px) { #era .cv-dl dd { font-size: 16px; } #era .cv-pick { padding: 8px 10px; } #era .cv-pt b { font-size: 15px; } }

/* phones: the cars list is one clean column — two-up squeezed long names onto three lines */
@media (max-width: 480px) {
  #era .cv-rail { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  #era .cv-pick { grid-template-columns: 2em minmax(0, 1fr); min-height: 52px; }
  #era .cv-pt { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 12px; }
  #era .cv-pt small { margin-top: 0; }
}

/* ==========================================================================================================
   PRICES — the receipt ran off the right edge on phones (the TODAY and WORK columns were cut). Under 600px every line
   becomes two: the item, then its three figures in even columns.
   ========================================================================================================== */
@media (max-width: 599px) {
  #era .rc { padding: 12px 14px 18px; }
  #era .rc-t, #era .rc-t thead, #era .rc-t tbody { display: block; width: 100%; }
  #era .rc-t tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 10px; align-items: baseline; padding: 4px 0; border-bottom: 1px dotted color-mix(in srgb, currentColor 25%, transparent); }
  #era .rc-t thead tr { padding-bottom: 6px; }
  #era .rc-t td, #era .rc-t th { padding: 0; white-space: nowrap; text-align: right; }
  #era .rc-t td + td, #era .rc-t th + th { padding-left: 0; }
  #era .rc-t td:first-child, #era .rc-t th:first-child { grid-column: 1 / -1; text-align: left; white-space: normal; padding-bottom: 2px; }
  #era .rc-t td:empty { display: none; }
}

/* ==========================================================================================================
   THE WORLD — names in the almanac no longer end in "…"; on short desktop screens (≤820px tall) the almanac takes the
   height it needs and the chapter scrolls, instead of shrinking captions to one clipped line.
   ========================================================================================================== */
#era .al-t, #era .al-tli b, #era .al-card .al-t { display: block; white-space: normal; overflow: visible; text-overflow: clip; -webkit-line-clamp: unset; line-clamp: none; }
#era .al-bar .cx-cr { white-space: normal; overflow: visible; text-overflow: clip; }
#era .al-pop .al-count { overflow: visible; }
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  #era .al-bar { flex-wrap: wrap; }
  #era .al-tl { padding-right: 64px; }
}
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) and (max-height: 820px) {
  #era .ch-world .ch-stage { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
  #era .ch-world .cx-mount, #era .ch-world .cx-mount > .cx { height: auto; }
  #era .al-grid { grid-template-rows: repeat(6, auto); }
  #era .al-cards, #era .al-tl ol { grid-template-rows: auto; }
  #era .al-card figure, #era .al-tli figure { height: auto; aspect-ratio: 4 / 3; }
  #era .al-tli span, #era .al-card .al-d { display: block; }
  #era .al-yr { white-space: normal; overflow: visible; }
  #era .al-yr i { display: none; }
  #era .al-c { overflow: visible; }
}

/* the dial's frequency scale: the "MHz"/"KC" unit sat on top of the last number once the numbers were readable — the
   numbers alone read as a dial, so the unit goes at every width */
#era .tn-sc { height: auto; line-height: 1.2; }
#era .tn-sc em { display: none; }

/* TV guide: long show names wrap instead of trailing off */
#era .tv-t b { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }

/* headings: long song and film titles never stack their lines on top of each other */
#era:not(.era-80s):not(.era-90s) .ch-h.h-long, #era:not(.era-80s):not(.era-90s) .ch-play .ch-h { line-height: 1.18; }

/* cars: a picked car scrolls into view below the sticky header, not under it */
#era .cv-feat { scroll-margin-top: 12px; }
#era .cv-pt small:empty { display: none; }

/* SONG — on shorter desktops (1024×768, 1280×720) the "No. 1 hits up to your day" list was cut off below the screen with no
   way to reach it, and two-up in a narrow column it broke titles onto four lines. The chapter now scrolls when it needs to
   (the wheel scrolls it first, then steps on: stage.js), and under 1280px the list is one column. */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  #era.has-stage .dk-chs > .ch.has-more:not(.ch-info) { overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 1000px) and (max-width: 1279px) and (min-aspect-ratio: 5/4) {
  #era .ch.has-more:not(.ch-info) .fs-rank { grid-template-columns: minmax(0, 1fr); }
  #era .ch.has-more:not(.ch-info) .fs-rank li:nth-child(2) { border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
}
/* the chapter kicker sat 4px under the header row on desktop; give it air */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) { #era .ch-song .ch-copy { padding-top: 10px; } }
/* arrival: the weekday above the date was 12px on phones */
@media (max-width: 599px) { #era .ar-date .ar-dow { font-size: 14px; } }

/* ONE TYPE SYSTEM PER ERA — the stats, almanac, scoreboard and film panels set every era's labels and notes in Archivo,
   so a 1950s or 1980s chapter switched typefaces halfway down. Their text face now follows the era's own text face
   (--et). The newspaper masthead and headlines keep their printed serif: that is the paper itself. The 2000s already use
   Archivo as their display face, so they are left alone. VT323 is drawn small for its size, so 1980s panel text is
   scaled up to a normal x-height. */
#era:not(.era-00s) .cx { --rt: var(--et); }
#era.era-80s .cx { font-size-adjust: .5; }
#era.era-80s .cx .st-v, #era.era-80s .cx .al-count { font-size-adjust: none; }

/* NEWS — portrait photos (Churchill, Judy Garland) sat in a wide 16:9 strip that showed under half the picture. A tall
   photo now gets a square frame on phones and in the small side photos on desktop; faces stay in frame (50% 18%). */
@media (max-width: 999px), (max-aspect-ratio: 5/4) { #era .nw-fig.nw-tall img { aspect-ratio: 1 / 1; max-height: 62vh; } }
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) { #era .nw-st:not(.nw-lead).has-img .nw-fig.nw-tall img, #era .nw-lead.fit-3 .nw-fig.nw-tall img { aspect-ratio: 1 / 1; } }

/* INTERNET — on phones the "saved page" card inside the old monitor was taller than the little screen, so the site name
   was cut off the top and the button off the bottom. The card is a link already (and "Visit the archived page" sits
   under the monitor), so on phones the inner button goes and the card starts at the top when it can't fit centred. */
#era .ob-card { justify-content: safe center; overflow-y: auto; }
@media (max-width: 599px) { #era .ob-card { padding: 6% 7%; } #era .ob-card-go { display: none; } #era .ob-card-host { margin-bottom: .6em; } #era .ob-card-meta { display: none; } } /* the status bar already says when it was saved */

/* BIRTHDAYS — on desktop the "Born that same week" line sat just below the bottom of the panel, cut off; the panel now
   scrolls when it runs long (the wheel scrolls it before stepping on). On phones the Top 8 names ended in "…" after one
   line; they wrap now. The photo note and credit on the 2010s story card were 10px. */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) { #era .ch-born .ch-stage { overflow-y: auto; overscroll-behavior: contain; } }
#era .tw-8 u { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; overflow-wrap: anywhere; }
#era .tw-ov .tw-note, #era .tw-ov .tw-note span, #era .tw-ov .tw-cr { font-size: max(13px, 1em); }

/* THE REEL — portrait stills (Alicia Keys) were cropped through the face in the wide screen and the scene thumbnails;
   frame them from the top like the news photos */
#era .rv-img, #era .rv-fi img { object-position: 50% 20%; }

/* THE END — on phones the four small buttons broke onto two lines ("Share this / day"); tighter tracking keeps one line,
   and the postcard gets air under the header */
@media (max-width: 420px) { #era .ch-end .eb:not(.eb-main) { letter-spacing: .04em; padding-left: 8px; padding-right: 8px; } #era .ch-end .ch-stage, #era .ch-end > :first-child { margin-top: 6px; } }

/* HOME & PORTAL — on phones "Just visiting" ran past the right edge of the trip-type buttons once the labels were a
   readable size; the labels may now take two lines. The Sound button and the portal's line under the year were 12px. */
@media (max-width: 599px) {
  .mode-b { white-space: normal; line-height: 1.2; letter-spacing: .06em; padding: 6px 4px; min-height: 48px; font-size: 14px; }
  .sound { font-size: 14px; letter-spacing: .1em; }
  .travel-sub { font-size: 14px; letter-spacing: .16em; }
}
.travel-year { letter-spacing: -.02em; }

/* FINAL VERIFY — found on deployed staging after the pass:
   - Scoreboard on desktop: the game list was overflow:hidden, so the last card was cut mid-row (1990 @1024). It scrolls now
     (the stage hands the wheel to inner panels first). Card headers keep "NBA · PLAYOFFS" and the date whole, wrapping as units.
   - The World: the ticking population count ran past its box at 1024. Sized to the box.
   - Arrival weekday: the 90s rule (1,3,0) beat the phone 14px floor, so "FRIDAY" was 12px on phones in 1990. */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  #era .sb2-manual .bd-gl, #era .sb2-flap .bd-gl, #era .sb2-ticker .bd-grid, #era .sb2-ribbon .bd-gl {
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-bottom: 2px; }
  #era .al-pop { container-type: inline-size; }
  #era .al-pop .al-count { font-size: min(clamp(22px, 3.9vh, 34px), 11.5cqi); }
}
#era .bd-gk { flex-wrap: wrap; row-gap: 2px; } #era .bd-gk > span:last-child { white-space: nowrap; margin-left: auto; }
@media (max-width: 599px) { html body #era .ch-arrive .ar-date .ar-dow { font-size: 14px; } }

/* ON TV (desktop) — the guide was overflow:hidden at max-height 100%, so with 8 shows the "now showing" blurb's last line
   and the photo credit fell below the box (1975 & 1990 @1440). The show list is now the part that gives: it scrolls,
   and the blurb + credit always sit whole at the bottom of the guide. */
@media (min-width: 1000px) and (min-aspect-ratio: 5/4) {
  #era .tv-guide { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: auto; max-height: 100%; overflow: hidden; }
  #era .tv-guide > .tv-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  #era .tv-guide > .tv-now { min-height: 0; }
  #era .tv-now-cr { line-height: 1.4; }
}

/* PHOTO FIT (js/photofit.js) — a photo whose shape is far from its frame is shown whole over a blurred copy of itself:
   Film no-poster fallback (wide still in a 2:3 slot, e.g. TMNT 1990) and Reel portrait stills on the 16:9 screen (2023). */
.pf-fill { position: absolute; inset: -8%; z-index: 0; background: center / cover no-repeat; filter: blur(14px) brightness(.55) saturate(.9); pointer-events: none; font-style: normal; }
.fl-noimg > img.ph-img.pf-whole, .rv-pic > img.rv-img.pf-whole { object-fit: contain; object-position: 50% 50%; }
.fl-noimg.ph-slot > .pf-fill { visibility: visible; }
.rv-pic { overflow: hidden; }
.rv-pic > .pf-fill { transition: background-image .7s ease; }
.rv-proj .rv-pic > .pf-fill { filter: grayscale(1) blur(14px) brightness(.5); }
@media (prefers-reduced-motion: reduce) { .rv-pic > .pf-fill { transition: none; } }
