/* 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,
   .cat-chip, .empty-state, .cal-status. Everything below is event-detail. */

.messages { margin: 18px 0 0; display: flex; flex-direction: column; gap: 8px; }
.msg { padding: 10px 14px; border-radius: 9px; font-size: 12.5px; }
.msg.success { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent); }
.msg.error { background: rgba(255, 84, 112, 0.1); border: 1px solid rgba(255, 84, 112, 0.35); color: var(--critical); }

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 22px 0 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-tertiary);
}
.crumb:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.event-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(175deg, var(--surface) 0%, var(--card-gradient-end) 100%);
}
.event-hero .hero-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
/* Same slot as .hero-cover, for the no-real-photo-yet prototype video --
   .aurora-glow (always rendered alongside it, see event_detail.html)
   shows through once this is hidden under reduced motion. */
.event-hero .hero-cover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
@media (prefers-reduced-motion: reduce) {
  .event-hero .hero-cover-video { display: none; }
}
.event-hero.has-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(10, 13, 16, 0.35) 0%, rgba(10, 13, 16, 0.9) 100%);
}
.hero-inner { padding: 26px 26px 24px; }
.event-hero.has-cover .hero-inner { padding-top: 120px; }
.hero-badges { display: flex; align-items: center; gap: 8px; }
.hero-round {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 3px 10px;
  border-radius: 100px;
}
.hero-badges .cal-status { margin-left: 0; }
.cal-status.ongoing { background: var(--gold-soft); color: var(--gold); border: 1px solid rgba(255, 201, 74, 0.3); }
.event-hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.01em; margin-top: 12px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-secondary); }
.hero-meta svg { width: 15px; height: 15px; color: var(--text-tertiary); }
.hero-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.hero-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
/* Headline numbers: one outlined, glowing block divided into cells (same as the circuit page). */
.hero-statblock {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, auto);
  border: 1px solid var(--accent-line); border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, var(--accent-soft), transparent 70%);
  box-shadow: 0 0 24px -10px var(--accent);
}
.hero-statblock div { padding: 9px 18px; border-left: 1px solid var(--line); }
.hero-statblock div:first-child { border-left: none; }
.hero-statblock b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--text-primary); }
.hero-statblock span { display: block; margin-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
.hero-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 700;
  color: #04150c;
  background: var(--accent);
  padding: 9px 14px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.hero-cta:hover { background: var(--accent-strong); }

/* ---------- Sections ---------- */
.ev-section { margin-top: 30px; }
.ev-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.ev-section-head h2 { font-size: 18px; font-weight: 800; }
.ev-section-sub { font-size: 12.5px; color: var(--text-tertiary); }
.ev-see-all {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.ev-see-all:hover { color: var(--accent-strong); }

/* "Ver las N fotos" button below the capped preview wall */
.see-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.see-all-btn:hover { border-color: var(--accent-line); color: var(--accent); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 10, 0.93);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lightbox[hidden] { display: none; }
.lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 0 4vw;
}
.lb-img {
  max-width: 88vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.85);
}
.lb-cap { font-size: 13px; color: rgba(255, 255, 255, 0.72); font-weight: 600; }
.lb-cap[hidden] { display: none; }
.lb-close,
.lb-nav {
  position: fixed;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  line-height: 1;
  transition: background 0.15s ease;
}
.lb-close:hover,
.lb-nav:hover { background: rgba(255, 255, 255, 0.24); }
.lb-close {
  top: 18px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 26px;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 30px;
}
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lightbox.single .lb-nav,
.lightbox.single .lb-counter { display: none; }
.lb-counter {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .lb-nav { width: 42px; height: 42px; font-size: 24px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

/* ---------- Full gallery screen ---------- */
/* The gallery title is the shared .page-head (nav.css). */
.gallery-wall { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ---------- Circuit / track panel ---------- */
.circuit-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(175deg, var(--surface) 0%, var(--card-gradient-end) 100%);
}
.circuit-track {
  flex: 0 0 240px;
  max-width: 240px;
  text-align: center;
}
.circuit-track img { width: 100%; height: auto; max-height: 150px; object-fit: contain; display: block; }
.circuit-track svg { width: 100%; height: auto; }
.circuit-track .track-illustrative { font-size: 9.5px; color: var(--text-tertiary); font-style: italic; margin-top: 4px; display: block; }
.circuit-info { min-width: 0; }
.ci-name { font-size: 18px; font-weight: 800; }
.ci-loc { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.ci-stats {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, auto); margin-top: 14px;
  border: 1px solid var(--accent-line); border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, var(--accent-soft), transparent 70%);
  box-shadow: 0 0 24px -10px var(--accent);
}
.ci-stats div { padding: 9px 18px; border-left: 1px solid var(--line); }
.ci-stats div:first-child { border-left: none; }
.ci-stats b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--text-primary); }
.ci-stats span { display: block; margin-top: 2px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); }
/* Sections with nothing to show and nothing to add fold into this one line. */
.ev-empty-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px;
  padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px;
}
.ev-empty-label { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); margin-right: 4px; }
.ev-empty-chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 100px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-secondary); }

@media (max-width: 560px) {
  .circuit-card { flex-direction: column; align-items: stretch; text-align: center; }
  .circuit-track { flex-basis: auto; max-width: none; }
  .ci-stats { justify-self: center; }
}

/* ---------- Photo composer ---------- */
.photo-composer {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.pc-heading { font-size: 13px; font-weight: 800; color: var(--text-primary); }
.pc-caption {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  padding: 4px 0 10px;
}
.pc-caption::placeholder { color: var(--text-tertiary); }
/* flex-wrap + min-width:0 below: this row holds two chips and a post
   button, and the visibility chip wraps a <select> whose intrinsic width
   comes from its longest option ("Público -- en la galería del evento").
   Without them the row can't wrap and the select can't shrink, so on a
   phone the button was pushed past the right edge of the page. */
.pc-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.composer-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.composer-chip:hover { border-color: var(--line-hover); color: var(--text-primary); }
.composer-chip.has-file { border-color: var(--accent-line); color: var(--accent); }
.composer-chip svg { width: 15px; height: 15px; flex-shrink: 0; }
.composer-chip select { min-width: 0; max-width: 100%; }
.btn-post {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #04150c;
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.btn-post:hover { background: var(--accent-strong); }
.ev-photo-price {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.ev-photo-price strong { font-size: 15px; font-weight: 800; }

/* ---------- Photo wall ---------- */
.photo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.photo-wall-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 600px) { .photo-wall-5 { grid-template-columns: repeat(3, 1fr); } }
.pw-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}
.pw-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.pw-cell:hover img { transform: scale(1.05); }
.pw-author {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 10px 7px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
  opacity: 0;
  transition: opacity 0.15s ease;
}
.pw-cell:hover .pw-author { opacity: 1; }
.pw-vis {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10.5px;
  line-height: 1;
  background: rgba(10, 13, 16, 0.6);
  backdrop-filter: blur(2px);
}
.pw-vis.followers { background: rgba(10, 13, 16, 0.72); border: 1px solid rgba(255, 201, 74, 0.35); }

/* ---------- Videos del evento (poster grid -> links out to Reels) ---------- */
.video-upload-prompt {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 14px;
  padding: 9px 14px; border-radius: 100px; border: 1px dashed var(--line-hover);
  font-size: 12.5px; font-weight: 700; color: var(--text-secondary);
}
.video-upload-prompt svg { width: 15px; height: 15px; }
.video-upload-prompt:hover { border-style: solid; border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

.video-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.vw-cell {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #000;
}
.vw-cell img, .vw-cell video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; pointer-events: none; }
.vw-cell:hover img, .vw-cell:hover video { transform: scale(1.05); }
.vw-play {
  position: absolute; inset: 0; margin: auto; width: 34px; height: 34px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(0,0,0,0.4); color: #fff; backdrop-filter: blur(2px);
}
.vw-play svg { width: 16px; height: 16px; }
.vw-stats {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.45); padding: 3px 7px; border-radius: 100px;
}
.vw-stats svg { width: 11px; height: 11px; }
.vw-author {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 8px 6px; font-size: 10.5px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.75));
}

/* ---------- Speedhive unofficial results ---------- */
.speedhive-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--gold-soft, var(--line));
  border-radius: var(--radius-lg);
  background: var(--gold-soft, var(--surface));
}
.speedhive-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--gold, var(--accent));
}
.speedhive-icon svg { width: 19px; height: 19px; }
.speedhive-body { min-width: 0; flex: 1; }
.speedhive-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold, var(--accent));
}
.speedhive-body p { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.5; }
.speedhive-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 9px 14px;
  border-radius: 8px;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.speedhive-link:hover { border-color: var(--accent-line); color: var(--accent); }
.speedhive-live-positions { margin-top: 12px; overflow-x: auto; }
.speedhive-live-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.speedhive-live-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
}
.speedhive-live-table td { padding: 5px 8px; border-bottom: 1px solid var(--line); color: var(--text-primary); }
.speedhive-live-table td.num { font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .speedhive-card { flex-wrap: wrap; }
  .speedhive-link { margin-left: 54px; }
}

/* ---------- Parrilla / Entry list ---------- */
.entry-actions { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.my-entry-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.my-entry-chip form { margin: 0; }
.btn-ghost.sm { padding: 5px 10px; font-size: 11.5px; }
.entry-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.entry-form input[type="text"] {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: inherit;
}
.entry-form input[type="text"]::placeholder { color: var(--text-tertiary); }
.entry-form input[name="category"] { flex: 1 1 160px; }
.entry-form input[name="car_number"] { width: 90px; }
.entry-form select { flex: 1 1 200px; }
.entry-roster-manager { margin-bottom: 16px; }
.entry-roster-manager summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.entry-roster-manager summary:hover { color: var(--accent); }
.entry-roster-manager[open] .entry-form { margin-top: 4px; }
.entry-table td.res-num { width: 48px; }

/* ---------- Results ---------- */
.result-group { margin-bottom: 22px; }
.rg-cat {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 10px;
}
.rg-heat { margin-bottom: 16px; }
.rg-heat-label { font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.res-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.res-table th {
  text-align: left;
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.res-table th.num, .res-table td.num { text-align: right; }
.res-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.res-table tr:last-child td { border-bottom: none; }
.res-table tbody tr:hover { background: var(--surface); }
.res-pos {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 12.5px;
  background: var(--surface-2);
  color: var(--text-secondary);
}
.res-pos.p1 { background: var(--gold-soft); color: var(--gold); }
.res-pos.p2 { background: var(--silver-soft); color: var(--silver); }
.res-pos.p3 { background: var(--bronze-soft); color: var(--bronze); }
.res-num { color: var(--text-tertiary); font-weight: 600; }
.res-driver a { font-weight: 700; }
.res-driver a:hover { color: var(--accent); }
.res-team { color: var(--text-secondary); }
.res-lap { font-weight: 700; }
.res-tag {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.res-tag.pole { background: var(--violet-soft); color: var(--violet); }
.res-tag.fl { background: var(--accent-soft); color: var(--accent); }
.res-tag.fault { background: var(--critical-soft); color: var(--critical); cursor: help; }
/* The incident the driver reported for this race, in their own words under their name -- a quote set off by the
   fault's red rule, so it reads as the ⚠ tag's explanation rather than one more grey line of the row. */
.res-fault-note {
  width: fit-content;
  max-width: 46ch;
  margin-top: 7px;
  padding: 5px 10px 5px 10px;
  border-left: 2px solid var(--critical);
  border-radius: 0 7px 7px 0;
  background: var(--critical-soft);
  font-size: 12.5px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text-soft);
}
.res-fault-note::before { content: "“"; }
.res-fault-note::after { content: "”"; }
.rg-note { font-size: 11.5px; color: var(--text-tertiary); margin-top: 7px; padding-left: 2px; font-style: italic; }

/* ---------- Tagged activity ---------- */
.ev-post { display: flex; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.ev-post:last-child { border-bottom: none; }
.avatar.sm {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(150deg, #2a3542, #171c22);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}
.avatar.sm img { width: 100%; height: 100%; object-fit: cover; }
.ev-post-body { min-width: 0; flex: 1; }
.ev-post-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ev-post-name { font-weight: 700; font-size: 13.5px; }
.ev-post-name:hover { color: var(--accent); }
.ev-post-time { font-size: 11.5px; color: var(--text-tertiary); margin-left: 8px; }
.ev-post-display p { margin: 4px 0 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.55; }
.ev-post-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ev-post-thumbs a { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.ev-post-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s ease; }
.ev-post-thumbs a:hover img { transform: scale(1.06); }

/* ---- Author post menu (edit / delete) ---- */
.fp-menu { position: relative; flex-shrink: 0; }
.fp-menu-btn { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text-tertiary); }
.fp-menu-btn:hover { background: var(--surface-2); color: var(--text-primary); }
.fp-menu-btn svg { width: 17px; height: 17px; }
.fp-menu-list {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 148px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.6);
  padding: 5px;
  z-index: 15;
}
.fp-menu-list button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: left;
}
.fp-menu-list button:hover { background: var(--surface-2); color: var(--text-primary); }
.fp-menu-list button svg { width: 15px; height: 15px; }
.fp-menu-list button.danger:hover { color: var(--critical); background: rgba(255, 84, 112, 0.08); }
.fp-menu-list form { margin: 0; }

/* ---- Inline edit form ---- */
.fp-edit { display: none; margin-top: 10px; }
.ev-post.editing .ev-post-display { display: none; }
.ev-post.editing .fp-edit { display: block; }
.fp-edit-text {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  padding: 11px 13px;
  resize: none;
  max-height: 260px;
}
.fp-edit-text:focus { outline: none; border-color: var(--accent-line); }
.fp-edit-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fp-edit-thumb { position: relative; width: 68px; height: 68px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.fp-edit-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fp-thumb-del {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(10, 13, 16, 0.82);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: grid; place-items: center;
}
.fp-thumb-del:hover { background: var(--critical); }
.fp-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.fp-edit-buttons { display: flex; gap: 8px; align-items: center; }

@media (max-width: 600px) {
  .hero-stats { flex-wrap: wrap; }
  .hero-cta { margin-left: 0; }
  .res-table { display: block; overflow-x: auto; }
}

/* Entry point to the full-screen pit-wall board. Only rendered when the
   event has a live URL, so it never appears on a card that is just the
   outbound Speedhive link. */
.speedhive-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent, #e63946);
  text-decoration: none;
}

.speedhive-fullscreen:hover { text-decoration: underline; }

.fault-slot { padding: 14px 0; border-top: 1px solid var(--line); }
.fault-slot:first-child { border-top: none; }
.fault-slot-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fault-slot-label { font-weight: 700; font-size: 13.5px; }
.fault-status-badge { font-size: 12px; padding: 3px 9px; border-radius: 100px; font-weight: 600; }
.fault-status-badge.cancelled { background: rgba(255, 84, 112, 0.1); color: var(--critical); }
.fault-status-badge.red_flag { background: rgba(255, 84, 112, 0.1); color: var(--critical); }
.fault-status-badge.shortened { background: var(--amber-soft); color: var(--amber); }
.fault-event-banner { padding: 12px 16px; border-radius: var(--radius-md); font-weight: 700; font-size: 13.5px; }
.fault-event-banner.cancelled, .fault-event-banner.postponed { background: rgba(255, 84, 112, 0.1); color: var(--critical); }
.fault-report-row { padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.fault-report-row:first-of-type { border-top: none; }
.fault-tag { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--text-secondary); }
.fault-outcome { margin-left: 8px; color: var(--text-secondary); }
.fault-laps { margin-left: 8px; color: var(--text-tertiary); font-size: 12px; }
.fault-description { margin: 4px 0 0; color: var(--text-secondary); }
.fault-report-form { margin-top: 8px; }
.fault-report-form summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.fault-report-form form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-width: 420px; }

/* Results are for signed-in users only; anonymous visitors see this in their place. */
.ev-locked {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px;
  border: 1px solid var(--accent-line); border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%);
  box-shadow: 0 0 28px -12px var(--accent);
}
.ev-locked > div { flex: 1; min-width: 200px; }
.ev-locked-icon { width: 32px; height: 32px; flex-shrink: 0; display: grid; place-items: center; border-radius: 10px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.ev-locked-icon svg { width: 15px; height: 15px; }
.ev-locked h2 { font-size: 16px; font-weight: 800; }
.ev-locked p { margin: 3px 0 0; font-size: 13px; color: var(--text-secondary); }

/* The row a /standings/ points cell links to. */
.res-table tr.res-highlight td { background: rgba(0, 230, 118, 0.12); }
.res-table tr.res-highlight td:first-child { box-shadow: inset 3px 0 0 var(--accent, #00e676); }
#resaltado { scroll-margin-top: 90px; }
.res-class { color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
