/* Buses and trains near you (travel-map.js). One shared file: PostcodeGo's
   src/assets/css/travel-map.css and the Go towns' core copy are the same; keep them in step.
   Colours come from the site's own tokens, with fallbacks. */
.tmap {
  --tm-ink: var(--colour-ink, #13294b);
  --tm-muted: var(--colour-ink-muted, #4a5568);
  --tm-surface: var(--colour-surface, #fff);
  --tm-sunk: var(--colour-sunk, #e8ebf0);
  --tm-bus: #13294b;
  --tm-rail: #0f6b3f;
  --tm-gold: #f2b134;
  --tm-live: #0f6b3f;
  margin: 0 0 2rem;
}

.tmap__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}

.tmap__where {
  flex: 1 1 12rem;
  margin: 0;
  color: var(--tm-ink);
  font-weight: 700;
}

.tmap__pcform,
.tmap__plan {
  display: flex;
  gap: 0.4rem;
}

.tmap__plan {
  margin: 0 0 0.5rem;
}

.tmap__pc {
  min-width: 0;
  flex: 1 1 10rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #8a94a6;
  border-radius: 0.5rem;
  background: var(--tm-surface);
  color: var(--tm-ink);
  font: inherit;
}

.tmap__btn,
.tmap__more,
.tmap__chip,
.tmap__star {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--tm-ink);
  border-radius: 999px;
  background: var(--tm-surface);
  color: var(--tm-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tmap__btn--go {
  border-color: var(--tm-gold);
  background: var(--tm-gold);
  color: #1b1a12;
}

.tmap__btn:focus-visible,
.tmap__more:focus-visible,
.tmap__chip:focus-visible,
.tmap__star:focus-visible,
.tmap__stopbtn:focus-visible,
.tmap__close:focus-visible {
  outline: 3px solid var(--tm-gold);
  outline-offset: 2px;
}

.tmap__body {
  display: grid;
  gap: 1rem;
}

.tmap__map {
  height: 22rem;
  border-radius: 0.75rem;
  background: var(--tm-sunk);
  box-shadow: 0 1px 0 rgb(0 0 0 / 8%), 0 6px 18px rgb(19 41 75 / 12%);
  overflow: hidden;
  z-index: 0;
}

@media (min-width: 64rem) {
  .tmap__body {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }

  .tmap__map {
    position: sticky;
    top: 1rem;
    height: 34rem;
  }
}

.tmap__side {
  min-width: 0;
}

.tmap__h {
  margin: 1rem 0 0.4rem;
  color: var(--tm-ink);
  font-size: 1.15rem;
}

.tmap__side > .tmap__h:first-of-type {
  margin-top: 0;
}

.tmap__h--pick {
  margin: 0;
}

.tmap__muted {
  color: var(--tm-muted);
  font-size: 0.9rem;
}

.tmap__status {
  margin: 0 0 0.4rem;
}

.tmap__deps {
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

.tmap__dep {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--tm-sunk);
}

.tmap__dep.is-missed .tmap__to strong,
.tmap__dep.is-missed .tmap__leave {
  color: var(--tm-muted);
}

.tmap__dep.is-cancelled strong {
  text-decoration: line-through;
}

.tmap__to {
  display: grid;
  min-width: 0;
}

.tmap__to strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tmap__to span {
  overflow-wrap: anywhere;
}

.tmap__line {
  display: inline-block;
  padding: 0.2rem 0.3rem;
  border-radius: 0.35rem;
  background: var(--tm-bus);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.tmap__line--rail {
  background: var(--tm-rail);
}

.tmap__due {
  color: var(--tm-ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tmap__due.is-live {
  color: var(--tm-live);
}

.tmap__due.is-live::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 0.1em;
}

.tmap__more {
  margin: 0.25rem 0 0.5rem;
}

.tmap__tabs {
  display: inline-flex;
  margin: 0 0 0.75rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--tm-sunk);
}

.tmap__tab {
  padding: 0.45rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--tm-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tmap__tab[aria-pressed="true"] {
  background: var(--tm-ink);
  color: #fff;
}

.tmap__tab:focus-visible {
  outline: 3px solid var(--tm-gold);
  outline-offset: 2px;
}

.tmap__note {
  margin: 0 0 0.25rem;
}

.tmap__leave {
  color: var(--tm-ink);
  font-size: 0.85rem;
  font-weight: 700;
}

/* The picked stop */
.tmap__picked {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--tm-ink);
  border-radius: 0.75rem;
  background: var(--tm-surface);
}

.tmap__pickhead {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.6rem;
  margin: 0 0 0.4rem;
}

.tmap__pickhead p {
  margin: 0.1rem 0 0;
}

.tmap__close {
  padding: 0 0.4rem;
  border: 0;
  background: none;
  color: var(--tm-ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.tmap__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 0;
}

.tmap__star[aria-pressed="true"] {
  border-color: var(--tm-gold);
  background: var(--tm-gold);
  color: #1b1a12;
}

.tmap__stars {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}

.tmap__chip {
  padding: 0.3rem 0.7rem;
  border-color: var(--tm-gold);
  font-size: 0.9rem;
}

/* Pins */
.tmap__pin {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 0.45rem;
  background: var(--tm-bus, #13294b);
  color: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 35%);
  transition: transform 0.15s ease;
}

.tmap__pin svg {
  width: 70%;
  height: 70%;
}

.tmap__pin--rail {
  border-radius: 50%;
  background: var(--tm-rail, #0f6b3f);
}

.tmap__pin.is-starred {
  border-color: var(--tm-gold, #f2b134);
  box-shadow: 0 0 0 2px var(--tm-gold, #f2b134), 0 2px 6px rgb(0 0 0 / 35%);
}

.tmap__pin.is-on {
  transform: scale(1.35);
  box-shadow: 0 0 0 3px var(--tm-gold, #f2b134), 0 4px 10px rgb(0 0 0 / 40%);
}

.tmap__pin.is-static {
  width: 2rem;
  height: 2rem;
}

.tmap__youdot {
  display: block;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1c6fd1;
  box-shadow: 0 0 0 6px rgb(28 111 209 / 25%);
}

@media (prefers-reduced-motion: reduce) {
  .tmap__pin {
    transition: none;
  }
}

/* Every stop as a list, for anyone not using the map */
.tmap__all {
  margin: 1rem 0 0;
}

.tmap__all summary {
  color: var(--tm-ink);
  font-weight: 700;
  cursor: pointer;
}

.tmap__stoplist {
  display: grid;
  gap: 0.3rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .tmap__stoplist {
    grid-template-columns: 1fr 1fr;
  }
}

.tmap__stopbtn {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0 0.6rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--tm-sunk);
  border-radius: 0.5rem;
  background: var(--tm-surface);
  color: var(--tm-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tmap__stopbtn .tmap__line {
  grid-row: span 2;
  align-self: center;
}

.tmap__credit {
  margin: 0.75rem 0 0;
  color: var(--tm-muted);
  font-size: 0.85rem;
}

/* Simple layout (data-layout="simple", PostcodeGo's near-you page): the next departures first,
   the map beside them on a wide screen and under them on a phone, the rest under "More". */
.tmap--simple {
  display: grid;
  gap: 1rem;
}

.tmap--simple .tmap__btn {
  padding: 0.7rem 1.1rem;
  border-color: var(--tm-gold);
  background: var(--tm-gold);
  color: #1b1a12;
}

.tmap--simple .tmap__where {
  font-size: 1.1rem;
}

.tmap--simple .tmap__soon .tmap__h {
  margin-top: 0;
  font-size: 1.35rem;
}

.tmap--simple .tmap__map {
  height: 18rem;
}

.tmap--simple .tmap__picked {
  margin-top: 0.75rem;
}

.tmap--simple .tmap__all .tmap__tabs {
  margin-top: 0.75rem;
}

@media (min-width: 64rem) {
  .tmap--simple {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    align-items: start;
  }

  .tmap--simple .tmap__tools,
  .tmap--simple .tmap__all {
    grid-column: 1 / -1;
  }

  .tmap--simple .tmap__map {
    height: 30rem;
  }
}
