/*
 * Design System: Campeonatos Clássicos (CC)
 * ---------------------------------------------------------------------------
 * Visual identity reverse-engineered from campeonatosclassicos.com.br (Wix).
 *   • Theme:        LIGHT, white surfaces, near-black ink
 *   • Display font: "Jockey One" (titles/logo) + "Russo One" (section heads)
 *   • Body font:    "Jost" — free geometric sans, closest to the site's Futura
 *   • Primary:      #FF5020  — the brand "action / speed" orange-red (Wix --color_18)
 *   • Secondary:    #E99F15 gold + #FFA890 light-orange tints (Wix --color_23 / --color_17)
 *   • Ink:          #212121  — near-black used for text & headers (Wix --color_15/37/45)
 * ---------------------------------------------------------------------------
 * Editado direto aqui; o build copia para out/html/styles.css.
 */

@import url('https://fonts.googleapis.com/css2?family=Jockey+One&family=Russo+One&family=Jost:wght@300;400;500;600;700&display=swap');

:root {
  /* ---- Brand palette (extracted from the live Wix theme) ---- */
  --cc-accent: #FF5020;       /* PRIMARY  — action / speed (color_18)        */
  --cc-accent-dark: #E0461A;  /* hover state                               */
  --cc-accent-soft: #FFA890;  /* SECONDARY — light orange (color_17)         */
  --cc-accent-tint: #FFF1EC;  /* faint accent wash for hovers/zebra          */
  --cc-gold: #E99F15;         /* SECONDARY — gold (color_23)                 */
  --cc-gold-dark: #B58E45;    /* (color_22)                                  */
  --cc-bronze: #9B6A0E;       /* (color_24)                                  */

  /* ---- Neutrals ---- */
  --cc-ink: #212121;          /* headings & body text (color_15/37/45)        */
  --cc-ink-soft: #4A4A4A;     /* secondary text                              */
  --cc-ink-muted: #7A7A7A;    /* captions / labels (~color_9 #727272)        */
  --cc-bg: #FFFFFF;           /* page background                             */
  --cc-surface: #FFFFFF;      /* card / surface background                   */
  --cc-surface-alt: #FAFAFA;  /* alternating (zebra) rows                    */
  --cc-line: #E6E6E6;         /* hairline borders                            */
  --cc-line-soft: #F1F1F1;    /* very soft separators                        */

  /* ---- Semantic aliases (compat with existing .tsx) ---- */
  --accent: var(--cc-accent);
  --silver: #B0B0B0;          /* P2 (color_10)                               */
  --bronze: var(--cc-gold);   /* P3 → gold                                   */
  --green: #1A8F23;           /* positive deltas                            */
  --red: #D63A1F;             /* negative deltas / high incidents           */
  --cyan: #1769AA;            /* link / time accent                          */

  /* ---- Medals (1st / 2nd / 3rd position badges) ----
     Real gold / silver / bronze, tuned warm so they sit next to the
     #FF5020 brand without clashing. Gold reads GOLD (yellow), never orange. */
  --medal-gold-1: #F6DC8A;   /* highlight                                   */
  --medal-gold-2: #D4AF37;   /* core                                        */
  --medal-gold-3: #B8860B;   /* deep                                        */
  --medal-silver-1: #EEF1F4; /* highlight                                   */
  --medal-silver-2: #BFC6CD; /* core                                        */
  --medal-silver-3: #8E969E; /* deep                                        */
  --medal-bronze-1: #D99B66; /* highlight                                   */
  --medal-bronze-2: #A96B2F; /* core                                        */
  --medal-bronze-3: #6E3F18; /* deep                                        */

  /* ---- Typography ---- */
  --font-display: 'Jockey One', 'Russo One', system-ui, sans-serif;
  --font-heading: 'Russo One', 'Jockey One', system-ui, sans-serif;
  --font-body: 'Jost', 'Futura', 'Century Gothic', system-ui, sans-serif;
  --font-mono: 'Jost', system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--cc-bg);
  color: var(--cc-ink);
  line-height: 1.6;
  font-size: 15px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle speed-stripe texture (very low-opacity diagonal accent) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 80, 32, 0.022) 0,
    rgba(255, 80, 32, 0.022) 2px,
    transparent 2px,
    transparent 15px
  );
  pointer-events: none;
  z-index: 0;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.18s ease; }
a:hover { color: var(--cc-accent); }

/* ====== HEADER ====== */
.header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  position: relative;
}
.header::after {
  content: '';
  display: block;
  width: 120px;
  height: 4px;
  margin: 1.6rem auto 0;
  background: linear-gradient(90deg, var(--cc-accent), var(--cc-gold));
  border-radius: 2px;
}
.header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--cc-ink);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.05;
}
.header .subtitle {
  color: var(--cc-ink-muted);
  font-size: 0.82rem;
  margin-top: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.broadcast-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  padding: 0.6rem 1.25rem;
  background: var(--cc-accent);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--cc-accent-dark);
  transition: transform 0.1s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.broadcast-btn:hover { background: var(--cc-accent-dark); color: #fff; }
.broadcast-btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--cc-accent-dark); }
.broadcast-btn svg { flex-shrink: 0; }

/* ====== RACE POINTS BREAKDOWN ====== */
.pts-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.pts-total {
  font-family: var(--font-heading);
  font-weight: 400;
  color: var(--cc-accent);
  font-size: 1.05rem;
}
.pts-breakdown {
  display: inline-flex;
  gap: 0.3rem;
  margin-top: 0.2rem;
}
.pts-bonus {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}
.pts-fl { color: var(--cc-gold-dark); background: rgba(233, 159, 21, 0.14); }
.pts-pole { color: var(--cyan); background: rgba(23, 105, 170, 0.10); }
.pts-qualify { color: var(--cc-gold-dark); background: rgba(23, 105, 170, 0.10); }

/* ====== RACE STATS (expandable grid) ====== */
.race-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  flex: 0 1 auto;
  min-width: 170px;
  padding: 1.15rem 1.5rem;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-top: 3px solid var(--cc-accent);
  border-radius: 6px;
  text-align: center;
}
.stat-card .stat-val {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 400;
  color: var(--cc-accent);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cc-ink-muted);
  margin-top: 0.4rem;
  font-weight: 500;
}
.stat-card .stat-sub {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--cc-ink-soft);
  margin-top: 0.4rem;
  font-weight: 500;
}

/* ====== CHAMPIONSHIP CARDS (index) ====== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.card-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  padding: 1.85rem;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cc-accent), var(--cc-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}
.card:hover {
  border-color: var(--cc-accent-soft);
  box-shadow: 0 10px 30px -12px rgba(255, 80, 32, 0.28);
  transform: translateY(-2px);
}
.card:hover::before { transform: scaleX(1); }
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.card h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--cc-ink);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.card .season {
  color: var(--cc-accent);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  margin-top: 0.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.card .meta {
  display: flex;
  gap: 1.75rem;
  margin-top: 1.1rem;
  color: var(--cc-ink-muted);
  font-size: 0.85rem;
}
.card .meta .val {
  color: var(--cc-ink);
  font-weight: 600;
}
.card .active-chip {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-dark));
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  line-height: 1;
}
.card .unofficial-chip {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, #8a8a8a, #5a5a5a);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  line-height: 1;
}
.card .special-chip {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #1a1a1a;
  background: linear-gradient(135deg, #f5c453, #c8961e);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  line-height: 1;
}
.card .time-trial-chip {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, #4a7bcc, #2f4d80);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  line-height: 1;
}

.last-update-line {
  margin-top: 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cc-ink-muted);
  text-align: center;
}

.tt-leader {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--cc-border, rgba(0,0,0,0.08));
  font-size: 0.85rem;
  color: var(--cc-ink-muted);
}
.tt-leader .val {
  color: var(--cc-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tt-highlight {
  margin: 1.25rem 0 1.75rem;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(90deg, rgba(74,123,204,0.12), transparent);
  border-left: 3px solid #4a7bcc;
  border-radius: 4px;
  font-size: 0.95rem;
}
.tt-highlight strong { color: var(--cc-ink); }

.driver-casual-events {
  margin: 2rem 0 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--cc-panel, #f5f5f0);
  border-left: 3px solid #8a8a8a;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--cc-ink-muted);
}
.driver-casual-events a {
  color: var(--cc-ink);
  text-decoration: none;
  border-bottom: 1px dotted var(--cc-ink-muted);
}
.driver-casual-events a:hover { border-bottom-style: solid; }

/* ====== EVENTOS HUB — radio-driven tabs (JS-free) ====== */
.event-tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.event-tab-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0 2rem;
}
.event-tab-label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cc-ink-muted);
  margin-right: 0.25rem;
}
.event-tab-btn {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-ink);
  background: var(--cc-panel, #f5f5f0);
  border: 1px solid var(--cc-border, #d8d4c8);
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.event-tab-btn:hover {
  border-color: var(--cc-accent, #c8323f);
}
.event-tab-panel { display: none; }
/* One selector per known tab id — the general-sibling combinator matches
   because all radios precede all panels within .event-type-tabs. */
#event-tab-campeonatos:checked ~ #event-panel-campeonatos,
#event-tab-4fun:checked ~ #event-panel-4fun,
#event-tab-especiais:checked ~ #event-panel-especiais,
#event-tab-contrarrelogio:checked ~ #event-panel-contrarrelogio {
  display: block;
}
#event-tab-campeonatos:checked ~ .event-tab-row label[for="event-tab-campeonatos"],
#event-tab-4fun:checked ~ .event-tab-row label[for="event-tab-4fun"],
#event-tab-especiais:checked ~ .event-tab-row label[for="event-tab-especiais"],
#event-tab-contrarrelogio:checked ~ .event-tab-row label[for="event-tab-contrarrelogio"] {
  background: var(--cc-accent, #c8323f);
  color: #fff;
  border-color: var(--cc-accent, #c8323f);
}
.empty-note {
  color: var(--cc-ink-muted);
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}
.event-callout-card {
  /* Reuses .card; visual-only tweak to distinguish home-page callout from full listings. */
  border-left: 3px solid #c8961e;
}
.card .next-race {
  margin-top: 0.5rem;
  color: var(--cc-ink-muted);
  font-size: 0.8rem;
}
.card .next-race .val {
  color: var(--cc-ink);
  font-weight: 600;
}
.card .top5-list {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0 0;
  border-top: 1px solid var(--cc-border, rgba(0,0,0,0.08));
  list-style: none;
}
.card .top5-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
  font-size: 0.82rem;
}
.card .top5-pos {
  flex-shrink: 0;
  width: 1.6rem;
  color: var(--cc-ink-muted);
  font-weight: 600;
}
.card .top5-name {
  flex: 1;
  color: var(--cc-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .top5-points {
  flex-shrink: 0;
  color: var(--cc-ink-muted);
  font-weight: 600;
}
.card .podium-list {
  margin: 0.9rem 0 0;
  /* Pins the podium to the bottom of the card regardless of how much content sits above it. */
  margin-top: auto;
  padding: 0.6rem 0 0;
  border-top: 1px solid var(--cc-border, rgba(0,0,0,0.08));
  list-style: none;
}
.card .podium-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.82rem;
}
.card .podium-list li.podium-champion {
  font-size: 0.95rem;
  font-weight: 700;
}
.card .podium-trophy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  font-size: 1.05rem;
}
.card .podium-list li.podium-champion .podium-trophy {
  font-size: 1.3rem;
}
.card .podium-trophy.trophy-gold {
  color: #d4af37;
}
.card .podium-trophy.trophy-silver {
  color: #a8a8a8;
}
.card .podium-trophy.trophy-bronze {
  color: #b06a34;
}
.card .podium-trophy.podium-pos {
  color: var(--cc-ink-muted);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
}
.card .podium-list li.podium-champion .podium-trophy.podium-pos {
  color: var(--cc-ink);
  font-size: 1rem;
}
.card .podium-name {
  flex: 1;
  color: var(--cc-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .podium-points {
  flex-shrink: 0;
  color: var(--cc-ink-muted);
  font-weight: 600;
}
.card .podium-list li.podium-champion .podium-points {
  color: var(--cc-ink);
}

/* ====== TABLES ====== */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 2.5rem;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  background: var(--cc-surface);
  box-shadow: 0 4px 18px -10px rgba(33, 33, 33, 0.12);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  background: var(--cc-ink);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--cc-accent);
  position: sticky;
  top: 0;
}
thead th:first-child { border-top-left-radius: 7px; }
thead th:last-child { border-top-right-radius: 7px; }
tbody td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--cc-line-soft);
  white-space: nowrap;
  color: var(--cc-ink);
}
tbody tr:nth-child(even) { background: var(--cc-surface-alt); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--cc-accent-tint); }

/* Right-align numeric cols */
td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ====== POSITION BADGE ====== */
.pos {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.9rem;
}
.pos-1 {
  background: linear-gradient(145deg, var(--medal-gold-1) 0%, var(--medal-gold-2) 50%, var(--medal-gold-3) 100%);
  color: #42300A;
  box-shadow: 0 0 0 2px rgba(212,175,55,0.30), inset 0 1px 0 rgba(255,255,255,0.45);
}
.pos-2 {
  background: linear-gradient(145deg, var(--medal-silver-1) 0%, var(--medal-silver-2) 50%, var(--medal-silver-3) 100%);
  color: #262B30;
  box-shadow: 0 0 0 2px rgba(150,160,170,0.25), inset 0 1px 0 rgba(255,255,255,0.5);
}
.pos-3 {
  background: linear-gradient(145deg, var(--medal-bronze-1) 0%, var(--medal-bronze-2) 55%, var(--medal-bronze-3) 100%);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(169,107,47,0.30), inset 0 1px 0 rgba(255,255,255,0.3);
}
.pos-other { background: var(--cc-line); color: var(--cc-ink-soft); }

/* ====== DRIVER TITLES ====== */
.driver-titles {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1rem 0 2.25rem;
}
.driver-title-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 1px solid transparent;
}
.driver-title-item.driver-title-champion {
  background: var(--cc-surface);
  border-color: rgba(212,175,55,0.35);
}
.driver-title-item.driver-title-runnerup {
  background: var(--cc-surface);
  border-color: rgba(168,168,168,0.35);
}
.driver-title-trophy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}
.driver-title-trophy.trophy-gold {
  color: #d4af37;
  filter: drop-shadow(0 2px 4px rgba(212,175,55,0.4));
}
.driver-title-trophy.trophy-silver {
  color: #a8a8a8;
  filter: drop-shadow(0 2px 4px rgba(168,168,168,0.35));
}
.driver-title-link {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}
.driver-title-link:hover {
  text-decoration-color: currentColor;
}

/* ====== SECTION TITLE ====== */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--cc-ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.1rem;
  padding-left: 0.85rem;
  border-left: 4px solid var(--cc-accent);
}

.class-section-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cc-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 1.5rem 0 0.75rem;
}
.class-section-title:first-child {
  margin-top: 0;
}

/* ====== BACK LINK ====== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--cc-ink-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-heading);
  transition: color 0.18s ease;
}
.back-link:hover { color: var(--cc-accent); }
.back-link::before { content: '‹'; font-size: 1.4rem; font-weight: 700; line-height: 0.8; }

/* ====== MEDIA CARD (championship page footer) ====== */
.media-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.media-card {
  position: relative;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}
.media-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cc-accent), var(--cc-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s ease;
}
.media-card:hover {
  border-color: var(--cc-accent-soft);
  box-shadow: 0 10px 30px -12px rgba(255, 80, 32, 0.28);
  transform: translateY(-2px);
}
.media-card:hover::before { transform: scaleX(1); }
.media-card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cc-ink);
  margin: 0 0 0.4rem;
}
.media-card-sub {
  color: var(--cc-ink-muted);
  font-size: 0.85rem;
  margin: 0 0 1.5rem;
}
.media-card-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  color: var(--cc-ink-muted);
  transition: color 0.22s ease;
}
.media-card:hover .media-card-icons { color: var(--cc-accent); }
.media-card-icons svg { transition: transform 0.2s ease; }
.media-card-icons svg:hover { transform: translateY(-3px) scale(1.12); }

/* ====== EVENT LIST ====== */
.event-list {
  list-style: none;
  margin-bottom: 2.5rem;
}
.event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.3rem;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-left: 4px solid var(--cc-accent);
  border-radius: 6px;
  margin-bottom: 0.6rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
}
.event-item:hover {
  border-left-color: var(--cc-gold);
  box-shadow: 0 8px 22px -12px rgba(33, 33, 33, 0.25);
  transform: translateX(2px);
}
.event-item:hover .event-link { color: var(--cc-accent); }
.event-item .event-info {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  min-width: 0;
  flex-wrap: wrap;
}
.event-item .event-track {
  font-family: var(--font-heading);
  color: var(--cc-ink);
  font-size: 0.98rem;
}
.event-item .event-date {
  font-family: var(--font-body);
  color: var(--cc-ink-muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.event-item .event-attendance {
  font-family: var(--font-heading);
  color: var(--cc-gold-dark);
  background: rgba(233, 159, 21, 0.12);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.event-item .round-label {
  font-family: var(--font-display);
  color: var(--cc-accent);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.event-item .event-link {
  font-family: var(--font-heading);
  color: var(--cc-ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.82rem;
  transition: color 0.18s ease;
}

/* Future (not-yet-happened) race items */
.event-item.event-future {
  opacity: 0.5;
  background: var(--cc-surface-alt);
  border-left-color: var(--cc-ink-muted);
  cursor: default;
}
.event-item.event-future:hover {
  border-left-color: var(--cc-ink-muted);
  box-shadow: none;
  transform: none;
}
.event-item.event-future .event-track {
  color: var(--cc-ink-muted);
}
.event-item.event-future .event-status {
  font-family: var(--font-heading);
  color: var(--cc-ink-muted);
  background: var(--cc-line);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.event-item.event-future .event-future-icon {
  font-size: 1.4rem;
  opacity: 0.7;
}

/* ====== TABS ====== */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--cc-line);
}
.tab {
  padding: 0.75rem 1.6rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  color: var(--cc-ink-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.tab:hover { color: var(--cc-ink); }
.tab.active {
  color: var(--cc-accent);
  border-bottom-color: var(--cc-accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ====== AWARDS GRID ====== */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}
.award-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 6px;
  padding: 1.05rem 1.3rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.award-card:hover {
  border-color: var(--cc-accent-soft);
  transform: translateY(-2px);
}
.award-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  background: var(--cc-accent-tint);
  border-radius: 0 0 0 44px;
}
.award-avatar-wrap {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--cc-accent-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.award-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.award-avatar-link {
  display: block;
  width: 100%;
  height: 100%;
}
.award-helmet {
  flex-shrink: 0;
}
.award-text {
  flex: 1;
  min-width: 0;
}
.award-card .label {
  font-family: var(--font-heading);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cc-ink-muted);
  margin-bottom: 0.4rem;
}
.award-card .value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--cc-ink);
  line-height: 1.15;
}
.award-card .detail {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--cc-accent);
  margin-top: 0.2rem;
  font-weight: 600;
}
/* Time values inside award details must inherit the accent orange like other
   detail values, instead of the default near-black .time ink used in tables. */
.award-card .detail .time,
.award-card .detail .time-na { color: var(--cc-accent); }

/* Awards grid on driver profile pages — count cards styled like the stat
   cards: big accent number + award name, with a gradient top accent bar. */
.driver-awards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.8rem;
  margin-bottom: 2.5rem;
}
.driver-award-card {
  position: relative;
  overflow: hidden;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 6px;
  padding: 1.15rem 1.1rem;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.driver-award-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cc-accent), var(--cc-gold));
}
.driver-award-card:hover {
  border-color: var(--cc-accent-soft);
  transform: translateY(-2px);
}
.driver-award-count {
  display: inline-flex;
  align-items: baseline;
  gap: 0.1rem;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: var(--cc-accent);
}
.driver-award-x {
  font-size: 1.1rem;
  color: var(--cc-gold);
}
.driver-award-name {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cc-ink);
  line-height: 1.2;
}

/* ====== DRIVER NAME ====== */
.driver-name {
  /* Jost (--font-body), não Russo One: o nome/sobrenome precisa de pesos
     distintos (300/500) e Russo One é de peso único — font-weight nela é
     ignorado pelo browser, que sempre desenha o 400 gordo da fonte. */
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--cc-ink);
  letter-spacing: 0.01em;
}

/* Driver avatar + name inline cell (used in tables). */
.driver-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.table-avatar,
.table-avatar-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.table-avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  color: var(--cc-bg);
  background: var(--cc-accent-soft);
  line-height: 1;
}

/* ====== POS CHANGE ====== */
.pos-change {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-body);
}
.pos-up { color: var(--green); }
.pos-up::before { content: '▲'; margin-right: 2px; }
.pos-down { color: var(--red); }
.pos-down::before { content: '▼'; margin-right: 2px; }
.pos-same { color: var(--cc-ink-muted); }

/* ====== TIME DISPLAY ====== */
.time { font-variant-numeric: tabular-nums; color: var(--cc-ink); font-weight: 600; }
.time-na { color: var(--cc-ink-muted); font-style: italic; }

/* ====== STATS BAR (championship header) ====== */
.stats-bar {
  display: flex;
  gap: 2.5rem;
  justify-content: center;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}
.stat-item { text-align: center; }
.stat-item .stat-val {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 400;
  color: var(--cc-accent);
  line-height: 1;
}
.stat-item .stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cc-ink-muted);
  margin-top: 0.3rem;
  font-weight: 500;
}

/* ====== CHAMPION BOX GROUP (multiclass: one box per class) ====== */
.champion-box-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.champion-box-group .champion-box {
  margin: 0;
  flex: 1 1 320px;
  max-width: 400px;
}
.champion-class-label {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fff;
  background: var(--cc-accent);
  border-radius: 999px;
  padding: 0.2rem 0.8rem;
  margin-bottom: 0.75rem;
}

/* ====== CHAMPION BOX (finished championships) ====== */
.champion-box {
  margin: 0 auto 2.5rem;
  max-width: 500px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 80, 32, 0.3);
  box-shadow:
    0 8px 32px -12px rgba(0, 0, 0, 0.5),
    inset 0 0 60px -20px rgba(255, 80, 32, 0.08);
  position: relative;
}
.champion-plasma-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.champion-box::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    rgba(255, 80, 32, 0.5),
    rgba(255, 80, 32, 0.15),
    rgba(255, 120, 60, 0.3),
    rgba(255, 80, 32, 0.05)
  );
  background-size: 300% 300%;
  z-index: -1;
  animation: championGlow 4s ease-in-out infinite alternate;
}
@keyframes championGlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}
.champion-box-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 2rem 2rem;
  position: relative;
  z-index: 1;
}
.champion-crown {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.2rem;
  animation: championBounce 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255, 80, 32, 0.5));
}
@keyframes championBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.champion-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--cc-accent);
  background: rgba(255, 80, 32, 0.1);
  border: 1px solid rgba(255, 80, 32, 0.25);
  padding: 0.35rem 1.2rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}
.champion-photo {
  width: 140px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--cc-accent);
  box-shadow:
    0 0 0 3px rgba(255, 80, 32, 0.2),
    0 0 40px -8px rgba(255, 80, 32, 0.3),
    inset 0 0 20px rgba(255, 80, 32, 0.03);
  margin-bottom: 1rem;
}
.champion-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin-bottom: 1.2rem;
}
.champion-firstname {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.65);
}
.champion-lastname {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  line-height: 1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4), 0 0 40px rgba(255, 80, 32, 0.08);
}
.champion-stats {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.champion-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.champion-stat-val {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--cc-accent);
  line-height: 1;
}
.champion-stat-val .time { color: inherit; font-weight: inherit; }
.champion-stat-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}
.champion-stat-divider {
  width: 1px;
  height: 2.2rem;
  background: rgba(255, 255, 255, 0.08);
}

/* ====== NEXT RACE CARD (active championships) ====== */
.next-race-card {
  margin: 0 auto 2.5rem;
  max-width: 480px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cc-accent-tint) 0%, #FFF5F0 50%, var(--cc-bg) 100%);
  border: 1px solid var(--cc-line);
  box-shadow: 0 8px 32px -14px rgba(255, 80, 32, 0.18);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.next-race-card:hover {
  box-shadow: 0 12px 40px -14px rgba(255, 80, 32, 0.28);
  transform: translateY(-2px);
}
.next-race-link {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
}
.next-race-badge {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-dark));
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  line-height: 1;
}
.next-race-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.next-race-round {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-ink-muted);
}
.next-race-date {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--cc-ink);
  line-height: 1.3;
}
.next-race-arrow {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--cc-accent);
  transition: transform 0.2s ease;
  line-height: 1;
}
.next-race-card:hover .next-race-arrow {
  transform: translateX(4px);
}

/* ====== RACE CARDS ROW (container for last + next race cards) ====== */
.race-cards-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: stretch;
  margin: 0 auto 2.5rem;
  flex-wrap: wrap;
}

/* ====== NEXT RACE CARD STATIC (non-clickable, shows upcoming race) ====== */
.next-race-card-static {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(23, 105, 170, 0.08) 0%, rgba(23, 105, 170, 0.04) 50%, var(--cc-bg) 100%);
  border: 1px solid var(--cc-line);
  box-shadow: 0 6px 24px -12px rgba(23, 105, 170, 0.12);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem 1.5rem;
}
.next-race-card-static .next-race-left {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.next-race-card-static .next-race-badge {
  background: linear-gradient(135deg, #1769AA, #145A8A);
}
.next-race-card-static .next-race-date {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-ink-muted);
}
.next-race-card-static .next-race-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.next-race-card-static .last-race-round {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-ink-muted);
}
.next-race-card-static .last-race-track {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--cc-ink);
  line-height: 1.3;
}

/* ====== LAST RACE CARD (clickable, links to last completed race) ====== */
.last-race-card {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cc-accent-tint) 0%, #FFF5F0 50%, var(--cc-bg) 100%);
  border: 1px solid var(--cc-line);
  box-shadow: 0 8px 32px -14px rgba(255, 80, 32, 0.18);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.last-race-card:hover {
  box-shadow: 0 12px 40px -14px rgba(255, 80, 32, 0.28);
  transform: translateY(-2px);
}
.last-race-link {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
}
.last-race-badge {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.6rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  background: linear-gradient(135deg, var(--cc-accent), var(--cc-accent-dark));
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  line-height: 1;
}
.last-race-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.last-race-round {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-ink-muted);
}
.last-race-track {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--cc-ink);
  line-height: 1.3;
}
.last-race-arrow {
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--cc-accent);
  transition: transform 0.2s ease;
  line-height: 1;
}
.last-race-card:hover .last-race-arrow {
  transform: translateX(4px);
}

/* ====== FORMAT BOX (championship rules) ====== */
.format-box {
  margin: 0 auto 2.5rem;
  max-width: 780px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px -16px rgba(33, 33, 33, 0.18);
}
.format-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--cc-ink);
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--cc-accent-tint) 0%, var(--cc-bg) 60%);
  border-bottom: 1px solid var(--cc-line);
  letter-spacing: 0.01em;
}
.format-title-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.format-body {
  display: flex;
  gap: 2rem;
  padding: 1.5rem 1.75rem;
}
.format-subtitle {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cc-ink-muted);
  margin-bottom: 0.75rem;
}

/* --- Points table --- */
.format-points { flex: 0 0 auto; }
.format-table {
  border-collapse: collapse;
  font-size: 0.85rem;
}
.format-table thead th {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cc-ink-muted);
  padding: 0.3rem 0.5rem 0.4rem;
  border-bottom: 1px solid var(--cc-line);
}
.format-table thead th:first-child { width: 32px; }
.format-table thead th:nth-child(2) { text-align: left; padding-left: 0.5rem; }
.format-table thead th:last-child {
  text-align: right;
  padding-right: 0.3rem;
}
.format-table tbody tr { transition: background 0.15s ease; }
.format-table tbody tr:hover { background: var(--cc-accent-tint); }
.format-pos-badge {
  padding: 0.2rem 0.25rem 0.2rem 0 !important;
}
.format-pos-badge .pos {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.format-pos-label {
  padding: 0.3rem 0.5rem !important;
  text-align: left !important;
  color: var(--cc-ink-soft);
  font-size: 0.82rem;
}
.format-pts-val {
  padding: 0.3rem 0.3rem 0.3rem 0.5rem !important;
  text-align: right !important;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--cc-accent);
}
.format-row-1 .format-pos-label { color: var(--cc-ink); font-weight: 500; }
.format-row-2 .format-pos-label { color: var(--cc-ink); }
.format-row-3 .format-pos-label { color: var(--cc-ink); }
.format-more {
  text-align: center !important;
  padding: 0.4rem 0.5rem !important;
  color: var(--cc-ink-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--cc-line-soft);
}

/* Pontuação por posição: linhas 11+ recolhidas; o rodapé "… mais N posições"
   é clicável e expande todas (script FORMAT_EXPAND_SCRIPT em pages.tsx). */
.format-table .format-row-extra { display: none; }
.format-table.format-expanded .format-row-extra { display: table-row; }
.format-more-toggle { cursor: pointer; user-select: none; }
.format-more-toggle:hover td { color: var(--cc-ink); }
.format-more-toggle td { transition: color 0.15s ease; }

/* --- Rules --- */
.format-rules {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  min-width: 0;
}
.format-rule {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--cc-surface-alt);
  border: 1px solid var(--cc-line-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.format-rule:hover {
  border-color: var(--cc-line);
  background: var(--cc-bg);
}
.format-rule-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1;
}
.format-rule-discard { background: rgba(181, 142, 69, 0.15); color: var(--cc-gold-dark); }
.format-rule-fl { background: rgba(255, 80, 32, 0.12); color: var(--cc-accent); }
.format-rule-pole { background: rgba(23, 106, 170, 0.12); color: #1769AA; }
.format-rule-ht { background: rgba(233, 159, 21, 0.15); color: var(--cc-gold-dark); }
.format-rule-gc { background: rgba(255, 80, 32, 0.12); color: var(--cc-accent); }
.format-rule-default { background: var(--cc-line-soft); color: var(--cc-ink-muted); }
.format-rule-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.format-rule-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-ink-muted);
}
.format-rule-desc {
  font-size: 0.88rem;
  color: var(--cc-ink-soft);
  line-height: 1.4;
}
.format-bonus {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--cc-accent);
  margin-right: 0.15rem;
}
.format-bonus-zero {
  color: var(--cc-ink-muted);
  font-size: 1rem;
}

/* ====== INCIDENTS ====== */
.incidents-high { color: var(--red); font-weight: 700; }
.incidents-low { color: var(--green); font-weight: 600; }
.incidents-mid { color: var(--cc-gold-dark); font-weight: 600; }

/* ====== RACE REPORT (article) ====== */
.article {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  padding: 2rem 2.3rem;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-left: 4px solid var(--cc-accent);
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--cc-ink-soft);
  box-shadow: 0 4px 18px -12px rgba(33, 33, 33, 0.15);
}
.article p { margin-bottom: 1.2rem; }
.article p:last-child { margin-bottom: 0; }
.article p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.2rem;
  color: var(--cc-accent);
  float: left;
  line-height: 0.8;
  margin: 0.25rem 0.6rem 0 0;
}

/* ====== DRIVER PROFILE PAGE ====== */
.driver-header {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.driver-photo {
  width: 180px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  border: 4px solid var(--cc-surface);
  box-shadow: 0 0 0 2px var(--cc-accent), 0 12px 30px -12px rgba(33, 33, 33, 0.45);
  margin-bottom: 0.4rem;
}
/* Nome em duas tonalidades inline (tabelas, pódios, gráficos): diferencia só
   por peso de fonte, herdando a cor (link ou texto) do contexto. */
.name-first {
  font-weight: 400;
}
.name-rest {
  font-weight: 500;
  letter-spacing: 0.02em;
}

.driver-firstname {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cc-ink-muted);
  display: block;
  margin-bottom: 0.2rem;
}
.driver-lastname {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cc-ink);
  display: block;
  line-height: 1;
}
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.05rem;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cc-ink);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.social-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.social-link:hover {
  border-color: var(--cc-accent);
  color: var(--cc-accent);
  background: rgba(255, 80, 32, 0.08);
  transform: translateY(-1px);
}
.champ-season {
  color: var(--cc-ink-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
}
.champ-class {
  color: var(--cc-ink-muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
}
.empty-row {
  text-align: center;
  color: var(--cc-ink-muted);
  font-style: italic;
  padding: 1.5rem !important;
}

/* ====== DRIVER RECENT RACES (profile page) ====== */
.recent-race-track {
  color: var(--cc-ink-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
}
.recent-race-date {
  color: var(--cc-ink-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ====== DRIVER STATS GRID (profile page) ====== */
.driver-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-bottom: 2.5rem;
}
.driver-stats .stat-card {
  flex: 0 1 auto;
  min-width: 130px;
  padding: 1rem 1.2rem;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 6px;
  text-align: center;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.driver-stats .stat-card:hover {
  border-color: var(--cc-accent-soft);
  transform: translateY(-2px);
}
.driver-stats .stat-card .stat-val {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--cc-accent);
  line-height: 1;
}
.driver-stats .stat-card .stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cc-ink-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}
.driver-stats .stat-card .stat-sub {
  font-family: var(--font-body);
  font-size: 0.72rem;
  color: var(--cc-ink-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}

/* ============================================================
   INSTITUTIONAL SITE (index.html / regulamento.html)
   Pure HTML/CSS — no client JavaScript.
   ============================================================ */

/* ---- Shared top navigation (root-level pages only) ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--cc-line);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.7rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--cc-ink);
}
.nav-brand img { height: 34px; width: auto; display: block; }
.nav-brand span {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.92rem;
}
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  color: var(--cc-ink-soft);
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-links a:hover { color: var(--cc-accent); border-bottom-color: var(--cc-accent); }

/* Dropdown de menu no top bar (montado pelo topbar.js a partir do CMS).
   Container relativo; o painel abre no :hover/:focus-within (desktop). */
.nav-dropdown {
  position: relative;
  display: inline-flex;
}
.nav-dropdown-toggle {
  font: inherit;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  color: var(--cc-ink-soft);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.3rem 0;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-dropdown-toggle:hover,
.nav-dropdown:focus-within .nav-dropdown-toggle {
  color: var(--cc-accent);
  border-bottom-color: var(--cc-accent);
}
.nav-dropdown-caret { font-size: 0.7rem; margin-left: 0.15rem; opacity: 0.7; }
.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin-top: 0.5rem;
  background: #fff;
  border: 1px solid var(--cc-line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  padding: 0.4rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  z-index: 60;
}
.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown:focus-within .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-panel a {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.78rem;
  color: var(--cc-ink-soft);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-bottom: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-dropdown-panel a:hover {
  color: var(--cc-accent);
  background: var(--cc-accent-tint, rgba(255, 80, 32, 0.06));
}

/* Hamburger toggle — hidden checkbox driving a pure-CSS dropdown, no JS needed. */
.nav-toggle-checkbox { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle-btn span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--cc-ink);
  border-radius: 2px;
}

/* ---- Hero ---- */
.hero {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: clamp(420px, 70vh, 660px);
  display: flex;
  align-items: center;
  color: #fff;
  background: #212121;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url('assets/hero-bg.jpg') center 60% / cover no-repeat;
  animation: hero-zoom 8s ease-in-out forwards;
}
@keyframes hero-zoom {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, rgba(33, 33, 33, 0.7) 0%, rgba(33, 33, 33, 0.45) 55%, rgba(212, 175, 55, 0.4) 100%);
}
.hero-content { position: relative; z-index: 2; width: 100%; }
.hero-slogan {
  font-family: var(--font-heading);
  color: var(--cc-accent);
  letter-spacing: 0.08em;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 1.2rem;
  max-width: 16ch;
}
.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.92);
  margin: 0 0 2rem;
}
.cta-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.cta-btn {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  padding: 0.85rem 1.6rem;
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.cta-btn:hover { border-color: #fff; background: rgba(255, 255, 255, 0.12); }
.cta-btn.primary { background: var(--cc-accent); border-color: var(--cc-accent); }
.cta-btn.primary:hover { background: var(--cc-accent-dark); border-color: var(--cc-accent-dark); transform: translateY(-2px); }

/* ---- Generic site sections ---- */
.site-section { position: relative; z-index: 1; padding: clamp(0.75rem, 1.5vw, 1rem) 2rem; }
.site-section.tinted { background: var(--cc-surface-alt); }
.eyebrow {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cc-accent);
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}
.section-heading {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  color: var(--cc-ink);
  margin: 0 0 1.6rem;
  letter-spacing: 0.01em;
}
.section-heading::after {
  content: '';
  display: block;
  width: 64px;
  height: 4px;
  margin-top: 0.8rem;
  background: linear-gradient(90deg, var(--cc-accent), var(--cc-gold));
  border-radius: 2px;
}
.champ-subsection {
  margin-bottom: 2.2rem;
}
.champ-subsection:last-of-type {
  margin-bottom: 1.6rem;
}
.section-subheading {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: var(--cc-ink-muted);
  margin: 0 0 1rem;
}

/* ---- About ---- */
.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  color: var(--cc-ink);
  margin: 0 0 1rem;
  line-height: 1.18;
}
.about-text { font-size: 1.1rem; color: var(--cc-ink-soft); max-width: 60ch; margin: 0; }

.see-all {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cc-accent);
  text-decoration: none;
  font-size: 0.88rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.18s ease;
}
.see-all:hover { border-bottom-color: var(--cc-accent); }

/* ---- Testimonials ---- */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
}
.testimonial-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 10px;
  padding: 2rem 1.6rem 1.6rem;
  margin: 0;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(33, 33, 33, 0.1);
  border-color: var(--cc-accent-soft);
}
.testimonial-card img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.2rem;
  display: block;
  border: 3px solid var(--cc-accent-soft);
}
.testimonial-card blockquote {
  margin: 0 0 1rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--cc-ink-soft);
  font-style: italic;
}
.testimonial-card figcaption {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.88rem;
  color: var(--cc-ink);
}
.testimonial-card.visible {
  animation: testimonial-fade-in 0.5s ease both;
}
@keyframes testimonial-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.testimonial-avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--cc-bg);
  background: var(--cc-accent-soft);
  border: 3px solid var(--cc-accent-soft);
}

/* ---- Driver Page Quote ---- */
.driver-quote {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--cc-ink-muted);
  font-style: italic;
  margin: 0.35rem auto 0;
  max-width: 520px;
}
.driver-quote::before {
  content: '\u201C';
}
.driver-quote::after {
  content: '\u201D';
}

/* ====== ÚLTIMAS NOTÍCIAS (News / Blog Section) ====== */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.news-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.news-card:hover {
  border-color: var(--cc-accent-soft);
  box-shadow: 0 8px 28px -14px rgba(255, 80, 32, 0.14);
}
.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.news-champ {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-accent);
}
.news-date {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--cc-ink-muted);
  font-weight: 500;
  white-space: nowrap;
}
.news-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.85rem;
  line-height: 1.2;
}
.news-title a {
  color: var(--cc-ink);
  text-decoration: none;
  transition: color 0.18s ease;
}
.news-title a:hover {
  color: var(--cc-accent);
}
.news-preview {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--cc-ink-soft);
}
.news-preview p { margin-bottom: 0.6rem; }
.news-preview p:last-child { margin-bottom: 0; }
.news-full {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--cc-ink-soft);
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--cc-line);
}
.news-full p { margin-bottom: 0.9rem; }
.news-full p:last-child { margin-bottom: 0; }
.news-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
}
.news-btn {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--cc-accent);
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.15s ease;
  line-height: 1;
}
.news-btn:hover {
  background: var(--cc-accent-dark);
  transform: translateY(-1px);
}
.news-btn:active {
  transform: translateY(0);
}
.news-race-link {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cc-ink-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}
.news-race-link:hover {
  color: var(--cc-accent);
}

/* ---- Artigos (standalone article pages) ---- */
.article-head {
  background: linear-gradient(180deg, var(--cc-accent-tint), var(--cc-bg));
  padding-bottom: 1.6rem;
}
.article-head .page-title { margin-bottom: 0.4rem; }
.article-meta {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cc-ink-muted);
}
.article-meta time { color: var(--cc-accent); }
.article-body {
  max-width: 76ch;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--cc-ink-soft);
}
.article-body h1, .article-body h2, .article-body h3, .article-body h4 {
  font-family: var(--font-display);
  text-transform: none;
  color: var(--cc-ink);
  line-height: 1.22;
  margin: 2rem 0 0.7rem;
}
.article-body h1 { font-size: 1.9rem; }
.article-body h2 { font-size: 1.5rem; }
.article-body h3 { font-size: 1.2rem; }
.article-body h4 { font-size: 1.02rem; }
.article-body p { margin: 0 0 1.05rem; }
.article-body a { color: var(--cc-accent); text-decoration: none; border-bottom: 1px solid var(--cc-accent-soft); }
.article-body a:hover { border-bottom-color: var(--cc-accent); }
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.6rem auto;
  border-radius: 10px;
  border: 1px solid var(--cc-line);
}
.article-body figure.article-figure {
  margin: 1.8rem 0;
  text-align: center;
}
.article-body figure.article-figure img {
  margin: 0 auto 0.6rem;
}
.article-body figure.article-figure figcaption {
  font-size: 0.82rem;
  color: var(--cc-ink-muted);
  font-style: italic;
}
.article-body blockquote {
  margin: 1.4rem 0;
  padding: 0.4rem 0 0.4rem 1.2rem;
  border-left: 3px solid var(--cc-accent);
  color: var(--cc-ink-muted);
  font-style: italic;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body ul, .article-body ol { margin: 0 0 1.05rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.35rem; }
.article-body code {
  font-size: 0.88em;
  background: var(--cc-accent-tint);
  padding: 0.12em 0.4em;
  border-radius: 4px;
}
.article-body pre {
  background: var(--cc-ink);
  color: #f2f2f2;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 1.05rem;
}
.article-body pre code { background: none; padding: 0; color: inherit; font-size: 0.88rem; }
.article-body hr { border: none; border-top: 1px solid var(--cc-line); margin: 2.2rem 0; }
.article-body table { border-collapse: collapse; width: 100%; margin: 0 0 1.05rem; font-size: 0.95rem; }
.article-body th, .article-body td { border: 1px solid var(--cc-line); padding: 0.5rem 0.75rem; text-align: left; }
.article-body th { font-family: var(--font-heading); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.05em; background: var(--cc-accent-tint); }

/* ---- Sponsors ---- */
.champ-sponsors {
  margin-bottom: 2.5rem;
}
.sponsors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3rem 4rem;
}
.sponsor-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 144px;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.sponsor-logo img { max-height: 144px; max-width: 400px; width: auto; height: auto; object-fit: contain; }
.sponsor-logo:hover { opacity: 1; transform: translateY(-3px); }

/* ---- Footer ---- */
.site-footer {
  position: relative;
  z-index: 1;
  background: var(--cc-ink);
  color: #fff;
  padding: 2.4rem 2rem;
}
.footer-slogan {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-accent);
  font-size: 1rem;
}
.footer-meta { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; margin-top: 0.4rem; }

/* ---- Regulamento (Manual do Piloto) ---- */
.manual-head { background: linear-gradient(180deg, var(--cc-accent-tint), var(--cc-bg)); }
.page-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--cc-ink);
  margin: 0 0 0.6rem;
}
.page-lead { font-size: 1.1rem; color: var(--cc-ink-soft); max-width: 65ch; margin: 0 0 2rem; }

/* Corpo de Página vinda do CMS (pages.html/client-side) — genérico, igual
   para todas as páginas (não tem estilo específico de regulamento). */
.page-body { max-width: 780px; }
.page-body p { font-size: 1rem; line-height: 1.7; color: var(--cc-ink-soft); margin: 0 0 0.9rem; }
.page-body h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.45rem;
  color: var(--cc-ink);
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--cc-accent);
  display: inline-block;
}
.page-body h3, .page-body h4 { color: var(--cc-ink); margin: 1.6rem 0 0.6rem; }
.page-body ul, .page-body ol { color: var(--cc-ink-soft); margin: 0 0 0.9rem; padding-left: 1.4rem; }
.page-body li { margin-bottom: 0.35rem; }
.page-body a { color: var(--cc-accent); text-decoration: underline; }
.page-body blockquote {
  border-left: 3px solid var(--cc-accent);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 0 0 1rem;
  color: var(--cc-ink-soft);
  font-style: italic;
}

.penalty-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.penalty-card {
  border-radius: 10px;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--cc-line);
  background: var(--cc-surface);
  border-left: 5px solid var(--cc-accent-soft);
}
.penalty-card.tier-soft { border-left-color: var(--cc-accent-soft); }
.penalty-card.tier-accent { border-left-color: var(--cc-accent); }
.penalty-card.tier-gold { border-left-color: var(--cc-gold); }
.penalty-card.tier-danger { border-left-color: var(--red); }
.penalty-tier {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.92rem;
  color: var(--cc-ink);
}
.penalty-points { font-family: var(--font-display); font-size: 1.5rem; color: var(--cc-accent); margin: 0.2rem 0 0.5rem; }
.penalty-desc { font-size: 0.88rem; color: var(--cc-ink-muted); line-height: 1.45; }

.manual { max-width: 780px; }
.manual-h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 1.45rem;
  color: var(--cc-ink);
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--cc-accent);
  display: inline-block;
}
.manual-p { font-size: 1rem; line-height: 1.7; color: var(--cc-ink-soft); margin: 0 0 0.9rem; }

/* ====== MOBILE / RESPONSIVE OVERRIDES ====== */

/* Hard overflow prevention — must be outside media queries */
body { overflow-x: hidden; }
html { overflow-x: hidden; }
.site-nav { max-width: 100%; }
.nav-inner { max-width: 100%; min-width: 0; }
.hero { max-width: 100%; overflow: hidden; }
.site-section { max-width: 100%; }
.site-footer { max-width: 100%; }
.container { width: 100%; }

/* Navbar collapses into a hamburger dropdown once the links no longer fit */
@media (max-width: 860px) {
  .nav-inner { position: relative; }
  .nav-toggle-btn { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--cc-line);
    padding: 1rem 1.5rem;
    display: none;
  }
  .nav-toggle-checkbox:checked ~ .nav-links { display: flex; }
  .nav-links a { font-size: 0.85rem; }
  /* Dropdown de menu no mobile: dentro do painel expandido do hamburger,
     mostra os itens sempre (sem hover) — o painel vira estático */
  .nav-dropdown { display: block; width: 100%; }
  .nav-dropdown-toggle { font-size: 0.85rem; }
  .nav-dropdown-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    min-width: 0;
    margin-top: 0.25rem;
    padding: 0.2rem 0 0.2rem 1rem;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--cc-line);
    border-radius: 0;
  }
}

/* Tablet and below */
@media (max-width: 768px) {
  .container {
    padding: 2rem 1rem 3rem;
  }
  .nav-inner {
    padding: 0.55rem 1rem;
  }
}

/* Mobile — this is where the real fixes kick in */
@media (max-width: 560px) {
  /* --- Top Navigation: compact --- */
  .nav-inner {
    padding: 0.45rem 0.7rem;
    gap: 0.4rem;
    min-width: 0;
    max-width: 100%;
  }
  .nav-brand {
    gap: 0.35rem;
    min-width: 0;
    flex-shrink: 0;
  }
  .nav-brand img { height: 26px; }
  /* Hide brand text to save space — logo alone is enough */
  .nav-brand span { display: none; }

  /* --- Containers / sections: tight padding --- */
  .container {
    padding: 1.5rem 0.85rem 2.5rem;
    max-width: 100%;
  }
  .site-section {
    padding: 0.65rem 0.85rem;
  }

  /* --- Hero: prevent overflow, tighten content --- */
  .hero {
    max-width: 100%;
    overflow: hidden;
  }
  .hero .container {
    padding: 1.5rem 0.85rem;
    max-width: 100%;
  }
  .hero-title {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
    max-width: 100%;
    overflow-wrap: break-word;
  }
  .hero-desc {
    font-size: 0.95rem;
    max-width: 100%;
  }
  .hero-content { padding: 0; width: 100%; }

  /* --- About --- */
  .about-lead { font-size: 1.3rem; }
  .about-text { font-size: 1rem; }

  /* --- Cards grid (championships): single column --- */
  .cards {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .card { padding: 1.3rem; }
  .card h2 { font-size: 1.2rem; }
  .card .meta { gap: 1.2rem; }

  /* --- News cards --- */
  .news-card { padding: 1.1rem; }
  .news-title { font-size: 1.05rem; }
  .news-actions { flex-wrap: wrap; gap: 0.7rem; }

  /* --- Event items (championship subpages) --- */
  .event-item {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }
  .event-item .event-info { gap: 0.5rem; }
}

/* Very small phones (≤380px) */
@media (max-width: 380px) {
  .container { padding: 1.2rem 0.65rem 2rem; }
  .site-section { padding: 0.5rem 0.65rem; }
  .card { padding: 1rem; }
  .news-card { padding: 0.85rem; }
}

/* ====== Members page ====== */
.member-count {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--cc-ink-muted);
  margin-bottom: 1.5rem;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.member-card {
  display: flex;
  flex-direction: column;
  height: 310px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.15s;
}

.member-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.mc-band {
  flex: 0 0 118px;
  position: relative;
}

.mc-number {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 42px; /* leaves out the part of the band the avatar overlaps */
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

.mc-avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  margin: -42px auto 0;
  border-radius: 50%;
  border: 4px solid var(--cc-accent);
  background: var(--cc-surface);
  overflow: hidden;
  z-index: 1;
}

.mc-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Fallback/CSV illustration avatars are tall, non-square art — cropping from
   the vertical center cuts into the helmet/head. Anchor the crop to the top
   instead so the full circle stays filled but frames the head, not the chest. */
.mc-avatar-illustration {
  object-position: center 35%;
}

.mc-initial {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--cc-accent);
  background: var(--cc-accent-tint);
}

.mc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.6rem 1rem 0.85rem;
  min-width: 0;
}

.mc-name {
  text-align: center;
  min-width: 0;
}

.mc-first {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--cc-ink-muted);
  letter-spacing: 0.03em;
}

.mc-last {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--cc-ink);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-chevron {
  height: 2px;
  margin: 0.6rem 1.2rem 0;
  background: var(--cc-line);
  transform: skewY(-3deg);
}

.mc-footer {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 0.6rem;
}

.mc-trophies {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.02rem;
}

.mc-trophy {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
}

.mc-trophy::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.mc-trophy:hover::after {
  opacity: 1;
}

.mc-trophy.trophy-gold { color: #d4af37; }
.mc-trophy.trophy-silver { color: #a8a8a8; }
.mc-trophy.trophy-bronze { color: #b06a34; }

.mc-years {
  background: var(--cc-accent-tint);
  color: var(--cc-accent-dark);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
}

.mc-races {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--cc-ink-muted);
  white-space: nowrap;
}

.mc-tt {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.7rem;
  color: var(--cc-ink-muted);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .member-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .member-grid {
    grid-template-columns: 1fr;
  }
}

/* Race cards stack on mobile */
@media (max-width: 768px) {
  .race-cards-row {
    flex-direction: column;
  }
  .last-race-card,
  .next-race-card-static {
    max-width: 480px;
  }
}


/* ===== Registration (inscrição) page & hub ===== */
.reg-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.5rem 0 0;
}
.reg-section {
  display: block;
  margin-top: 2.25rem;
}
.reg-prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}
.reg-price-card {
  background: var(--cc-surface-alt);
  border: 1px solid var(--cc-line);
  border-left: 4px solid var(--cc-accent);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}
.reg-price-amount {
  font-family: var(--font-display), sans-serif;
  font-size: 1.6rem;
  color: var(--cc-ink);
  line-height: 1.1;
}
.reg-price-label {
  margin-top: 0.3rem;
  color: var(--cc-ink-soft);
  font-size: 0.95rem;
}
.reg-bundle-card {
  display: block;
  text-decoration: none;
  border-left-color: var(--cc-gold, var(--cc-accent));
  transition: transform 0.15s ease;
}
.reg-bundle-card:hover {
  transform: translateY(-2px);
}
.reg-bundle-includes {
  margin-top: 0.5rem;
  color: var(--cc-ink-muted);
  font-size: 0.85rem;
}
.reg-fact {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 1px solid var(--cc-line-soft);
  padding: 0.6rem 0.2rem;
}
.reg-fact-label {
  flex: 0 0 90px;
  font-family: var(--font-heading), sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cc-ink-muted);
}
.reg-fact-value {
  font-weight: 600;
}
.reg-stages {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.reg-stage {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--cc-surface-alt);
  border: 1px solid var(--cc-line);
  border-radius: 10px;
  padding: 0.7rem 1rem;
}
.reg-stage-num {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cc-ink);
  color: #fff;
  font-family: var(--font-heading), sans-serif;
  font-size: 0.85rem;
}
.reg-stage-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.reg-stage-track {
  font-weight: 600;
}
.reg-stage-date {
  color: var(--cc-ink-muted);
  font-size: 0.9rem;
}
.reg-body .markdown-body,
.reg-body > div {
  line-height: 1.65;
  color: var(--cc-ink-soft);
}
.reg-body .markdown-body h1,
.reg-body .markdown-body h2,
.reg-body .markdown-body h3,
.reg-body .markdown-body h4 {
  font-family: var(--font-heading), sans-serif;
  color: var(--cc-ink);
  margin: 1.2rem 0 0.5rem;
}
.reg-body .markdown-body h2 { font-size: 1.35rem; }
.reg-body .markdown-body h3 { font-size: 1.15rem; }
.reg-body .markdown-body p { margin: 0.6rem 0; }
.reg-body .markdown-body a { color: var(--cc-accent); font-weight: 600; }
.reg-body .markdown-body ul,
.reg-body .markdown-body ol { padding-left: 1.3rem; margin: 0.5rem 0; }
.reg-body .markdown-body li { margin: 0.25rem 0; }
.reg-body .markdown-body code { background: var(--cc-surface-alt); padding: 0.1rem 0.35rem; border-radius: 4px; }
.reg-body .markdown-body pre { background: var(--cc-surface-alt); padding: 0.9rem; border-radius: 8px; overflow-x: auto; }
.reg-body .markdown-body blockquote { border-left: 3px solid var(--cc-accent); padding-left: 1rem; color: var(--cc-ink-muted); }
.reg-disclaimer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cc-line);
  color: var(--cc-ink-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ─── Artigos do site (carregados do CMS em runtime) ─────────────────────── */
.news-cover {
  margin: -1.5rem -1.75rem 1.1rem;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: var(--cc-surface-alt);
}
.news-cover img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  display: block;
}
.article-cover {
  margin-bottom: 1.5rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--cc-line);
}
.article-cover img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.article-back {
  margin: 1.5rem 0 2.5rem;
}
.article-back a {
  color: var(--cc-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--cc-accent-soft);
}
.article-back a:hover { border-bottom-color: var(--cc-accent); }

/* ====== Tracks page ====== */
.track-card {
  display: flex;
  flex-direction: column;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.15s;
}

.track-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.track-card-body {
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.track-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cc-ink);
}

.track-card-place {
  font-size: 0.8rem;
  color: var(--cc-ink-muted);
}

.track-card-meta {
  display: flex;
  gap: 0.9rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--cc-accent);
}

.track-photo {
  max-width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 1rem;
}
