/* ============================================================
   LUMI F1 — ENTWURF 3, Nachtragsschicht
   ------------------------------------------------------------
   Basis ist Entwurf 1 (style.css), unverändert.
   Diese Datei enthält ausschließlich die Änderungen:

   Von Michael  · Startaufstellung aus Entwurf 2 nach der Ampel
                · "Weiter hinten im Feld" statt "Kalender"
   Von Jan      · Startzeit deutlich größer
                · Farbtrennung Quali/Rennen bleibt
                · Crew-Nummern raus (wirkten wie Rangordnung)
                · Aktuelles anklickbar, Fenster statt neuer Tab
                · Feld ausklappbar zur Jahresübersicht
   Aus der Prüfung · Kontrast und Schriftgrößen fürs ältere Publikum
   ============================================================ */

/* ---------- Lesbarkeit ----------
   Befund: #6B6B6B auf #1C1C1C ergibt 3,46:1 und liegt unter der
   Norm von 4,5:1. Rot und Grün lagen als Kleinschrift bei 3,49:1
   und 3,47:1. 65+ ist mit 23 % die größte Altersgruppe des Kanals
   und 30 % schauen am Fernseher, also aus mehreren Metern. Das ist
   kein Geschmacksthema, sondern schließt sonst Leute aus. */
:root{
  --ink-faint:  #8A8A8A;   /* war #6B6B6B → jetzt 4,9:1 */
  --live-text:  #FF4D57;   /* Rot, als Kleinschrift lesbar */
  --quali-text: #7FA98B;   /* Grün, als Kleinschrift lesbar */
}

.eyebrow, .stat span, .ev-count span, .cal-date span, .news-date,
.crew-card span, .kpi span, .soc-go, .bay-go, .foot small,
.shot figcaption, .tl-step span, .numbers span{
  font-size: 12px;
}
.ev-type, .cal-badge, .news-tag span, .driver span{ font-size: 11px; }
.kpi-strip{ font-size: 15px; }
.kpi-strip b{ font-size: 18px; }

/* ---------- Jans wichtigster Punkt ----------
   Die Startzeit war 12px klein, während der Countdown 26px bekam.
   Sie ist aber die eine Information, für die es die Seite gibt. */
.ev-when{
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: var(--live-text);
  margin: 22px 0 6px;
}
.ev--quali .ev-when{ color: var(--quali-text); }
.ev-loc{ font-size: 14px; }
.cal-time{ font-size: 16px; }

/* ============================================================
   DIE STARTAUFSTELLUNG
   Das eine Element aus Entwurf 2, das Michael übernehmen wollte.
   Aus der Kartenreihe wird die versetzte Formation.
   ============================================================ */
.events-grid{
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 22px);
  padding-inline: clamp(46px, 5.6vw, 92px);
}
.events-grid .ev{ width: min(62%, 660px); min-height: 0; }
.events-grid .ev:nth-child(even){ align-self: flex-end; }
.events-grid .ev:first-child{ width: min(76%, 780px); }

/* Startnummer steht vor der Box, wie auf der Bahn */
.ev-pos{
  position: absolute;
  top: -.08em;
  right: calc(100% + 12px);
  z-index: 2;
  font-size: clamp(40px, 5vw, 78px);
  font-weight: 900;
  line-height: .8;
  letter-spacing: -.06em;
  color: rgba(242,242,242,.22);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ev:nth-child(even) .ev-pos{ right: auto; left: calc(100% + 12px); }
.ev:first-child .ev-pos{ color: rgba(242,242,242,.42); }

/* Mittellinie der Fahrbahn, hält die Formation optisch zusammen */
#events .shell{ position: relative; }
#events .shell::before{
  content: "";
  position: absolute;
  left: 50%; top: 240px; bottom: 0; width: 3px;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom,
    rgba(242,242,242,.13) 0 44px, transparent 44px 100px);
}

/* ---------- Live wird eine Fläche, kein Textton ----------
   Jan will die Farbtrennung Quali/Rennen behalten. Damit "jetzt
   live" trotzdem unverwechselbar bleibt und nicht mit "ist ein
   Rennen" verwechselt wird, bekommt es eine gefüllte Fläche. */
.ev-live-now{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--red);
  color: #fff;
  padding: 11px 20px;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.ev-live-now::before{
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  animation: beat 1.5s infinite;
}
@keyframes beat{ 0%,100%{ opacity: 1 } 50%{ opacity: .3 } }

/* ---------- Jans Punkt: keine Rangordnung bei der Crew ---------- */
.driver::before{ content: none; }
.driver span{ color: var(--live-text); }

/* ============================================================
   AUFKLAPPER UND FENSTER
   Jan: kein neuer Tab, sondern ein Fenster auf der Seite.
   ============================================================ */
.opener{
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin-top: 24px;
  padding: 13px 24px;
  border: 2px solid var(--line-2);
  border-radius: 100px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .3s var(--ease), gap .3s var(--ease);
}
.opener:hover{ border-color: var(--red); gap: 17px; }
.opener svg{ width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.panel{
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 48px);
  background: rgba(10,10,10,.84);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
}
.panel.open{ opacity: 1; visibility: visible; }
.panel-box{
  position: relative;
  width: min(940px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: clamp(26px, 4vw, 46px);
  transform: translateY(22px) scale(.98);
  transition: transform .35s var(--ease);
}
.panel.open .panel-box{ transform: none; }
.panel-box::before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--red);
  border-radius: 16px 16px 0 0;
}
.panel-close{
  position: absolute;
  top: 14px; right: 14px;
  width: 42px; height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .25s, background .25s;
}
.panel-close:hover{ border-color: var(--red); background: rgba(227,6,19,.14); }
.panel-close svg{ width: 17px; height: 17px; stroke: var(--ink); stroke-width: 2.4; fill: none; }
.panel-box h3{
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 8px 0 14px;
  line-height: 1.16;
}
.panel-meta{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.panel-box p{ font-size: 16px; color: var(--ink-dim); max-width: 66ch; }
.panel-hint{
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-faint);
}

/* ---------- Jahresübersicht, echtes Kalenderbild ----------
   Jan wollte ausdrücklich keine Liste. */
.year{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: clamp(16px, 2vw, 26px);
  margin-top: 10px;
}
.month h4{
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.month-grid{ display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dow{
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-faint);
  text-align: center;
  padding-bottom: 4px;
}
.day{
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}
.day.pad{ visibility: hidden; }
.day.has{ font-weight: 900; color: #fff; }
.day.race{ background: var(--red); }
.day.quali{ background: rgba(88,120,96,.95); }
.day.special{ background: rgba(242,242,242,.26); color: var(--ink); }
.day.today{ box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); }
.legend{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-dim);
}
.legend i{
  width: 13px; height: 13px;
  border-radius: 3px;
  display: inline-block;
  margin-right: 7px;
  vertical-align: -2px;
}

/* ---------- Aktuelles: Kacheln sind jetzt Schalter ---------- */
.news{
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}
.news:focus-visible{ outline: 3px solid var(--red); outline-offset: 3px; }
.news-more{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--live-text);
  transition: gap .25s var(--ease);
}
.news:hover .news-more{ gap: 14px; }

/* ---------- Handy ---------- */
@media (max-width: 900px){
  .events-grid{ padding-inline: 0; }
  .events-grid .ev,
  .events-grid .ev:first-child{ width: 100%; }
  .events-grid .ev:nth-child(even){ align-self: auto; }
  .ev-pos,
  .ev:nth-child(even) .ev-pos{
    position: static;
    display: block;
    font-size: 38px;
    margin-bottom: 2px;
    color: rgba(242,242,242,.42);
  }
  #events .shell::before{ display: none; }
}

@media (prefers-reduced-motion: reduce){
  .ev-live-now::before{ animation: none; }
}

/* ---------- Startnummern sichtbar machen ----------
   Die Boxen aus Entwurf 1 haben overflow:hidden fuer den
   Diagonal-Wisch. Das schnitt die Nummer neben der Box ab.
   Loesung: Box wird sichtbar, die beiden Effekt-Ebenen bleiben
   innerhalb ihrer eigenen Flaeche. */
.events-grid .ev{ overflow: visible; }
.events-grid .ev:hover::before{ clip-path: polygon(0 0, 100% 0, 0 100%); }
.events-grid .ev::after{ transform: none; }

/* Ein einzelner Monat soll nicht die volle Breite fuellen */
.month{ max-width: 320px; }
