/* ==========================================================================
   Schedule — the league's own upcoming races.

   Modelled on iracing/css/endurance.css, and deliberately NOT the same file:
   that one carries a weather row, a duration meter and a countdown, none of
   which this page has. Everything here is scoped `.schedule`, so the two
   cannot bleed into each other.

   The page shell -- .racedata, .titlebar, .display, .eyebrow, .gen -- comes
   from /css/datapages.css, shared by every data page.
   ========================================================================== */

/* ---- filters ---------------------------------------------------------- */
.schedule .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  margin: 18px 0 22px;
}
.schedule .f-field { display: flex; flex-direction: column; gap: 4px; }
.schedule .f-lbl {
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #94a3b8;
}
.schedule .filters select {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 7px 11px;
  font: inherit;
  font-size: .9rem;
  min-width: 13rem;
}
.schedule .filters select:focus-visible { outline: 2px solid #38a9e8; outline-offset: 1px; }

.schedule .chip-btn {
  border: 1px solid #334155;
  background: #0f172a;
  color: #cbd5e1;
  border-radius: 999px;
  padding: 7px 15px;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.schedule .chip-btn:hover { background: #1e293b; color: #f1f5f9; }
.schedule .chip-btn.active { background: #38a9e8; border-color: #38a9e8; color: #04121f; font-weight: 600; }
.schedule .chip-btn.ghost { opacity: .75; }
.schedule .f-count { margin-left: auto; font-size: .85rem; color: #94a3b8; }

/* ---- the timeline ----------------------------------------------------- */
.schedule .timeline { display: flex; flex-direction: column; gap: 2px; }

/* A date heading, so a week reads as a week rather than a list of rows. */
.schedule .day {
  position: relative;
  margin: 20px 0 6px;
  padding-left: 2px;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.schedule .day::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 6px;
  background: linear-gradient(90deg, #1e3a5f, transparent);
}
.schedule .day:first-child { margin-top: 0; }

.schedule .row {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr 96px auto;
  gap: 14px;
  align-items: center;
  padding: 11px 14px 11px 12px;
  background: #0d1729;
  border: 1px solid #1e293b;
  border-radius: 10px;
}

/* ---- track map -------------------------------------------------------- */
/* THE LAYERS ARE SIZED BY THIS BOX, NEVER THEMSELVES. Every layer shares
   viewBox="0 0 1920 1080" and carries no width or height, so the container is
   what scales them -- and scaling them individually is how a stack stops
   lining up. See Docs/Knowledgebase/03-data-model.md. */
.schedule .row-map {
  width: 96px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .85;
}
.schedule .row-map img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* A round whose track is not known yet: hold the column so the rows still
   line up, rather than letting the grid jump about. */
.schedule .row-map.none { opacity: .3; }
.schedule .row + .row { margin-top: 4px; }

/* A round we know is happening but cannot yet say when. Dashed, dimmer, and
   it carries the note rather than a time -- so it never reads as scheduled. */
.schedule .row.is-tbd {
  border-style: dashed;
  border-color: #3f3a22;
  background: #12110c;
}

/* ---- season artwork --------------------------------------------------- */
.schedule .row-art {
  width: 74px;
  height: 46px;
  border-radius: 6px;
  overflow: hidden;
  background: #111c30;
  display: flex;
  align-items: center;
  justify-content: center;
}
.schedule .row-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* No artwork filed for that season: a flag rather than a broken image. */
.schedule .row-art.ph { font-size: 1.15rem; color: #475569; }

/* ---- the middle ------------------------------------------------------- */
.schedule .row-main { min-width: 0; }
.schedule .row-main h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  color: #f1f5f9;
  overflow-wrap: anywhere;
}
.schedule .row-main .where {
  margin: 2px 0 0;
  font-size: .86rem;
  color: #94a3b8;
  overflow-wrap: anywhere;
}
.schedule .tbd-note {
  margin: 5px 0 0;
  font-size: .82rem;
  font-style: italic;
  color: #d7b55f;
}

.schedule .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.schedule .tags span {
  font-size: .7rem;
  letter-spacing: .04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #14243c;
  color: #93c5fd;
  border: 1px solid #1e3a5f;
}
.schedule .tags span.rnd { background: #16213a; color: #a5b4fc; border-color: #312e81; }
.schedule .tags span.tent { background: #2a2411; color: #e3c46a; border-color: #4b3f14; }

/* ---- the time --------------------------------------------------------- */
.schedule .row-time { text-align: right; white-space: nowrap; }
.schedule .row-time .t { font-size: 1.02rem; color: #e2e8f0; font-weight: 600; }
.schedule .row-time .r { display: block; font-size: .76rem; color: #7f8ea3; margin-top: 2px; }
.schedule .row-time .tbc {
  font-size: .84rem;
  color: #d7b55f;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.schedule .empty {
  padding: 26px 10px;
  text-align: center;
  color: #94a3b8;
}

/* ---- narrow screens --------------------------------------------------- */
@media (max-width: 560px) {
  .schedule .row {
    grid-template-columns: 56px 1fr 68px;
    grid-template-areas: "art main map" "time time time";
    row-gap: 8px;
    gap: 10px;
  }
  .schedule .row-art { grid-area: art; width: 56px; height: 36px; }
  .schedule .row-main { grid-area: main; }
  .schedule .row-map { grid-area: map; width: 68px; height: 38px; }
  .schedule .row-time { grid-area: time; text-align: left; }
  .schedule .f-count { margin-left: 0; }
}
