/* Race Engineering : une grille de lecture, une seule couleur d'accent. */
:root {
  --font-display: Inter, system-ui, sans-serif;
  --text-muted: #625c54;
  --focus: #b14b00;
}
.dark-mode {
  --bg-primary: #0b0d10; --bg-secondary: #12161a; --bg-card: #12161a;
  --text-primary: #f3f1ed; --text-secondary: #c3c9cf; --text-muted: #aab1b9;
  --border: #303841; --border-light: #252d35; --focus: #f4d06f;
}
.container, .hero .container { max-width: 1280px; padding-inline: 32px; }
.site-header { border-top: 4px solid var(--red); }
.nav-inner { height: 80px; gap: 28px; }
.logo { font-size: 1.7rem; letter-spacing: -.065em; flex-shrink: 0; }
.logo-stop { margin-left: 2px; }
.nav-links { gap: 0; margin-left: auto; }
.nav-links a { font-size: .79rem; padding: 28px 10px; }
.nav-actions { gap: 12px; flex-shrink: 0; }
.btn-auth { min-height: 40px; font-size: .78rem; padding: 8px 14px; letter-spacing: 0; }
.nav-more-btn { font-size: .79rem; }
.hero { background: var(--bg-primary); }
.hero-grid { grid-template-columns: 1.05fr 1fr; border-top: 1px solid var(--border); }
.hero-main { grid-column: 1; grid-row: 1; padding: 48px 32px 48px 0; background: var(--bg-primary); color: var(--text-primary); justify-content: center; }
.hero-main h1 { color: inherit; font-size: clamp(2.4rem, 4.4vw, 4.25rem); line-height: 1.04; max-width: 13ch; letter-spacing: -.055em; margin: 20px 0 24px; }
.hero-main p { color: var(--text-secondary); font-size: 1rem; line-height: 1.65; max-width: 46ch; }
.hero-badge { font-size: .69rem; letter-spacing: .17em; }
.hero-actions { margin-top: 28px; gap: 24px; align-items: center; }
.hero-actions a { font-size: .84rem; letter-spacing: 0; text-transform: none; }
.hero-actions a:first-child { background: var(--red); padding: 13px 18px; color: #fff; }
.hero-stage { grid-column: 2; grid-row: 1; min-height: 490px; border: 0; border-left: 1px solid var(--border); background: #10151a; }
.stage-note { color: #aab1b9; font-size: .6rem; letter-spacing: .09em; top: 24px; left: 24px; text-transform: none; }
.hero-art { margin: 0; display: flex; flex-direction: column; justify-content: center; background: #151c24; }
.hero-art .stage-poster { position: static; display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: contain; transform: none; opacity: 1; }
.hero-art .stage-note { position: static; margin: 0; padding: 18px 22px; color: #b8c3cf; font-size: .65rem; letter-spacing: .015em; line-height: 1.6; }
/* Provenance des données : une ligne de métadonnées, pas un bandeau.
   La pastille porte l'état ; le texte reste lisible sans couleur. */
.f1-status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin-block: 14px 0; border: 0; font-size: .74rem; line-height: 1.5; color: var(--text-muted); text-align: left; }
.f1-status .ds-ok, .f1-status .ds-stale { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-secondary); }
.f1-status .ds-ok::before, .f1-status .ds-stale::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3fb878; flex: none; }
.f1-status .ds-stale::before { background: #e0a43a; }
.f1-status[data-state="unavailable"] .ds-stale::before { background: var(--red); }
.f1-status a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.f1-status .ds-retry { min-height: 32px; padding: 4px 0; border: 0; background: none; color: var(--text-secondary); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.f1-status .ds-retry:disabled { opacity: .55; cursor: default; text-decoration: none; }
@media (pointer: coarse) { .f1-status .ds-retry { min-height: 44px; } }
/* En-tête de page : titre, chapô, puis provenance — dans cet ordre de lecture. */
.page-hero .container { display: flex; flex-direction: column; align-items: flex-start; }
.page-hero .f1-status { order: 2; }
.sport-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 28px; }
.sport-picker select, .sport-picker button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--border); background: var(--bg-secondary); color: var(--text-primary); font: inherit; }
.sport-picker label { font-size: .85rem; color: var(--text-secondary); }
#licensedVehicle { position: absolute; inset: 0 0 172px; }
#licensedVehicle canvas { display: block; width: 100%; height: 100%; }
.hero-art.is-live .stage-poster { opacity: 0; }
.vehicle-actions { padding: 0 22px 18px; }
.vehicle-actions button { min-height: 44px; border: 1px solid #4a5968; color: #e2e8ef; background: #1b2631; padding: 10px 13px; font: 500 .72rem var(--font-body); cursor: pointer; }
.vehicle-actions button:disabled { opacity: .65; cursor: wait; }
.vehicle-actions button[aria-pressed="true"] { border-color: #ffb4b4; color: #ffb4b4; }
.vehicle-views { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-top: 10px; }
.vehicle-actions [hidden], .hero-art [hidden] { display: none; }
.vehicle-actions p { color: #b8c3cf; font-size: .75rem; margin: 10px 0 0; }
.vehicle-actions p:empty { display: none; }
.hero-art .stage-note a { color: #d2dce7; text-decoration: underline; text-underline-offset: 3px; }
.hero-side { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(3, 1fr); background: var(--bg-primary); }
.hero-card { padding: 22px 24px; min-height: 125px; border-right: 1px solid var(--border); }
.hero-card:first-child { padding-left: 0; }
.hero-card:last-child { border-right: 0; }
.hero-card-tag { font-size: .62rem; letter-spacing: .13em; }
.hero-card h2 { color: var(--text-primary); font-size: 1.12rem; line-height: 1.35; max-width: 26ch; margin-top: 10px; }
.stats-bar { background: var(--bg-primary); border-block: 0 1px solid var(--border); padding: 24px 0; }
.stats-grid { gap: 0; }
.stat-item { align-items: flex-start; padding: 0 24px; min-width: 0; }
.stat-item:first-child { padding-left: 0; }
.stats-grid .stat-value { font-size: 1rem; line-height: 1.35; margin-block: 6px; overflow-wrap: anywhere; color: var(--text-primary); }
.stat-label { font-size: .65rem; letter-spacing: .08em; }
.stat-sub { font-size: .73rem; }
.season-progress { margin-top: 20px; }
.section { padding-block: 40px; }
.section-header { margin-bottom: 20px; align-items: baseline; gap: 16px; }
.section-header h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: -.04em; }
.home-desk { grid-template-columns: 1fr; }
.standings-preview { grid-template-columns: 1fr 1fr; gap: 32px; }
.see-all { font-size: .73rem; text-transform: none; letter-spacing: 0; }
.standings-table { font-size: .86rem; }
.standings-table th { font-size: .62rem; }
.community-invite { display: flex; align-items: center; justify-content: space-between; gap: 32px; border-block: 1px solid var(--border); padding-block: 28px; margin-top: 32px; }
.community-invite h2 { font-size: 1.6rem; letter-spacing: -.035em; }
.community-invite p { color: var(--text-muted); font-size: .9rem; margin-top: 6px; }
.wire-block { border-top: 1px solid var(--border); }
.wire-block > p, .wire-block .container > p { max-width: 66ch; color: var(--text-muted); font-size: .86rem; margin-bottom: 24px; }
.wire-unavailable { padding: 20px 0; font-size: .88rem; color: var(--text-secondary); border-block: 1px solid var(--border); }
.page-hero { background: var(--bg-primary); padding-block: 48px 32px; color: var(--text-primary); border-bottom: 1px solid var(--border); }
.page-hero h1 { color: inherit; font-size: clamp(2.6rem, 5vw, 4.4rem); letter-spacing: -.055em; line-height: 1.05; }
.page-hero p { color: var(--text-secondary); max-width: 60ch; margin-top: 16px; font-size: 1rem; }
.news-desk { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; margin-block: 40px 48px; }
.news-feature { border-bottom: 1px solid var(--border); padding-bottom: 32px; }
.news-feature h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.12; max-width: 22ch; letter-spacing: -.04em; margin: 16px 0; }
.news-feature p { max-width: 58ch; color: var(--text-secondary); font-size: 1rem; margin-bottom: 24px; }
.news-feature .diagram-thumb { background: #10151a; height: 230px; width: 100%; object-fit: cover; margin-bottom: 28px; border: 1px solid var(--border); }
.news-reading { display: grid; align-content: start; }
.news-reading a { padding-block: 24px; border-bottom: 1px solid var(--border); }
.news-reading strong { display: block; font-size: 1.1rem; margin-block: 8px; }
.news-reading span { color: var(--text-muted); font-size: .83rem; }
.published-news { margin-bottom: 48px; }
.news-search { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.news-search label { display: grid; gap: 8px; font-size: .78rem; color: var(--text-secondary); }
.news-search input, .news-search select { min-height: 44px; padding: 10px 12px; color: var(--text-primary); background: var(--bg-card); border: 1px solid var(--border); max-width: 100%; }
.news-search button { min-height: 44px; }
.published-list { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.published-story { border-top: 1px solid var(--border); padding: 24px 0; }
.published-story h3 { font-size: 1.5rem; line-height: 1.2; margin: 12px 0; }
.published-story > p:not(.edition-kicker) { color: var(--text-secondary); font-size: .92rem; }
.published-story time { display: block; margin-top: 16px; font-size: .75rem; color: var(--text-muted); }
.news-pagination { display: flex; justify-content: space-between; gap: 20px; padding-block: 24px; }
.page-technique .tech-grid { grid-template-columns: 1fr; max-width: 760px; margin: 40px auto; }
.page-technique .tech-card { padding: 28px 0; border: 0; border-bottom: 1px solid var(--border); background: none; }
.page-technique .tech-card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); max-width: 30ch; margin: 12px 0 20px; letter-spacing: -.035em; }
.page-technique .tech-card p { font-size: 1rem; line-height: 1.8; max-width: 70ch; margin-block: 14px; }
.page-technique .tech-tag { font-size: .65rem; letter-spacing: .12em; }
.article-meta { font-size: .72rem; }
.page-article .container { max-width: 800px; }
.page-article h1 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -.05em; }
.site-footer { border-top: 1px solid var(--border); padding-top: 40px; }
.footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.site-footer .footer-col ul a, .site-footer .footer-col p, .site-footer .footer-bottom p { color: var(--text-secondary); }
.site-footer .footer-col h2 { color: var(--text-muted); }
.footer-col h2 { font-size: .65rem; letter-spacing: .13em; }
.footer-col a, .footer-col p { font-size: .8rem; }
/* Bannière cookies : message à gauche, deux choix de même poids à droite
   (refuser aussi simple qu'accepter), liens secondaires sous le message. */
.cookie-banner { max-height: 42vh; padding: 16px 32px; }
.cookie-inner { max-width: 1216px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; }
.cookie-inner > p:first-child { flex: 1 1 480px; font-size: .82rem; line-height: 1.55; max-width: 75ch; margin: 0; color: var(--text-secondary); }
.cookie-actions { order: 2; display: flex; gap: 8px; margin: 0; flex: none; }
.cookie-choice { width: auto; min-width: 128px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 2px; background: var(--bg-secondary); color: var(--text-primary); font: 600 .78rem var(--font-body); }
.cookie-choice:hover { border-color: var(--text-muted); }
.cookie-customise, .cookie-links { order: 3; display: inline-flex; align-items: center; min-height: 32px; margin: 0; padding: 0; font-size: .74rem; text-align: left; }
.cookie-links { order: 4; }
.cookie-links a { color: var(--text-muted); }
.cookie-custom { order: 5; flex-basis: 100%; }
.notification:not(.active) { visibility: hidden; }
/* Calendrier : une liste de saison continue, lisible d'un coup d'œil.
   Passé = numéro de manche estompé seulement (le texte garde son contraste),
   prochain GP = filet rouge + libellé, futur = neutre. */
.calendar-grid { gap: 0; padding: 0 0 48px; }
.lastgp-note { margin: 12px 0 0; font-size: .8rem; line-height: 1.5; color: var(--text-muted); }
.lastgp-fallback { display: inline-block; margin-bottom: 8px; padding: 3px 8px; border: 1px solid #e0a43a; color: var(--text-primary); font-size: .72rem; font-weight: 600; }
/* Thème clair : le rose #ffb4b4 n'existe que pour le fond sombre (contraste 1,4:1
   sur le beige). Encre rouge foncée en clair, rose conservé en sombre. */
:root { --red-ink: #a80500; }
.dark-mode { --red-ink: #ffb4b4; }
.hero-badge, .hero .read-more, .hero-card-tag, .stats-bar .countdown-mini { color: var(--red-ink); }
.hero-main .source, .hero-main .date, .stats-bar .stat-label, .stats-bar .stat-sub { color: var(--text-muted); }
/* Pied de page toujours sombre : ses jetons de texte le sont aussi, quel que soit le thème. */
.site-footer { --text-primary: #f3f1ed; --text-secondary: #c3c9cf; --text-muted: #9aa2ab; --border: #303841; background: #0c0c0e; color: var(--text-secondary); }
.site-footer .logo-grid { color: var(--text-primary); }
/* Médailles lisibles sur fond clair ; textes rouges du prochain GP en encre adaptée au thème. */
body:not(.dark-mode) .pos-1 { color: #7a5c00; }
body:not(.dark-mode) .pos-2 { color: #5b6066; }
body:not(.dark-mode) .pos-3 { color: #8a4b14; }
.lastgp-pos.p3 .lastgp-medal { color: #1d1206; }
.calendar-next-label, .calendar-item.next .calendar-date, .calendar-item.next .calendar-countdown { color: var(--red-ink); }
/* Tableaux de classement : position étroite, chiffres alignés à droite en fin de ligne. */
.standings-table, .results-table { table-layout: auto; width: 100%; }
.standings-table th:first-child, .standings-table td:first-child,
.results-table th:first-child, .results-table td:first-child { width: 56px; text-align: left; }
.standings-table th:last-child, .standings-table td:last-child,
.results-table th:last-child, .results-table td:last-child,
.td-pts { text-align: right; padding-right: 16px; }
.standings-table td:last-child, .results-table td:last-child { font-weight: 700; }
@media (min-width: 901px) {
  .home-desk .standings-preview { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; }
}
/* Visuel presse absent ou bloqué : aplat sombre signé du nom de la source. */
.news-card-image[data-img-missing] { position: relative; display: flex; align-items: flex-end; }
.news-card-image[data-img-missing], .news-brief-img[data-img-missing] { background: linear-gradient(135deg, #171c22 0%, #10141a 100%); border-left: 3px solid var(--red); }
.news-card-image[data-img-missing]::after, .news-card.live .news-card-image[data-img-missing]::after { content: attr(data-src-name); display: block; position: static; inset: auto; width: auto; height: auto; background: none; padding: 14px 16px; color: #c3c9cf; font: 700 .85rem/1.2 var(--font-body); letter-spacing: -.01em; }
.news-lead .news-card-image[data-img-missing]::after { font-size: 1.15rem; padding: 20px 24px; }
.news-brief-img[data-img-missing]::after { display: none; }
.calendar-item { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px 24px; padding: 18px 20px 18px 16px; border: 0; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; border-radius: 0; background: transparent; color: var(--text-primary); text-decoration: none; transition: background-color .15s; }
.calendar-item:hover { transform: none; background: var(--bg-secondary); border-color: var(--border); border-left-color: var(--text-muted); }
.calendar-item.past, .calendar-item.has-results { opacity: 1; }
.calendar-item.past .calendar-round { color: var(--text-muted); opacity: .6; }
.calendar-item.next { outline: 0; border-left-color: var(--red); background: color-mix(in srgb, var(--red) 7%, transparent); }
.calendar-item.next:hover { border-left-color: var(--red); }
.calendar-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.calendar-round { font-size: 1.35rem; text-align: left; }
.calendar-next-label { display: block; margin-bottom: 4px; color: var(--red-ink); font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.calendar-info h2 { font-size: 1.02rem; line-height: 1.3; }
.calendar-winner { margin-top: 6px; font-size: .82rem; color: var(--text-primary); font-weight: 600; }
.calendar-winner span { color: var(--text-muted); font-weight: 500; margin-right: 4px; }
.calendar-date { font-size: .92rem; color: var(--text-secondary); white-space: nowrap; }
.calendar-resultlink { margin-top: 4px; font-family: var(--font-body); font-size: .76rem; letter-spacing: 0; text-transform: none; color: var(--text-secondary); text-decoration: underline; text-underline-offset: 3px; }
.calendar-item:hover .calendar-resultlink { color: var(--text-primary); }
@media (max-width: 600px) {
  .calendar-item { grid-template-columns: 44px minmax(0, 1fr); padding: 16px 12px; gap: 6px 14px; }
  .calendar-round { font-size: 1.1rem; grid-row: span 2; }
  .calendar-date { grid-column: 2; text-align: left; white-space: normal; font-size: .82rem; }
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
@media (max-width: 1100px) {
  .container, .hero .container { padding-inline: 24px; }
  .nav-inner { gap: 16px; }
  .nav-links a { padding-inline: 6px; font-size: .74rem; }
  .nav-actions { gap: 8px; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-main { padding: 36px 0; grid-column: 1; grid-row: 1; }
  .hero-main h1 { max-width: 17ch; font-size: clamp(2.45rem, 7vw, 3.7rem); }
  .hero-stage { grid-column: 1; grid-row: 2; min-height: 390px; border-left: 0; border-top: 1px solid var(--border); }
  .hero-side { grid-row: 3; grid-template-columns: repeat(3, 1fr); }
  .hero-card { padding: 20px 16px; }
  .news-desk { grid-template-columns: 1fr; gap: 24px; }
  .published-list { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .container, .hero .container { padding-inline: 20px; }
  .nav-inner { height: 68px; gap: 12px; }
  .nav-actions { margin-left: auto; }
  .logo { font-size: 1.55rem; }
  .mobile-menu-btn { order: 3; }
  .nav-links a { font-size: 1rem; padding: 14px 20px; }
  .nav-more-btn { font-size: 1rem; padding: 14px 20px; }
  .nav-links.active { margin: 0; }
  .hero-side { grid-template-columns: 1fr; }
  .hero-card, .hero-card:first-child { min-height: 0; padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .hero-card h2 { max-width: none; font-size: 1.05rem; margin-top: 6px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 20px 0; }
  .stat-item, .stat-item:first-child { padding: 0 16px 16px 0; border: 0; }
  .stat-item:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--border); }
  .standings-preview { grid-template-columns: 1fr; gap: 32px; }
  .community-invite { align-items: flex-start; flex-direction: column; gap: 18px; }
  .page-hero { padding-top: 32px; }
  .cookie-banner { padding: 14px 20px; max-height: 45vh; }
  .cookie-inner > p:first-child { flex-basis: 100%; }
  .cookie-actions { width: 100%; }
  .cookie-choice { flex: 1; min-width: 0; }
  .cookie-customise, .cookie-links { min-height: 44px; }
}
