/* f1gures - page styles, stage 3 group e) Calendar, circuits and circuit pages.
   Linked from BaseLayout after app.css and before site.css; tokens live in
   app.css, components in sharp.css. Only the owning group edits this file
   (docs/redesign/inventory.md section 4). Layout only: every surface, row and
   number is a Sharp component (src/components/sharp/). Tokens, no hex. */

/* ============================================================
   CALENDAR  (/calendar/, CalendarScreen)
   ============================================================ */
.cal-page .cal-top { margin-bottom: 28px; align-items: start; }
.cal-page .cal-filters { margin: 12px 0 14px; }

/* ============================================================
   CIRCUITS INDEX  (/circuits/, CircuitsIndexScreen)
   One linked Card per venue: text left, the flat track right, key numbers
   along the bottom.
   ============================================================ */
.circ-card { display: flex; flex-direction: column; height: 100%; }
.circ-card > .s-card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.circ-card-top { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 12px; align-items: start; }
.circ-card-tx { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.circ-card-tx .s-eyebrow { margin: 0; }
.circ-card-name {
  margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 20px; line-height: 1.02;
  text-transform: uppercase; overflow-wrap: break-word; text-wrap: balance;
}
.circ-card-loc {
  margin: 0; display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--f-mono); font-size: 12px; color: var(--fg-3);
}
.circ-card-loc img { width: 20px; height: 14px; object-fit: cover; flex: none; }
.circ-card-loc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.circ-card-track { width: 84px; height: 84px; }
.circ-card-stats { margin-top: auto; }

/* ============================================================
   CIRCUIT PAGE  (/circuits/<ref>/, CircuitPage.astro)
   ============================================================ */
.cp-page .cp-back { margin-bottom: 12px; }
.cp-page .cp-hero { margin-bottom: 18px; }
.cp-intro { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin: 0 0 28px; }
.cp-blurb { margin: 0; flex: 1 1 420px; max-width: 70ch; color: var(--fg-2); font-size: 15px; line-height: 1.6; text-wrap: pretty; }

.cp-mid { align-items: start; margin-bottom: 28px; }
.cp-col { display: grid; gap: 12px; min-width: 0; }
.cp-col .s-sh + * { margin-top: 0; }
.cp-col > * + .s-sh { margin-top: 16px; }
.cp-bars > .s-card-body { display: grid; gap: 14px; }
.cp-divide { height: 1px; background: var(--line-1); }
.cp-wx { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-2); }

.cp-lap .s-callout-body { display: grid; gap: 10px; }
.cp-lap-time {
  font-family: var(--f-display); font-weight: 800; font-size: var(--fs-num-l); line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--fg-1);
}
.cp-lap-holder { display: flex; align-items: center; gap: 10px; }
.cp-lap-holder > span { display: grid; gap: 2px; font-family: var(--f-display); font-weight: 700; font-size: 17px; text-transform: uppercase; }
.cp-lap-holder small { font-family: var(--f-mono); font-weight: 400; font-size: 12px; text-transform: none; color: var(--fg-3); }

.cp-next > .s-card-body { display: grid; gap: 6px; }
.cp-next .s-eyebrow { margin: 0; }
.cp-next-name { margin: 0; font-family: var(--f-display); font-weight: 800; font-size: 26px; line-height: 1; text-transform: uppercase; }

.cp-records { margin-bottom: 28px; align-items: start; }

.cp-cell { display: inline-flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; }
.cp-fl-time { font-family: var(--f-mono); font-size: 12px; color: var(--fg-3); }

/* Historical winners: DataTable (mobile="rows") above 720px, LeaderList below.
   Rows pass no pos (every row is a winner), so LeaderRow drops the position
   column; the year sits on the right. */
.cp-winners-ll { display: none; }

@media (max-width: 720px) {
  .cal-page .cal-top { margin-bottom: 22px; }
  .cp-intro { margin-bottom: 22px; }
  .cp-blurb { flex-basis: 100%; }
  .cp-mid, .cp-records { margin-bottom: 22px; }
  .cp-lap-time { font-size: var(--fs-num-m); }
  .cp-winners-ll { display: block; }
}
