/* ==========================================================================
   Road Ahead — trucker companion
   Palette is MUTCD highway signage, used semantically:
     guide green  = navigation / where things are
     work orange  = construction, lanes taken away
     warn yellow  = posted limits a truck must obey
   ========================================================================== */

:root {
  --ink:        #11171C;   /* asphalt at dusk */
  --ink-2:      #19222A;   /* raised surface */
  --ink-3:      #223039;   /* hairlines */
  --guide:      #05663B;   /* FHWA guide sign green */
  --guide-deep: #034027;
  --zone:       #E8720C;   /* work zone orange */
  --warn:       #F2C94C;   /* advisory yellow */
  --paint:      #F1F4EE;   /* road paint white */
  --paint-dim:  #9EAcB4;
  --reflect:    #7FD3AD;   /* retroreflective mint */
  --service:    #10428F;   /* MUTCD blue — motorist services */
  --service-deep: #0A2E66;
  --alarm:      #C43A22;   /* incident red */

  --sans:  "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --sign:  "Overpass", "Helvetica Neue", Arial, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --gap:   clamp(0.85rem, 2.6vw, 1.35rem);
  --round: 3px;            /* signs have barely any radius */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paint);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: 2rem;
}

button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 3px solid var(--reflect);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------- masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  padding: var(--gap);
  border-bottom: 1px solid var(--ink-3);
}

.masthead__mark { display: flex; align-items: center; gap: 0.6rem; }

/* Interstate shield, drawn in CSS rather than shipped as an image. */
.masthead__shield {
  font-family: var(--sign);
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--paint);
  background: var(--guide);
  border: 2px solid var(--paint);
  border-radius: 4px 4px 10px 10px;
  padding: 0.28rem 0.42rem 0.34rem;
  line-height: 1;
}

.masthead__name {
  font-family: var(--sign);
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
}

.tabs { display: flex; gap: 2px; }

.tab {
  font-family: var(--sign);
  font-weight: 600;
  font-size: 0.83rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.5rem 0.95rem;
  background: transparent;
  color: var(--paint-dim);
  border: 1px solid var(--ink-3);
  border-radius: var(--round);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.tab:hover { color: var(--paint); }
.tab--on {
  background: var(--guide);
  border-color: var(--guide);
  color: var(--paint);
}

/* ------------------------------------------------------------------ ticker */
.strip {
  border-bottom: 1px solid var(--ink-3);
  background: var(--ink-2);
  overflow-x: auto;
  scrollbar-width: none;
  /* Fade the trailing edge so a clipped gauge reads as "swipe" not "broken". */
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent 100%);
  mask-image: linear-gradient(to right, #000 88%, transparent 100%);
}
@media (min-width: 900px) {
  .strip { -webkit-mask-image: none; mask-image: none; }
}
.strip::-webkit-scrollbar { display: none; }

.strip__rail {
  display: flex;
  gap: 0;
  min-width: max-content;
}

.strip__idle {
  padding: 0.7rem var(--gap);
  color: var(--paint-dim);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.gauge {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.65rem var(--gap);
  border-right: 1px solid var(--ink-3);
  white-space: nowrap;
}
.gauge__label {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--paint-dim);
}
.gauge__value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.98rem;
}
.gauge__value--up   { color: var(--zone); }
.gauge__value--down { color: var(--reflect); }
.gauge__detail {
  font-size: 0.68rem;
  color: var(--paint-dim);
  font-family: var(--mono);
}

/* -------------------------------------------------------------------- view */
.view {
  display: none;
  max-width: 940px;
  margin: 0 auto;
  padding: var(--gap);
}
.view--on { display: block; }

/* ------------------------------------------------------------------ finder */
.finder {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: var(--gap);
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--round);
}

.finder__row { display: flex; gap: 0.6rem; align-items: flex-end; flex-wrap: wrap; }
.finder__row--opts { gap: 0.9rem; }

.field { display: flex; flex-direction: column; gap: 0.28rem; }
.field--grow { flex: 1 1 14rem; }
.field--tight { flex: 0 0 auto; }

.field__label {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--paint-dim);
}

.field__input,
.field__select {
  background: var(--ink);
  border: 1px solid var(--ink-3);
  border-radius: var(--round);
  padding: 0.62rem 0.7rem;
  min-height: 44px;
  width: 100%;
}
.field__input::placeholder { color: #5E6E78; }
.field__input:focus, .field__select:focus { border-color: var(--reflect); }

.finder__go {
  font-family: var(--sign);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--zone);
  color: #1A1005;
  border: none;
  border-radius: var(--round);
  padding: 0 1.5rem;
  min-height: 44px;
  cursor: pointer;
  transition: filter .15s;
}
.finder__go:hover { filter: brightness(1.1); }
.finder__go[disabled] { opacity: 0.55; cursor: wait; }

.switch { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.85rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__box {
  width: 20px; height: 20px;
  border: 2px solid var(--ink-3);
  border-radius: 2px;
  background: var(--ink);
  flex: 0 0 auto;
  position: relative;
}
.switch input:checked + .switch__box {
  background: var(--warn);
  border-color: var(--warn);
}
.switch input:checked + .switch__box::after {
  content: "";
  position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #1A1005;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(42deg);
}
.switch input:focus-visible + .switch__box { outline: 3px solid var(--reflect); outline-offset: 2px; }

.place {
  margin: 1rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--paint-dim);
}

/* ============================ THE SIGN CARD ==============================
   Each result is a highway guide sign: green panel, mile-marker tab on the
   left, orange band when lanes are gone, yellow when a limit is posted.
   ======================================================================== */
.signs { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.9rem; }

.sign {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  background: var(--guide);
  border: 2px solid rgba(241,244,238,.28);
  border-radius: var(--round);
  overflow: hidden;
  animation: raise .34s ease both;
}

@keyframes raise {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* Mile-marker tab: the distance, set like a roadside post. */
.sign__mile {
  background: var(--guide-deep);
  border-right: 2px solid rgba(241,244,238,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.85rem 0.4rem;
}
.sign__num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.32rem;
  line-height: 1;
}
.sign__unit {
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--reflect);
}

.sign__body { padding: 0.8rem 0.95rem; min-width: 0; }

.sign__road {
  font-family: var(--sign);
  font-weight: 800;
  font-size: 1.14rem;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.sign__dir {
  font-family: var(--sign);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--reflect);
  margin-top: 0.1rem;
}
.sign__desc {
  margin: 0.45rem 0 0;
  font-size: 0.87rem;
  color: rgba(241,244,238,.9);
  overflow-wrap: anywhere;
}

.sign__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }

.tag {
  font-family: var(--sign);
  font-weight: 600;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.22rem 0.5rem;
  border-radius: 2px;
  background: rgba(0,0,0,.28);
  color: rgba(241,244,238,.92);
}
.tag--closed { background: var(--zone); color: #1A1005; }
.tag--limit  { background: var(--warn); color: #1A1005; }

.sign__when {
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(241,244,238,.22);
  font-family: var(--mono);
  font-size: 0.71rem;
  color: rgba(241,244,238,.72);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
}

.sign--closed { border-color: var(--zone); }
.sign--limit  { border-color: var(--warn); }

/* ------------------------------------------------------------------- shows */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

.chip {
  font-family: var(--sign);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid var(--ink-3);
  border-radius: 20px;
  color: var(--paint-dim);
  cursor: pointer;
}
.chip:hover { color: var(--paint); }
.chip--on { background: var(--reflect); border-color: var(--reflect); color: #06231A; }

.shows { display: grid; gap: 0.7rem; }

.show {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 0.9rem;
  padding: 0.9rem;
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--round);
}
.show--followed { border-left: 4px solid var(--reflect); }

.show__art {
  width: 68px; height: 68px;
  border-radius: 2px;
  object-fit: cover;
  background: var(--ink-3);
}

.show__head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: flex-start; }

.show__title {
  font-family: var(--sign);
  font-weight: 800;
  font-size: 1.02rem;
  margin: 0;
  line-height: 1.25;
}
.show__by { font-size: 0.76rem; color: var(--paint-dim); margin: 0.1rem 0 0; }
.show__blurb { font-size: 0.86rem; margin: 0.45rem 0 0; color: rgba(241,244,238,.86); }

.show__latest {
  margin: 0.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--paint-dim);
  overflow-wrap: anywhere;
}
.show__latest b { color: var(--reflect); font-weight: 600; }

.show__links { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }

.plat {
  font-family: var(--sign);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 0.42rem 0.75rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--round);
  background: var(--ink);
  border: 1px solid var(--ink-3);
  color: var(--paint);
}
.plat:hover { border-color: var(--reflect); color: var(--reflect); }

.follow {
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--ink-3);
  border-radius: var(--round);
  color: var(--paint-dim);
  font-family: var(--sign);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.6rem;
  min-height: 36px;
  cursor: pointer;
}
.follow--on { background: var(--reflect); border-color: var(--reflect); color: #06231A; }

/* ------------------------------------------------------------ empty / misc */
.blank {
  padding: 2rem 1rem;
  text-align: center;
  border: 1px dashed var(--ink-3);
  border-radius: var(--round);
}
.blank__lead { font-family: var(--sign); font-weight: 600; font-size: 1rem; margin: 0; }
.blank__sub  { color: var(--paint-dim); font-size: 0.86rem; margin: 0.4rem auto 0; max-width: 38ch; }

.note {
  padding: 0.8rem 0.95rem;
  border-left: 4px solid var(--warn);
  background: var(--ink-2);
  border-radius: var(--round);
  font-size: 0.86rem;
}
.note--bad { border-left-color: var(--zone); }

.verify {
  margin-top: 1.1rem;
  font-size: 0.76rem;
  color: var(--paint-dim);
  border-top: 1px solid var(--ink-3);
  padding-top: 0.7rem;
}

.colophon {
  max-width: 940px;
  margin: 1.5rem auto 0;
  padding: 0 var(--gap);
  font-size: 0.7rem;
  color: #64757F;
}
.colophon p { margin: 0.3rem 0; }
.colophon__stamp { font-family: var(--mono); }

/* ------------------------------------------------------------ small screens */
@media (max-width: 560px) {
  .sign { grid-template-columns: 3.9rem 1fr; }
  .show { grid-template-columns: 54px 1fr; gap: 0.7rem; }
  .show__art { width: 54px; height: 54px; }
  .finder__go { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}


/* ======================= PARKING & INCIDENTS ==========================
   MUTCD reserves blue for motorist services, so parking signs are blue
   while roadwork stays green. The colour is doing the same job on screen
   that it does on the shoulder.
   ==================================================================== */

.finder__go--blue { background: var(--service); color: var(--paint); }

/* Incidents are happening now, so they get the alarm colour and lead the list. */
.sign--incident { background: var(--alarm); border-color: rgba(241,244,238,.4); }
.sign--incident .sign__mile { background: rgba(0,0,0,.28); border-right-color: rgba(241,244,238,.3); }
.sign--incident .sign__dir  { color: #FFD9CF; }
.tag--now { background: var(--paint); color: #5A160A; }

/* --- parking lot card --- */
.lot {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  background: var(--service);
  border: 2px solid rgba(241,244,238,.28);
  border-radius: var(--round);
  overflow: hidden;
  animation: raise .34s ease both;
}
.lot--full    { border-color: var(--zone); }
.lot--low     { border-color: var(--warn); }
.lot--unknown { opacity: .78; }

.lot__count {
  background: var(--service-deep);
  border-right: 2px solid rgba(241,244,238,.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.85rem 0.4rem;
  text-align: center;
}
.lot__num {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.7rem;
  line-height: 1;
}
.lot__num--word { font-size: .95rem; letter-spacing: .04em; }
.lot__num--full { color: var(--zone); }
.lot__num--low  { color: var(--warn); }
.lot__cap {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #A9C4EE;
}

.lot__body { padding: 0.8rem 0.95rem; min-width: 0; }
.lot__name {
  font-family: var(--sign);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.22;
  margin: 0;
}
.lot__where {
  font-family: var(--sign);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #A9C4EE;
  margin: 0.15rem 0 0;
}
.lot__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; }
.tag--trend  { background: rgba(255,255,255,.16); }
.tag--filling { background: var(--warn); color: #1A1005; }
.tag--private { background: rgba(0,0,0,.3); }

.lot__when {
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(241,244,238,.22);
  font-family: var(--mono);
  font-size: 0.71rem;
  color: rgba(241,244,238,.75);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
}

@media (max-width: 560px) {
  .lot { grid-template-columns: 4.6rem 1fr; }
  .lot__num { font-size: 1.45rem; }
}
