/* Depends on: calendar.css -- linked as separate <link>
   tags by every template that uses this file, NOT @import-ed here.
   @import is a serialized waterfall: the browser cannot discover an
   imported file until it has downloaded and parsed the one importing
   it, so this site's deepest chain (tokens -> nav -> calendar ->
   event_detail) cost four sequential round trips before first paint.
   Separate links are all visible in the initial HTML and download in
   parallel. Templates list dependencies first, so the cascade is
   unchanged -- see core/tests/test_template_lint.py, which fails if
   an @import is reintroduced here. */
/* calendar.css supplies the shell (body, .wrap, .topbar, .brand, .btn-ghost). */

/* Still used by core/templates/core/weekly_recap.html, which renders
   <div class="wrap recap-wrap"> and loads this file. Without it that page
   falls through to calendar.css's .wrap and widens from 720px to 900px.
   core/templates/core/recap.html deliberately does NOT emit this class any
   more -- the season recap lives in the pilot shell's centre column now
   (spec PT-009), which owns its own width. */
.recap-wrap { max-width: 720px; padding-bottom: 60px; }

/* ---------- Hero ---------- */
.recap-hero {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: 26px; padding: 40px 32px 34px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: linear-gradient(175deg, var(--surface) 0%, var(--card-gradient-end) 100%);
  text-align: center;
}
.recap-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.recap-hero h1 { font-size: clamp(34px, 7vw, 56px); font-weight: 900; letter-spacing: -0.02em; margin-top: 6px; background: linear-gradient(120deg, var(--aurora-green), var(--aurora-cyan), var(--aurora-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.recap-who { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.recap-av {
  width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-size: 20px; font-weight: 800;
  background: var(--surface-2); border: 2px solid var(--accent); color: var(--text-secondary);
}
.recap-av img { width: 100%; height: 100%; object-fit: cover; }
.recap-name { font-size: 17px; font-weight: 800; text-align: left; }
.recap-cat { font-size: 12.5px; color: var(--text-tertiary); text-align: left; margin-top: 2px; }

/* ---------- Empty state ---------- */
.recap-empty {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: 26px; padding: 50px 30px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.recap-empty h1 { font-size: 24px; font-weight: 800; }
.recap-empty p { font-size: 13.5px; color: var(--text-secondary); margin-top: 8px; }
.recap-year-links { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.year-chip { padding: 8px 16px; border-radius: 100px; border: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--text-secondary); }
.year-chip:hover { border-color: var(--accent-line); color: var(--accent); }

/* ---------- Stat grid ---------- */
/* Mobile: 2 columns, "big" tiles (races/wins/podiums) span both.
   >=480px: 3 columns, big tiles collapse to a single cell each -- so the
   three headline numbers sit in one row, the rest fill the grid after. */
.recap-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 22px;
}
.recap-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 18px 14px; text-align: center;
}
.recap-tile.big { grid-column: span 2; }
.rt-val { font-size: 26px; font-weight: 900; letter-spacing: -0.01em; }
.rt-val.pos { color: var(--accent); }
.rt-val.neg { color: var(--critical); }
.recap-tile.gold .rt-val { color: var(--gold); }
.rt-lbl { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 5px; }

@media (min-width: 480px) {
  .recap-grid { grid-template-columns: repeat(3, 1fr); }
  .recap-tile.big { grid-column: span 1; }
}

/* ---------- Sections ---------- */
.recap-section { margin-top: 32px; }
.recap-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.recap-section-head svg { width: 18px; height: 18px; color: var(--gold); }
.recap-section-head h2 { font-size: 16px; font-weight: 800; }

.recap-records { display: flex; flex-wrap: wrap; gap: 8px; }
.record-chip-lg {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 15px;
  border-radius: 100px; background: var(--gold-soft); border: 1px solid rgba(255,201,74,0.4);
  color: var(--gold); font-weight: 700; font-size: 13px;
}
.record-chip-lg:hover { background: rgba(255,201,74,0.2); }

.fav-circuit {
  display: flex; align-items: center; gap: 18px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface);
}
.fc-track { flex: 0 0 100px; width: 100px; height: 64px; display: grid; place-items: center; background: var(--surface-2); border-radius: 8px; overflow: hidden; padding: 6px; }
.fc-track img, .fc-track svg { max-width: 100%; max-height: 100%; }
.fc-name { font-size: 15px; font-weight: 800; }
.fav-circuit:hover .fc-name { color: var(--accent); }
.fc-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

/* Season trend bars (same visual language as the profile season chart) */
.recap-chart { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.rc-bar-col { flex: 1 0 44px; min-width: 44px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rc-bar-track { width: 100%; height: 110px; display: flex; align-items: flex-end; justify-content: center; }
.rc-bar {
  width: 100%; max-width: 38px; min-height: 20px; border-radius: 6px 6px 0 0;
  display: flex; align-items: flex-start; justify-content: center;
  background: var(--surface-hover); border: 1px solid var(--line);
}
.rc-bar.p1 { background: var(--gold-soft); border-color: rgba(255,201,74,0.4); }
.rc-bar.p2 { background: var(--silver-soft); border-color: rgba(201,211,220,0.35); }
.rc-bar.p3 { background: var(--bronze-soft); border-color: rgba(214,138,86,0.4); }
.rc-bar-val { font-family: var(--font-mono); font-size: 11px; font-weight: 800; margin-top: 4px; color: var(--text-primary); }
.rc-bar.p1 .rc-bar-val { color: var(--gold); }
.rc-bar.p2 .rc-bar-val { color: var(--silver); }
.rc-bar.p3 .rc-bar-val { color: var(--bronze); }
.rc-bar-label { font-size: 9.5px; color: var(--text-tertiary); white-space: nowrap; }

/* Social recap */
.recap-social {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md);
  overflow: hidden; margin-top: 30px;
}
.rs-item { background: var(--surface); padding: 16px; text-align: center; }
.rs-v { font-size: 22px; font-weight: 800; }
.rs-l { font-size: 10.5px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

.recap-share-hint {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 30px; font-size: 12px; color: var(--text-tertiary);
}
.recap-share-hint svg { width: 15px; height: 15px; }
.recap-share-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 30px auto 0; width: fit-content; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-hover); font-size: 13px; font-weight: 600;
  color: var(--text-secondary); text-decoration: none;
}
.recap-share-btn:hover { color: var(--text-primary); border-color: var(--accent); }
.recap-share-btn svg { width: 15px; height: 15px; }

@media (max-width: 480px) {
  .recap-hero h1 { font-size: 40px; }
}
