/* The F1 hover cards' shared parts (racing-cards.js): a card's sections of numbers, and the list a
   number opens beside the card */

/* The sections share six columns, each as wide as its widest label or value (never cut); the
   cells' padding hangs into the card's own, so their text lines up with the rest of it */
.rck-g {
  display: grid;
  grid-template-columns: repeat(6, minmax(max-content, 1fr));
  column-gap: 2px;
  margin: 10px -5px 0;
}
.rck-s { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: start; }
.rck-s + .rck-s { margin-top: 9px; }
.rck-h {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 10px;
  grid-column: 1 / -1;
  margin: 0 5px 1px;
}
.rck-ht { font: 600 14px/1.25 var(--display); letter-spacing: .06em; text-transform: uppercase; }
/* A season's heading links to its page, as the card's other links do */
a.rck-ht { color: inherit; text-decoration: none; }
a.rck-ht:hover { text-decoration: underline; text-underline-offset: 2px; }
.rck-hn { min-width: 0; color: var(--muted); font-size: 12.5px; line-height: 1.3; text-align: right; }

.rck-c { display: flex; flex-direction: column; min-width: 0; padding: 2px 4px 3px; border: 1px solid transparent; border-radius: 5px; text-align: left; }
.rck-k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--muted);
}
.rck-v { margin-top: 1px; font: 600 20px/1.1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A number with a list: a button, its value underlined with dots; open, it keeps the hover's box */
button.rck-b { margin: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.rck-b .rck-v { text-decoration: underline dotted 1.5px; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.rck-b:hover, .rck-b[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line-strong); }
.rck-b[aria-expanded="true"] .rck-v { text-decoration-color: var(--ink); }
.rck-b:focus-visible { outline: 2px solid var(--ink); outline-offset: -1px; }

/* ─── The list beside the card ─────────────────────────── */

.rcn {
  position: fixed;
  z-index: 62;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 328px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
}
.rcn[hidden] { display: none; }
.rcn a { color: inherit; text-decoration: none; }
.rcn a:hover { text-decoration: underline; text-underline-offset: 2px; }
.rcn a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 2px; }

.rcn-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex: none; margin: 0; padding: 10px 12px 6px; }
.rcn-t { font: 600 15px/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.rcn-n { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcn-lg { flex: none; margin: -2px 0 0; padding: 0 12px 6px; color: var(--muted); font-size: 12px; }
.rcn-lg b { color: var(--ink); }
/* The races: a long list scrolls inside, never the page behind it */
.rcn-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 10px; }
.rcn-x { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

/* A season's races, a line each: date, race, what follows (a place, the drivers) */
.rcn-rows {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) auto;
  gap: 3px 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rcn-rows li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; }
.rcn-dt { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcn-r { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.rcn-tl { color: var(--muted); font-variant-numeric: tabular-nums; }
.rcn-rows .rcn-tl { text-align: right; }
.rcn-tl b { color: var(--ink); font-weight: 600; }

/* A career's races by Grand Prix, each with its years */
.rcn-gps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.rcn-gps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; }
.rcn-gpn { margin-right: 2px; font-weight: 600; }
.rcn-y { color: var(--muted); font-variant-numeric: tabular-nums; }
.rcn a.rcn-w { color: var(--ink); font-weight: 700; }

/* A career's races by season: the season and its count, then its races */
.rcn-ss { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rcn-ss li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 0 8px; align-items: baseline; }
.rcn-sy { display: flex; align-items: baseline; gap: 5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rcn-si { display: flex; flex-wrap: wrap; gap: 1px 12px; min-width: 0; }
.rcn-it { min-width: 0; }
.rcn-it .rcn-r { font-weight: 500; }

/* A season's championship: place, name, a driver's teams, points; each number column as wide as
   its widest value, never cut, the names giving way. The card's own line is tinted and bold */
.rcn-st {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) minmax(0, auto) max-content;
  gap: 0 10px;
  margin: 0 -6px;
  padding: 0;
  list-style: none;
}
.rcn-st3 { grid-template-columns: max-content minmax(0, 1fr) max-content; }
.rcn-st li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; padding: 2px 6px; border-radius: 4px; }
.rcn-st .rcn-sh { padding-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.rcn-sh span:first-child, .rcn-sh span:last-child { text-align: right; }
.rcn-sp, .rcn-spt { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.rcn-sp { color: var(--muted); }
.rcn-sn { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.rcn-stm { min-width: 0; color: var(--muted); overflow-wrap: anywhere; }
.rcn-spt { font-weight: 600; }
.rcn-st li.rcn-me { background: var(--line); font-weight: 700; }
.rcn-me .rcn-sn, .rcn-me .rcn-spt { font-weight: 700; }
.rcn-me .rcn-sp, .rcn-me .rcn-stm { color: var(--ink); }
