/* School bus route map (Hours page, Sabotsy Namehana page). Theme tokens only.
   Markup: <div class="busmap" data-busmap data-route="1|2"> ; script: assets/lhf-busmap.js */
.busmap {
  display: grid;
  gap: var(--s-5);
  align-items: start;
  margin-top: var(--s-6);
}
@media (min-width: 900px) { .busmap { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-6); } }

.busmap-map {
  position: relative;
  border: 2px solid var(--c-ink);
  border-radius: 18px;
  background: var(--c-sun-wash);
  box-shadow: 0 6px 0 var(--c-ink);
  overflow: hidden;
}
.busmap-svg { display: block; width: 100%; height: auto; font-family: var(--font-body); }

/* background: real main roads (OpenStreetMap), RN3, lake, landmarks */
.bm-street { fill: none; stroke: var(--c-rule); stroke-width: 2; opacity: .7; stroke-linecap: round; stroke-linejoin: round; }
.bm-rn { fill: none; stroke: var(--c-sun); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; opacity: .45; }
.bm-water { fill: var(--c-soft-on-blue); stroke: var(--c-blue); stroke-width: 1.5; }
.bm-mark { fill: var(--c-ink-soft); font: italic 400 14px var(--font-body); paint-order: stroke; stroke: var(--c-paper); stroke-width: 5px; stroke-linejoin: round; }
.bm-mark--water { fill: var(--c-blue-ink); }
.bm-ico ellipse { fill: var(--c-paper); stroke: var(--c-ink-soft); stroke-width: 2; }
.bm-rn-tag rect { fill: var(--c-white); stroke: var(--c-ink); stroke-width: 2; }
.bm-rn-tag text { fill: var(--c-ink); font: 700 13px var(--font-body); }
.bm-arrow path { fill: none; stroke: var(--c-ink-soft); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.bm-arrow text { fill: var(--c-ink-soft); font: 700 14px var(--font-body); }
.bm-north path { fill: var(--c-ink); }
.bm-north text { fill: var(--c-ink); font: 700 15px var(--font-body); }

/* road: red/white kerb, asphalt, racing line */
.bm-road path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.bm-kerb-w { stroke: var(--c-white); stroke-width: 12; }
.bm-kerb-r { stroke: var(--c-red); stroke-width: 12; stroke-dasharray: 6 6; }
.bm-asphalt { stroke: var(--c-ink); stroke-width: 7.5; }
.bm-line { stroke-width: 1.8; stroke-dasharray: 5 4; }
.bm-r1 .bm-line { stroke: var(--c-sun); }
.bm-r2 .bm-line { stroke: var(--c-soft-on-blue); }
.bm-road, .bm-stop, .bm-bus { transition: opacity .35s var(--ease); }
.busmap[data-route="1"] .bm-r2:not(.bm-r1),
.busmap[data-route="2"] .bm-r1:not(.bm-r2) { opacity: .28; }
/* With the script, only the chosen route is drawn: the map stays calm. */
.busmap.is-live[data-route="1"] .bm-r2:not(.bm-r1),
.busmap.is-live[data-route="2"] .bm-r1:not(.bm-r2) { opacity: 0; visibility: hidden; }
.busmap:not(.is-live) .bm-bus { display: none; }
.busmap[data-route="1"] .bm-num--r2,
.busmap[data-route="2"] .bm-num--r1 { display: none; }

/* start / finish */
.bm-checkbar { stroke: var(--c-ink); stroke-width: 2; }
.bm-w { fill: var(--c-white); }
.bm-k { fill: var(--c-ink); }
.bm-pole { stroke: var(--c-ink); stroke-width: 3; stroke-linecap: round; }
.bm-flag { fill: var(--c-red); stroke: var(--c-ink); stroke-width: 2; stroke-linejoin: round; }
.bm-tag { fill: var(--c-ink); font: 700 16px var(--font-body); paint-order: stroke; stroke: var(--c-paper); stroke-width: 6px; stroke-linejoin: round; }
.bm-tag--finish { font-family: var(--font-display); font-weight: 400; font-size: 18px; }
.bm-tag--time { fill: var(--c-red-ink); }
.bm-lh-body { fill: var(--c-white); stroke: var(--c-ink); stroke-width: 2.5; stroke-linejoin: round; }
.bm-lh-stripe { fill: var(--c-red); }
.bm-lh-lamp { fill: var(--c-sun); stroke: var(--c-ink); stroke-width: 2.5; }
.bm-lh-base { stroke: var(--c-ink); stroke-width: 3; stroke-linecap: round; }

/* stops: coins */
.bm-coin { fill: var(--c-sun); stroke: var(--c-ink); stroke-width: 2.2; transition: transform .2s var(--ease); transform-box: fill-box; transform-origin: center; }
.bm-num { fill: var(--c-ink); font: 700 13px var(--font-body); pointer-events: none; }
.bm-stopname { fill: var(--c-ink); font: 700 14px var(--font-body); paint-order: stroke; stroke: var(--c-paper); stroke-width: 6px; stroke-linejoin: round; }
.bm-stop.is-hot .bm-coin { transform: scale(1.35); fill: var(--c-white); }
/* The bus has arrived at this stop: the coin pops, like a coin picked up. */
.bm-stop.is-here .bm-coin { animation: bm-pop .6s var(--ease) both; fill: var(--c-white); }
@keyframes bm-pop { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 70% { transform: scale(1.2); } 100% { transform: scale(1.3); } }
.bm-li.is-here { font-weight: 700; }
.bm-li.is-here::before { background: var(--c-white); animation: bm-pop .6s var(--ease) both; }

/* bus (top-down minibus, the school's red one) */
.bm-bus-body { fill: var(--c-red); stroke: var(--c-ink); stroke-width: 2; }
.bm-bus-in { transform: scale(.78); }
.bm-bus-glass { fill: var(--c-soft-on-blue); stroke: var(--c-ink); stroke-width: 1.5; }
.bm-bus-roof { fill: var(--c-white); opacity: .85; }
.bm-bus-shadow { fill: var(--c-ink); opacity: .25; }

/* side panel */
.bm-toggle { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bm-btn {
  display: inline-flex; align-items: center; gap: .55em;
  min-height: 48px; padding: 0 1.1em;
  border: 2px solid var(--c-ink); border-radius: 999px;
  background: var(--c-white); color: var(--c-ink);
  font: 700 var(--fs-btn) var(--font-body);
  box-shadow: 0 3px 0 var(--c-ink);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background-color var(--dur-fast) linear;
}
.bm-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--c-ink); }
.bm-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--c-ink); }
.bm-btn[aria-pressed="true"] { background: var(--c-ink); color: var(--c-white); }
.bm-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--c-ink); flex: none; }
.bm-dot--r1, .bm-route--r1 .bm-dot { background: var(--c-sun); }
.bm-dot--r2, .bm-route--r2 .bm-dot { background: var(--c-soft-on-blue); }
.bm-btn[aria-pressed="true"] .bm-dot { border-color: var(--c-white); }

.bm-routes { margin-top: var(--s-4); }
.bm-route-title { display: flex; align-items: center; gap: .5em; margin: 0 0 var(--s-2); font-size: var(--fs-lead); }
.bm-stops { margin: 0; padding: 0; list-style: none; counter-reset: bm; }
.bm-li { position: relative; padding: 6px 0 6px 40px; border-bottom: 1px solid var(--c-rule); }
.bm-li:not(.bm-li--end) { counter-increment: bm; cursor: default; }
.bm-li::before {
  content: counter(bm);
  position: absolute; left: 0; top: 50%; translate: 0 -50%;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-sun); border: 2px solid var(--c-ink);
  font-weight: 700; font-size: 14px; line-height: 1;
}
.bm-li--end::before { content: ""; background: repeating-conic-gradient(var(--c-ink) 0 25%, var(--c-white) 0 50%) 0 0 / 10px 10px; }
.bm-li--end { font-weight: 700; }
.bm-li.is-hot::before { background: var(--c-white); }
/* With the script, only the chosen route's list shows; without it, both lists stay visible. */
.busmap.is-live[data-route="1"] .bm-route--r2,
.busmap.is-live[data-route="2"] .bm-route--r1 { display: none; }
.busmap:not(.is-live) .bm-toggle { display: none; }
.busmap:not(.is-live) .bm-route + .bm-route { margin-top: var(--s-4); }
.bm-note { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--c-ink-soft); }

@media (max-width: 599.98px) {
  .bm-stopname { font-size: 18px; stroke-width: 6px; }
  .bm-tag { font-size: 19px; }
  .bm-mark:not(.bm-mark--water), .bm-ico { display: none; }
  .bm-mark--water { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-road, .bm-stop, .bm-bus, .bm-coin, .bm-btn { transition: none; }
  .bm-stop.is-here .bm-coin, .bm-li.is-here::before { animation: none; }
}
@media print { .bm-bus, .bm-toggle { display: none; } }

/* "Do you live further away?" — the home pick-up offer, under the stop list */
.bm-callout {
  margin-top: var(--s-5); padding: var(--s-5);
  border: 2px solid var(--c-ink); border-radius: 18px;
  background: var(--c-sun); color: var(--c-ink);
  box-shadow: 0 6px 0 var(--c-ink);
}
.bm-callout h3 { margin: 0 0 var(--s-2); }
.bm-callout p { margin: 0; }
.bm-callout .actions { margin-top: var(--s-4); }
