/* Stillpoint Auto: track guide pages (v42, Nov 10, 2026: Sonoma Raceway, turn by turn). Loaded after site.css on
   guide pages only. Built on the site's tokens: cards use --pad-card and --gap-card, a heading group sits --s-block
   above what it introduces, small grey text is --muted, and every colour is a palette colour. */
html { scroll-behavior: smooth; }

/* ---------- Intro: the facts under the lead; the map belongs to the intro, so it follows closely ---------- */
.guide__intro { padding-bottom: var(--s-block); }
.band__lead + .specs__grid { margin-top: var(--s-block); }
/* four facts in one row (two rows of two on phones); label and value rows line up across the row even when a
   label wraps (subgrid) */
.specs__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.specs__grid--4 .spec { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
.specs__grid--4 .spec__k { align-self: end; }
.specs__grid--4 .spec__v { font-size: clamp(38px, 4vw, 60px); white-space: nowrap; }
@media (min-width: 761px) and (max-width: 1100px) {
  .specs__grid--4 .spec:nth-child(4) { padding-left: 22px; border-left: 1px solid var(--rule); }
}
@media (max-width: 760px) { .specs__grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Track map: one dark panel across the page. The turn numbers and labels grow (--k) as the map gets
   smaller, so they stay at least 12-13 px and the turn circles at least 24 px; the 500 ft bar keeps its true length. ---------- */
.guide__map { margin: 0; padding: var(--s-block) 0; background: var(--bg2); border-top: 1px solid var(--rule); }
.map { --k: 1; display: block; width: 100%; height: auto; }
.map--tall { display: none; }
.map__mk, .map__lbl { transform: scale(var(--k)); transform-origin: 0 0; }
.map__turn { cursor: pointer; outline: none; }
.map__turn circle { fill: var(--bg2); stroke: var(--sun); stroke-width: 2.5; transition: fill .3s; }
.map__turn text { fill: var(--text); font: 500 18px var(--sans); transition: fill .3s; }
.map__turn:hover circle, .map__turn:focus-visible circle, .map__turn.is-hot circle { fill: var(--sun); }
.map__turn:hover text, .map__turn:focus-visible text, .map__turn.is-hot text { fill: var(--bg); }
.map__turn:focus-visible circle { stroke: var(--text); }
/* the turn a reader comes back to from a card: it stays lit, and a ring pulses out from it three times */
.map__turn .map__ring, .map__turn:hover .map__ring, .map__turn:focus-visible .map__ring, .map__turn.is-hot .map__ring {
  fill: none; stroke: var(--sun); stroke-width: 2; opacity: 0; transform-origin: 0 0; pointer-events: none; transition: none; }
.map__turn.is-hot .map__ring { animation: mapring 1.2s ease-out .5s 3; }
@keyframes mapring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.2); } }
.map__name { fill: var(--muted); font: 500 15px var(--sans); letter-spacing: .22em; text-transform: uppercase; }
.map__note { fill: var(--body); font: 500 13.5px var(--sans); letter-spacing: .2em; text-transform: uppercase; }
.map__note--pit { fill: var(--muted); }
.map__north path { fill: var(--muted); }
.map__north text, .map__scale text { fill: var(--muted); font: 500 13.5px var(--sans); letter-spacing: .18em; }
.map__scale line { stroke: var(--muted); stroke-width: 2; }
.map__fig { margin: 0; }
.map__box { position: relative; }
/* where a card's turn number lands (#map-7A): the whole map, near the top of the screen, on wide screens; with the tall
   map (taller than a phone screen), that turn a third of the way down. Plain links, so every browser scrolls itself. */
.map__spot { position: absolute; left: 0; top: 0; width: 1px; height: 1px; pointer-events: none; scroll-margin-top: 48px; }
.guide__cap { max-width: 72ch; margin: 22px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.guide__credit { margin: 6px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.guide__credit a { color: inherit; text-underline-offset: 3px; }
@media (max-width: 1240px) { .map--wide { --k: 1.1; } }
@media (max-width: 1100px) { .map--wide { --k: 1.25; } }
@media (max-width: 1023px) { .map--wide { --k: 1.35; } }
/* portrait tablets and phones: the tall map, centred, up to 460 px wide; on phones it runs into the side margins
   (the drawing has its own margin), which keeps the labels larger */
@media (max-width: 920px) {
  .map--wide { display: none; }
  .map--tall { --k: 1.1; --w: min(460px, calc(100% + var(--gl) + var(--gr))); display: block; width: var(--w); margin-left: calc((100% - var(--w)) / 2); }
}
@media (max-width: 920px) { .map__spot { top: var(--ty); scroll-margin-top: 260px; } }
@media (max-width: 459px) { .map--tall { --k: 1.25; } }
@media (max-width: 400px) { .map--tall { --k: 1.4; } }

/* ---------- Corner cards: one onboard clip each (2:1, edge to edge at the top of the card), then the notes ---------- */
.turns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap-card); }
.band__title + .turns, .band__lead + .turns { margin-top: var(--s-block); }
.turn { display: flex; flex-direction: column; min-width: 0; padding: var(--pad-card); border: 1px solid var(--rule); background: var(--bg2);
  scroll-margin-top: 24px; transition: border-color .3s; }
.turn:target { border-color: rgba(227, 174, 110, .55); }
.clip { position: relative; margin: calc(-1 * var(--pad-card)) calc(-1 * var(--pad-card)) var(--s-title); aspect-ratio: 2 / 1;
  background: var(--bg); overflow: hidden; cursor: pointer; }
.clip__img, .clip__v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.clip__v { opacity: 0; transition: opacity .25s; }
.clip.is-playing .clip__v, .clip.is-started .clip__v { opacity: 1; }
.clip__btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center;
  width: 58px; height: 58px; padding: 0; border: 0; border-radius: 50%; background: rgba(7, 6, 5, .7); color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(243, 236, 226, .85), 0 0 0 1px rgba(7, 6, 5, .5); cursor: pointer;
  transition: opacity .3s, background .3s, color .3s, box-shadow .3s; }
/* measured on all 12 stills: the icon is at least 6.8:1 against the disc, and the light ring between the dark disc and
   the dark halo keeps the button's edge at least 4.9:1 against whatever the photo shows behind it */
.clip:hover .clip__btn, .clip__btn:focus-visible { background: rgba(7, 6, 5, .82); box-shadow: inset 0 0 0 1px var(--sun), 0 0 0 1px rgba(7, 6, 5, .5); color: var(--sun); }
.clip__btn svg { width: 22px; height: 22px; }
.clip__btn .i-pause { display: none; }
.clip.is-playing .clip__btn .i-play { display: none; }
.clip.is-playing .clip__btn .i-pause { display: block; }
.clip.is-playing .clip__btn { opacity: 0; }
.clip.is-playing:hover .clip__btn, .clip.is-playing .clip__btn:focus-visible { opacity: 1; }
@media (hover: none) { .clip.is-playing:hover .clip__btn { opacity: 0; } }
.clip.is-playing.is-waiting .clip__btn { opacity: 1; }   /* stopped to buffer mid-clip: bring the button and its ring back */
.clip.is-loading .clip__btn::after, .clip.is-waiting .clip__btn::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--sun); animation: clipspin .8s linear infinite; }
@keyframes clipspin { to { transform: rotate(360deg); } }
.clip.is-error { cursor: default; }
.clip.is-error .clip__btn { opacity: .4; cursor: default; }
.turn__badges { display: flex; gap: 8px; margin: 0 0 18px; }
a.badge { text-decoration: none; transition: background .3s, color .3s; }
a.badge:hover, a.badge:focus-visible { background: var(--sun); color: var(--bg); }
.badge { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 7px; border: 1.5px solid var(--sun);
  border-radius: 17px; font: 500 14px/1 var(--sans); color: var(--text); }
.turn__h { margin: 0 0 12px; font-weight: inherit; }
.turn__num { display: block; margin: 0 0 10px; font-size: 11px; font-weight: 500; line-height: 1; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.turn__name { display: block; font: 300 26px/1.1 var(--cond); letter-spacing: .02em; text-transform: uppercase; text-wrap: balance; }
.turn .ticks { margin: 0; }
.turn .ticks li, .guide__tips li { text-wrap: pretty; }
.nw { white-space: nowrap; }

/* ---------- Tips, reference laps and the closing band ---------- */
.guide__tips { max-width: 70ch; }
.lap__title { margin: 0; font: 300 26px/1.1 var(--cond); letter-spacing: .02em; text-transform: uppercase; text-wrap: balance; }
.inquire__go { margin: 22px 0 0; }
.inquire__go .way__go { color: var(--text); }

@media (max-width: 1100px) { .turns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .turns { grid-template-columns: minmax(0, 1fr); }
  .turn__name, .lap__title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .clip.is-loading .clip__btn::after, .clip.is-waiting .clip__btn::after, .map__turn.is-hot .map__ring { animation: none; }
}
