/* ==========================================================================
   Traffic hub + corridor pages: live sections
   "Conditions now" strip, corridor camera strip, drive-time buttons,
   status banner states, tight hero.
   Loaded on /traffic/ and its nine corridor pages only.
   ========================================================================== */

/* ---------- Tight hero: sized by its text, so live content starts sooner ---------- */
.hero.hero--tight {
  min-height: 0;
  padding: 44px 24px;
}
.hero.hero--tight h1 { margin-bottom: 10px; }
.hero.hero--tight .hero-sub { margin-bottom: 0; }
.hero.hero--tight .hero-sub + .hero-sub { margin-top: 6px !important; }
@media (max-width: 768px) {
  .hero.hero--tight { padding: 28px 20px; }
  .hero.hero--tight h1 { font-size: 1.9em; }
  .hero.hero--tight .hero-sub { font-size: 0.95em; }
}

/* ---------- Corridor status banner ----------
   Green is #15803d (5.0:1 with white text; the theme green was 3.3:1).
   Amber = a weather warning is in effect. Grey = loading or not loading. */
.corridor-status-banner.corridor-status--clear,
.corridor-status-banner.corridor-status--warning { background: #15803d; }
.corridor-status-banner.corridor-status--advisory { background: #92400e; }
.corridor-status-banner.corridor-status--error { background: #475569; }
.corridor-status-banner.corridor-status--error .corridor-status-dot { animation: none; opacity: 0.6; }

/* ---------- Conditions now ---------- */
.cond-section {
  padding-top: 32px;
  padding-bottom: 32px;
}
.cond-title {
  font-size: clamp(1.35em, 2.6vw, 1.8em);
  margin-bottom: 14px;
}
.cond-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cond-body {
  min-height: 150px; /* holds the space while a refresh swaps the rows */
}
.cond-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}
.cond-sep {
  color: var(--color-light);
  margin: 0 2px;
}
.cond-label {
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-muted);
  margin: 0 0 8px;
}

/* Warning row: the level is always in the words; colour repeats it. */
.cond-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #1a1a1a;
  font-size: 0.98em;
  line-height: 1.45;
  border-left: 6px solid #a16207;
  background: #fefce8;
}
.cond-warning--yellow { background: #fef9c3; border-left-color: #a16207; }
.cond-warning--orange { background: #ffedd5; border-left-color: #c2410c; }
.cond-warning--red    { background: #fee2e2; border-left-color: #b91c1c; }
.cond-warning-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-weight: 800;
  font-size: 0.85em;
  line-height: 22px;
  text-align: center;
}
.cond-warning a { color: #1a1a1a; font-weight: 600; text-decoration: underline; white-space: nowrap; }
.cond-nowarn {
  color: var(--color-body);
  font-size: 0.92em;
  background: var(--color-bg);
}

/* Weather */
.cond-now {
  font-size: 1.08em;
  color: var(--color-dark);
  line-height: 1.5;
  margin: 0;
}
.cond-asof {
  display: block;
  font-size: 0.8em;
  color: var(--color-muted);
  margin-top: 2px;
}
.cond-forecast {
  margin: 8px 0 0;
  font-size: 0.95em;
  color: var(--color-body);
  line-height: 1.5;
}
.cond-forecast strong { color: var(--color-dark); }
.cond-missing, .cond-missing a { color: var(--color-body); }
.cond-missing a { font-weight: 600; text-decoration: underline; }

/* Road surface */
.cond-roads-lead,
.cond-summary,
.cond-city p,
.cond-city-line {
  margin: 0 0 10px;
  color: var(--color-dark);
  line-height: 1.5;
  font-size: 0.98em;
}
.cond-roads-lead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cond-city-line { margin-top: 14px; color: var(--color-body); }

/* Chips. Each text/background pair is at least 4.5:1. */
.cond-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.82em;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.cond-chip--s0   { background: #dcfce7; color: #14532d; border-color: #86efac; }
.cond-chip--s1   { background: #e0f2fe; color: #0c4a6e; border-color: #7dd3fc; }
.cond-chip--s2   { background: #fef9c3; color: #713f12; border-color: #fde047; }
.cond-chip--s3   { background: #ffedd5; color: #7c2d12; border-color: #fdba74; }
.cond-chip--s4   { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.cond-chip--none { background: #f1f5f9; color: #334155; border-color: #cbd5e1; }

.cond-sections { margin-top: 4px; }
.cond-sections summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92em;
  color: var(--color-primary-hover);
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.cond-sections summary::-webkit-details-marker { display: none; }
.cond-sections summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 6px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s;
}
.cond-sections[open] summary::before { transform: rotate(90deg); }
.cond-section-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cond-section-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
}
.cond-section-name {
  font-weight: 600;
  color: var(--color-dark);
  font-size: 0.95em;
}
a.cond-section-name { color: var(--color-primary-hover); text-decoration: underline; }
.cond-section-more {
  grid-column: 1 / -1;
  font-size: 0.84em;
  color: var(--color-body);
  line-height: 1.45;
}
.cond-section-more a { color: var(--color-primary-hover); font-weight: 600; text-decoration: underline; }
.cond-beyond-title {
  font-size: 0.9em;
  font-weight: 700;
  color: var(--color-dark);
  margin: 16px 0 2px;
}

/* City snow links: outline buttons */
.cond-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cond-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1.5px solid var(--color-primary);
  border-radius: 10px;
  color: var(--color-primary-hover);
  background: #fff;
  font-weight: 600;
  font-size: 0.92em;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.cond-btn:hover { background: var(--color-primary); color: #fff; }

/* Sources line */
.cond-sources {
  margin: 0;
  padding: 12px 18px;
  font-size: 0.8em;
  color: var(--color-body);
  line-height: 1.5;
  background: var(--color-bg);
}
.cond-sources a { color: var(--color-body); text-decoration: underline; }

/* Jump links under the strip */
.cond-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.cond-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-dark);
  font-weight: 600;
  font-size: 0.9em;
  text-decoration: none;
}
.cond-jump a:hover { border-color: var(--color-primary); color: var(--color-primary-hover); }

.cond-card a:focus-visible,
.cond-jump a:focus-visible,
.cond-sections summary:focus-visible,
.drive-btn:focus-visible,
.drive-waze:focus-visible,
.cam-strip-card:focus-visible,
.cam-strip:focus-visible,
.cam-strip-resume:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

/* ---------- Corridor camera strip ---------- */
.corridor-cams { padding-top: 40px; padding-bottom: 40px; }
.corridor-cams .section-header { margin-bottom: 20px; }
.corridor-cams--empty { padding-top: 20px; padding-bottom: 20px; }
.corridor-cams-none a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--color-primary-hover);
}
.cam-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 14px;
  margin: 0 -4px;
  scrollbar-width: thin;
}
.cam-strip-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  /* a <button> wearing the .camera-card look. A button centres its content
     vertically, so cards with a shorter caption sat lower than their
     neighbours; the column layout pins every image to the top. */
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
}
.cam-strip-card .camera-card-img-wrap { display: block; }
.cam-strip-card .camera-card-img {
  height: auto;
  background: linear-gradient(90deg, var(--color-bg) 25%, #edf2f7 50%, var(--color-bg) 75%);
  background-size: 200% 100%;
}
.cam-strip-card .camera-card-location { display: block; white-space: normal; }
.cam-strip-fail {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.88em;
  font-weight: 600;
  text-align: center;
}
.cam-strip-fail[hidden] { display: none; }
.cam-strip-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}
.cam-strip-credit {
  font-size: 0.8em;
  color: var(--color-body);
}
.cam-strip-resume {
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.92em;
  cursor: pointer;
}
.cam-strip-resume:hover { background: var(--color-primary-hover); }
@media (max-width: 560px) {
  .cam-strip-card { flex-basis: 78vw; }
}
@media (prefers-reduced-motion: reduce) {
  .cam-strip-card .camera-card-img { animation: none; }
  .cam-strip-card:hover { transform: none; }
}

/* ---------- Your commute ---------- */
.drive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.drive-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drive-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-height: 64px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-hover);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.drive-btn:hover { background: var(--color-primary-deep); transform: translateY(-1px); }
.drive-btn-label { font-weight: 700; font-size: 1.02em; line-height: 1.3; }
.drive-btn-sub { font-size: 0.84em; opacity: 0.92; }
.drive-waze {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--color-primary-hover);
  text-decoration: underline;
}
.drive-peak-title {
  font-size: 1.05em;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0 0 12px;
}
.corridor-peak-grid.corridor-peak-grid--fit {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.corridor-peak-grid--fit .corridor-peak-card { padding: 18px 14px; }

/* ---------- Sources strip on corridor pages ---------- */
.corridor-sources-section { padding-top: 0; padding-bottom: 40px; }
.corridor-sources-section .about-strip { margin-top: 0; }
.about-strip-text a { color: inherit; text-decoration: underline; }

/* ---------- Hub ---------- */
.traffic-hub-sources { padding-top: 48px; }
.section-eyebrow .updated:empty { display: none; }
