/* A finished Grand Prix on its track guide (scripts/raceReview.js): the race
   classification beside the points scored that weekend and the title fight
   after that round. Tokens come from signal.css, with fallbacks. */

.rr {
  --rr-ink: var(--sg-ink, var(--dk-fg-141414, #141414));
  --rr-muted: var(--sg-muted, var(--dk-fg-5c5c5a, #5c5c5a));
  --rr-line: var(--sg-line, var(--dk-ln-e2e2df, #e2e2df));
  --rr-mist: var(--sg-mist, var(--dk-bg-f3f3f1, #f3f3f1));
  --rr-paper: var(--sg-paper, var(--dk-bg-fcfcfc, #fcfcfc));
  --rr-orange: var(--sg-orange, #ff6b00);
  --rr-orange-ink: var(--sg-orange-ink, var(--dk-fg-a33d00, #a33d00));
  --rr-r: 16px;
}

.rr-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(18px, 2.4vw, 36px); align-items: start; }
.rr-grid.is-single { grid-template-columns: minmax(0, 1fr); }

/* ---- classification ---- */

.rr-table-wrap { border-radius: var(--rr-r); box-shadow: inset 0 0 0 1px var(--rr-line); background: var(--rr-paper); overflow: hidden; }
.rr-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rr-table th, .rr-table td { padding: 11px 14px; border-bottom: 1px solid var(--rr-line); text-align: left; vertical-align: middle; }
.rr-table thead th { background: var(--rr-mist); color: var(--rr-muted); font-size: 0.75rem; font-weight: 650; }
.rr-table tbody tr:last-child > * { border-bottom: 0; }
.rr-table .rr-num { width: 3.25rem; text-align: right; }
.rr-table tbody .rr-pos { box-shadow: inset 4px 0 0 var(--rr-team, #8a8a86); font-size: 1.125rem; font-weight: 720; letter-spacing: -0.03em; }
.rr-table tbody tr:first-child .rr-pos, .rr-table tbody tr:first-child .rr-pts { color: var(--rr-orange-ink); }
.rr-driver strong { display: block; font-weight: 650; }
.rr-driver small { display: block; color: var(--rr-muted); font-size: 0.8125rem; font-weight: 500; }
.rr-time { color: var(--rr-muted); white-space: nowrap; }
.rr-table .rr-time { text-align: right; }
.rr-pts { font-weight: 720; }
.rr-result:not(.is-open) .rr-rest { display: none; }

.rr-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 0 18px;
  border: 1px solid var(--rr-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--rr-ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 650;
  cursor: pointer;
}
.rr-more:hover { background: var(--rr-ink); color: var(--rr-paper); }
.rr-more:focus-visible, .rr-link:focus-visible { outline: 2px solid var(--rr-orange); outline-offset: 3px; }
.rr-note { margin: 12px 0 0; color: var(--rr-muted); font-size: 0.875rem; }

/* ---- points that weekend, and the table after the round ---- */

.rr-side { display: grid; gap: clamp(18px, 2vw, 28px); }
.rr-block { padding: clamp(16px, 1.8vw, 24px); border-radius: var(--rr-r); box-shadow: inset 0 0 0 1px var(--rr-line); background: var(--rr-paper); }
.rr-block h3 { margin: 0 0 12px; font-size: 1.125rem; font-weight: 720; letter-spacing: -0.03em; }
.rr-bars { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }

.rr-bars li {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 0 12px;
}

.rr-bar-pos { min-width: 1.25rem; font-size: 1.0625rem; font-weight: 720; font-variant-numeric: tabular-nums; }
.rr-bar-name { grid-column: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.rr-bars li > .rr-bar-name:first-child { grid-column: 1 / span 2; }
.rr-bar-name strong { font-weight: 650; }
.rr-bar-name small { color: var(--rr-muted); font-size: 0.8125rem; }
.rr-bar-value { grid-column: 3; font-weight: 720; font-variant-numeric: tabular-nums; }

/* the bar is the team's colour, as long as the driver's share of the best */
.rr-bar-track {
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(var(--rr-team, #8a8a86), var(--rr-team, #8a8a86)) left / calc(var(--rr-share, 0) * 100%) 100% no-repeat, var(--rr-line);
}

.rr-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; color: var(--rr-orange-ink); font-size: 0.9375rem; font-weight: 650; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }

@media (max-width: 900px) {
  .rr-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .rr-table th, .rr-table td { padding: 10px 8px; }
  .rr-table .rr-num { width: 2.5rem; }
  .rr-time { font-size: 0.8125rem; }
}
