/* Train pages and their hub (website/src/trains/render.ts), on top of /guides/guides.css. */
:root {
  --run-ok: #2f9e4f;
  --run-late: #f2a33a;
  --run-late15: #c4271b;
  --run-cancelled: #3a3a3c;
}

.tr-page { max-width: 860px; padding-bottom: 56px; }
.tr-page .hero-sub { margin-top: 20px; }

.tr-runs h2 { margin-bottom: 16px; }

/* A train's row on its route page; the hub's search lands on it by its anchor. */
.tr-train { padding: 16px 0; scroll-margin-top: var(--anchor); }
.tr-train:target h3 { color: var(--link); }

/* A train's strip: one square a run, its last 14 on one row, oldest first. Lightness tells the
   bands apart too. */
.tr-strip {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 3px;
  max-width: 252px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
.tr-strip li, .tr-key {
  aspect-ratio: 1;
  margin: 0;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}
[data-band="ok"] { background: var(--run-ok); }
[data-band="late"] { background: var(--run-late); }
[data-band="late15"] { background: var(--run-late15); }
/* Cancelled: a cross, so it never reads as a colour alone. */
[data-band="cancelled"] {
  background:
    linear-gradient(45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #fff 44%, #fff 56%, transparent 56%),
    var(--run-cancelled);
}
/* The legend is the count too: one line a band, label left, "6 sur 10" right. */
.tr-legend { margin: 0; }
.rows.tr-legend li,
.rows.tr-legend li:first-child,
.rows.tr-legend li:last-child {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  font-size: 15px;
}
.tr-legend .k {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.tr-key { flex: none; display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.tr-legend span:last-child { color: var(--muted); white-space: nowrap; }
.tr-legend b { font-weight: 700; color: var(--ink); }

.tr-more h2 { margin-bottom: 16px; }

/* The hub: every route, the busiest first. */
.tr-hub { padding-bottom: var(--section-gap); }
.tr-hub .hub-group h2, .tr-dir h2 { display: flex; align-items: baseline; gap: 10px; }
.tr-dir h2 { margin-bottom: 16px; }
.tr-count { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--muted); }
