/* F1 teams (racing-teams.js): constructor names as links, the card on hover, the team's page */

/* The page: the sport's, as wide as a league's, with no season menu */
[data-view="sport-team"] .controls { display: none; }
[data-view="sport-team"] .crumbs ol,
[data-view="sport-team"] .masthead-inner,
[data-view="sport-team"] .wrap { max-width: 1060px; }

/* A constructor's name on the racing pages keeps its cell's look */
a.rt-a { color: inherit; text-decoration: none; }
.racing-t a.rt-a { font-weight: inherit; }
a.rt-a:hover { text-decoration: underline; text-underline-offset: 3px; }
a.rt-a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 2px; }

/* The logo on white, or the plain mark: the team's color with its initials */
.rt-logo, .rt-mark {
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.rt-logo { display: flex; align-items: center; justify-content: center; background: #fff; }
.rt-logo img { display: block; min-width: 0; max-width: 100%; max-height: 100%; object-fit: contain; }
.rt-mark { font-family: var(--display); font-weight: 700; letter-spacing: .02em; user-select: none; }
/* In a row's logo slot (racing.css), for a team without a row mark: a small tag of its color,
   the initials in small type, as wide as they need up to the slot's width */
.racing-tl .rt-rowmark {
  height: 14px;
  min-width: 20px;
  max-width: 100%;
  padding: 0 3px;
  border: 0;
  border-radius: 3px;
  font-size: 9px;
  line-height: 14px;
  letter-spacing: 0;
  white-space: nowrap;
}
.racing-tl .rt-rowmark::before { content: attr(data-i); }

/* ─── The card ─────────────────────────────────────────── */

.rtk {
  position: fixed;
  z-index: 61;
  top: 0;
  left: 0;
  width: 352px;
  max-width: calc(100vw - 16px);
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.rtk-top { display: flex; align-items: center; gap: 12px; }
.rtk-logo { width: 84px; height: 56px; padding: 6px; font-size: 20px; }
.rtk-id { min-width: 0; }
.rtk-n { margin: 0; font: 600 20px/1.15 var(--display); }
/* The full name ("McLaren Mastercard F1 Team"), then the base and power unit */
.rtk-f { margin: 2px 0 0; font-weight: 600; line-height: 1.3; }
.rtk-c { margin: 3px 0 0; color: var(--muted); }
/* The season and the career in numbers: racing-cards.css */
.rt-facts dt, .rt-staff dt, .rtk-e dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
/* The season's drivers and team principal: the label, then each person two to a line, their
   portrait (or initials) beside the name, the two together a link to their page */
.rtk-e { margin: 10px 0 0; line-height: 1.25; }
.rtk-e div + div { margin-top: 9px; }
.rtk-e dt { margin: 0 0 5px; white-space: nowrap; }
.rtk-e dd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.rtk-p { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink); font-weight: 600; text-decoration: none; }
a.rtk-p:hover .rtk-pn { text-decoration: underline; text-underline-offset: 2px; }
.rtk-pn { min-width: 0; overflow-wrap: break-word; }
.rtk-pic {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
}
.rtk-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rtk-ph { font: 600 12.5px/1 var(--display); letter-spacing: .02em; color: var(--muted); user-select: none; }
.rtk-more { align-self: center; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rtk-w { margin: 8px 0 0; line-height: 1.35; font-weight: 600; }

/* ─── The team's page ──────────────────────────────────── */

.sp-racing-teams { display: grid; gap: 24px; }
.sp-racing-teams > * { min-width: 0; }

.rt-nav { margin: 0 2px -8px; font-size: 14px; }
.rt-nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.rt-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.rt-nav a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 2px; }

.rt-hd {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  margin: 0 2px 8px;
}
.rt-hd h2 { margin: 0; font: 600 17px/1.2 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.rt-note { font-size: 13px; color: var(--muted); }

.sp-racing-teams a:not(.rt-more) { color: inherit; text-decoration: none; }
.sp-racing-teams a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-racing-teams a:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; border-radius: 2px; }

/* The head: logo, name, facts, lineage */
.rt-head { display: flex; align-items: center; gap: 22px; padding: 18px; }
.rt-hlogo { width: 176px; height: 118px; padding: 14px; font-size: 40px; }
.rt-hid { min-width: 0; }
.rt-hn { margin: 0; font: 600 34px/1.05 var(--display); }
.rt-full { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.rt-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 14px 0 0; }
.rt-facts dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }
.rt-y { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.rt-line { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.rt-line a { color: var(--ink); font-weight: 600; }

/* Drivers and leadership, side by side */
.rt-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 20px; align-items: start; }
.rt-pair.rt-one { grid-template-columns: minmax(0, 1fr); }
.rt-drv { margin: 0; padding: 0; list-style: none; }
.rt-drv li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px; }
.rt-drv li + li { border-top: 1px solid var(--line); }
.rt-drv li > span:nth-child(2) { font: 600 21px/1.2 var(--display); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-no {
  display: grid;
  place-items: center;
  height: 32px;
  border-radius: 6px;
  background: var(--rt-team, var(--ink));
  color: var(--rt-ink, #fff);
  font: 700 17px/1 var(--display);
  font-variant-numeric: tabular-nums;
}
.rt-res .rt-no { visibility: hidden; }
.rt-drv li.rt-res > span:nth-child(2) { font-size: 18px; font-weight: 500; }
.rt-role { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rt-staff { margin: 0; }
.rt-staff > div { padding: 10px 14px; }
.rt-staff > div + div { border-top: 1px solid var(--line); }
.rt-staff dd { margin: 2px 0 0; font: 600 21px/1.2 var(--display); }

/* The capsule: the record in a few lines, a grid of them; on phones one line runs into its detail */
.rt-cap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px 28px;
  margin: 0;
  padding: 16px 18px;
  list-style: none;
}
.rt-cap li { min-width: 0; }
.rt-cap b { display: block; font: 600 19px/1.2 var(--display); }
.rt-cap span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted); }

/* Tables */
.rt-t { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.rt-t th {
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rt-t td {
  padding: 9px 8px;
  border-top: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: baseline;
}
.rt-t th:first-child, .rt-t td:first-child { padding-left: 14px; }
.rt-t th:last-child, .rt-t td:last-child { padding-right: 14px; }
.rt-t .rt-n { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.rt-t a { font-weight: 600; }
.rt-short { display: none; }

.rt-seasons .rt-yr { width: 110px; }
.rt-seasons .rt-pos { width: 52px; }
.rt-seasons .rt-pts { width: 72px; }
.rt-t .rt-pod { width: 84px; }
.rt-seasons td.rt-yr a { font-weight: 700; }
.rt-seasons td.rt-pos { font-weight: 700; color: var(--muted); }
.rt-seasons td.rt-pts { font-weight: 700; }
.rt-seasons td.rt-dr { white-space: normal; }
.rt-seasons td.rt-dr a { font-weight: 400; }
.rt-seasons tr.rt-champ td.rt-pos { color: var(--win); }
.rt-live { margin-left: 6px; font-size: 12px; color: var(--muted); }

.rt-wins .rt-date { width: 120px; }
.rt-wins .rt-win { width: 34%; }
.rt-wins td.rt-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.rt-wins td.rt-win a { font-weight: 400; }

.rt-all .rt-span { width: 32%; }
.rt-all td.rt-span { white-space: normal; color: var(--muted); font-variant-numeric: tabular-nums; }

.rt-more {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: 600 14px/1.2 var(--body);
  text-align: left;
  cursor: pointer;
}
.rt-more:hover { background: var(--surface-2); text-decoration: underline; text-underline-offset: 3px; }
.rt-more:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.rt-credit { margin: -12px 2px 0; font-size: 12px; color: var(--muted); }

/* ─── Narrow screens ───────────────────────────────────── */

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

@media (max-width: 600px) {
  .sp-racing-teams { gap: 20px; }
  .rt-head { align-items: flex-start; gap: 14px; padding: 14px; }
  .rt-hlogo { width: 96px; height: 72px; padding: 8px; font-size: 26px; }
  .rt-hn { font-size: 27px; }
  .rt-full { font-size: 13.5px; }
  .rt-facts { gap: 6px 18px; margin-top: 10px; }
  .rt-facts dd { font-size: 14px; }
  .rt-line { font-size: 13px; gap: 2px 14px; }
  .rt-drv li { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 9px 10px; }
  .rt-drv li > span:nth-child(2), .rt-staff dd { font-size: 19px; }
  .rt-drv li.rt-res > span:nth-child(2) { font-size: 17px; }
  .rt-staff > div { padding: 9px 10px; }
  .rt-cap { grid-template-columns: 1fr; gap: 9px; padding: 12px 14px; }
  .rt-cap b { display: inline; font-size: 17px; }
  .rt-cap span { display: inline; margin: 0 0 0 4px; }
  .rt-t { font-size: 13.5px; }
  .rt-t th, .rt-t td { padding-left: 4px; padding-right: 4px; }
  .rt-t th:first-child, .rt-t td:first-child { padding-left: 10px; }
  .rt-t th:last-child, .rt-t td:last-child { padding-right: 10px; }
  .rt-t th { font-size: 10px; letter-spacing: .04em; }
  .rt-t .rt-n { width: 40px; }
  .rt-long { display: none; }
  .rt-short { display: inline; }
  /* Columns left out on phones are collapsed to nothing: a display: none cell still gets a share
     of a fixed-layout table's width in Chromium */
  .rt-t .rt-pod, .rt-t .rt-pl { width: 0; padding: 0; font-size: 0; }
  .rt-seasons .rt-yr { width: 54px; }
  .rt-seasons .rt-pos { width: 34px; }
  .rt-seasons .rt-pts { width: 46px; }
  .rt-live { display: block; margin: 0; font-size: 11px; }
  .rt-wins .rt-date { width: 92px; }
  .rt-wins .rt-win { width: 30%; }
  .rt-all .rt-span { width: 30%; }
  .rt-all .rt-n:not(.rt-pod) { width: 48px; }
  .rt-more { padding: 10px; }
}
