/*
 * Homepage "Walkable, Bikeable" section (template-homepage.php #walkbike,
 * built by assets/walkbike-nearest.js). Loads after home.css, so brand
 * tokens, section padding and .section-head come from there.
 *
 * Everything is scoped under .walkbike-section, and its buttons are reset
 * from scratch, because Astra styles every <button> on the page.
 */

.walkbike-section {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --shadow-pin: 0 2px 6px rgba(31, 36, 25, 0.28);
}

/* :where() keeps the hover and focus resets at the same weight as the plain
   one, so the component rules below (two classes) still win in every state. */
.walkbike-section button,
.walkbike-section button:where(:hover, :focus) {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: none;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.walkbike-section button:focus-visible,
.walkbike-section a:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---- Shared parts ---- */

.wv-glass {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--fc-shadow-float);
}
@media (prefers-reduced-transparency: reduce) {
  .wv-glass { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Inline SVG icons (walkbike-nearest.js icon()): 1em tall like the
   Font Awesome glyphs they replace, width set per icon from its viewBox. */
.wv-icon {
  display: inline-block;
  flex: none;
  height: 1em;
  overflow: visible;
  vertical-align: -0.125em;
}

/* Walk / Bike segmented control: sliding thumb under the active option. */
.wv-seg {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  padding: 4px;
  border-radius: var(--fc-radius-pill);
  background: #fff;
  border: 1px solid var(--line);
}
.wv-seg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: var(--fc-radius-pill);
  background: var(--green);
  box-shadow: 0 1px 3px rgba(31, 36, 25, 0.22);
}
.wv-seg.is-ready .wv-seg__thumb { transition: transform 260ms var(--ease-out), width 260ms var(--ease-out); }
.walkbike-section .wv-seg__btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--fc-radius-pill);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: var(--warm-gray);
  transition: color 160ms ease, transform 140ms ease-out;
}
.walkbike-section .wv-seg__btn.is-active { color: #fff; }
.walkbike-section .wv-seg__btn:active { transform: scale(0.96); }
.wv-seg__btn .wv-icon { font-size: 13px; }
.wv-seg--glass {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: var(--fc-shadow-float);
}

.walkbike-section .wv-iconbtn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  box-shadow: var(--fc-shadow-float);
  transition: background-color 160ms ease, color 160ms ease, transform 140ms ease-out, opacity 160ms ease;
}
.walkbike-section .wv-iconbtn:active { transform: scale(0.94); }
.walkbike-section .wv-iconbtn:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .walkbike-section .wv-iconbtn:not(:disabled):hover { background: var(--green); color: #fff; }
}

/* home.css's map pill, moved to the top right, above the card rail. */
.walkbike-section .wv-stage .map-cta-pill { bottom: auto; top: 16px; right: 16px; }
/* Stretches the tap target past the small pill without changing its look. */
.wv-stage .map-cta-pill::before { content: ''; position: absolute; inset: -8px; }

/* ---- Map stage ---- */
.wv-stage {
  position: relative;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
  background: var(--mist-dark);
}
.wv-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.wv-canvas .gm-style { font-family: var(--font-body) !important; }
.wv-svg,
.wv-pins {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: opacity 240ms ease;
}
.wv-svg { pointer-events: none; overflow: visible; }
.wv-pins { z-index: 3; pointer-events: none; }
.wv-pins > * { pointer-events: auto; }
.wv-stage.is-zooming .wv-svg,
.wv-stage.is-zooming .wv-pins { opacity: 0; transition-duration: 100ms; }

.wv-fc {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none !important;
}
.wv-fc span {
  position: absolute;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(31, 36, 25, 0.35);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}

.wv-ring--guide {
  fill: rgba(74, 124, 58, 0.05);
  stroke: rgba(53, 88, 41, 0.5);
  stroke-width: 1.5;
  stroke-dasharray: 2 5;
}
.wv-route {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.1 7;
  opacity: 0;
  transition: opacity 160ms ease;
}
.wv-route.is-on { opacity: 0.85; }
.wv-route-reveal { fill: none; stroke: #fff; stroke-width: 12; stroke-linecap: round; }
.wv-route-tag {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 7;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: var(--fc-shadow-float);
  opacity: 0;
  pointer-events: none !important;
  transition: opacity 160ms ease;
}
.wv-route-tag.is-on { opacity: 1; }
.wv-leader { stroke: rgba(31, 36, 25, 0.45); stroke-width: 1.2; }
.wv-leader-dot { fill: var(--ink); opacity: 0.55; }

/* ---- Pins ----
   .wv-pin is a zero-size anchor at the place's exact pixel (set by JS); the
   badge and label position themselves off it. */
.walkbike-section .wv-pin {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  padding: 0;
  z-index: 2;
}
.wv-pin__badge {
  position: absolute;
  left: -13px;
  top: -13px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  /* Even size, so the square icon centres on whole pixels in the 26px badge. */
  font-size: 12px;
  box-shadow: 0 0 0 2px #fff, var(--shadow-pin);
  transform: scale(1);
  transition: transform 320ms var(--ease-pop), background-color 180ms ease, opacity 200ms ease, box-shadow 180ms ease;
}
/* Tap target well past the visible dot (44px). */
.wv-pin__badge::before {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
}
.wv-pin__label {
  position: absolute;
  left: 19px;
  top: 0;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: var(--fc-shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.wv-pin.is-label-left .wv-pin__label { left: auto; right: 19px; }
.wv-pin.has-label .wv-pin__label { opacity: 1; }
.wv-pin.has-label { z-index: 5; }
.wv-pin__arrow { display: none; }
.wv-pin.is-selected { z-index: 9; }
.wv-pin.is-selected .wv-pin__badge {
  transform: scale(1.3);
  background: var(--ink);
  box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(31, 36, 25, 0.12), 0 4px 12px rgba(31, 36, 25, 0.35);
}
.wv-pin.is-selected .wv-pin__label { left: 25px; font-size: 13px; }
.wv-pin.is-selected.is-label-left .wv-pin__label { left: auto; right: 25px; }
@media (hover: hover) and (pointer: fine) {
  .wv-pin:not(.is-selected):hover .wv-pin__badge { transform: scale(1.18); }
}
.wv-pin:active .wv-pin__badge { transform: scale(0.94); }
/* The pin buttons are zero-size anchors, so the focus ring goes on what you
   can actually see. */
.walkbike-section .wv-pin:focus-visible { outline: none; }
.wv-pin:focus-visible .wv-pin__badge { box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--green); }

@keyframes wv-pop-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* ---- Nearest of each ---- */

.wv-b { max-width: 1280px; margin: 0 auto; }
.wv-b__stage {
  height: 620px;
  border-radius: var(--fc-radius-stage);
  border: 1px solid var(--line);
}
.wv-b__top {
  position: absolute;
  z-index: 12;
  top: 16px;
  left: 16px;
  right: 190px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
/* Bottom left above the cards, level with the arrows on the right (same
   24px inset, centred on the arrows' 38px row). Left a full pill, like every
   other chip floating on the map. It is only a caption, so taps go through
   to the map. */
.wv-b__legend {
  position: absolute;
  z-index: 2;
  left: 24px;
  top: -53px;
  max-width: calc(100% - 160px);
  padding: 9px 14px;
  border-radius: var(--fc-radius-pill);
  pointer-events: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--warm-gray);
}
.wv-guide-tag {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(231, 227, 220, 0.92);
  color: var(--green-dark);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none !important;
  transition: opacity 200ms ease;
}
.wv-guide-tag.is-off { opacity: 0; }
.wv-dot {
  position: absolute;
  left: -5px;
  top: -5px;
  z-index: 1;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 2.5px var(--green);
  animation: wv-pop-in 260ms var(--ease-pop) both;
}
.wv-b.is-moving .wv-pin { transition: transform 300ms var(--ease-out); }
.wv-b .wv-pin.is-edge .wv-pin__badge { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(31, 36, 25, 0.12), var(--shadow-pin); }
.wv-b .wv-pin.is-selected.is-edge .wv-pin__badge { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(31, 36, 25, 0.12), 0 4px 12px rgba(31, 36, 25, 0.35); }
.wv-b .wv-pin.is-edge .wv-pin__arrow {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}
.wv-b .wv-pin.is-edge .wv-pin__arrow::before {
  content: '';
  position: absolute;
  left: 17px;
  top: -5px;
  border-left: 7px solid var(--ink);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.wv-b .wv-pin.is-selected.is-edge .wv-pin__arrow::before { left: 22px; }

.wv-b__rail {
  position: relative;
  z-index: 10;
  margin-top: -128px;
}
.wv-b__track {
  display: flex;
  gap: 12px;
  padding: 0 24px 6px;
  scroll-padding: 0 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.wv-b__track::-webkit-scrollbar { display: none; }
.walkbike-section .wv-b__card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  min-height: 152px;
  padding: 14px 16px;
  border-radius: var(--fc-radius-card);
  background: #fff;
  box-shadow: var(--fc-shadow-raised);
  text-align: left;
  line-height: 1.3;
  color: var(--ink);
  border: 2px solid transparent;
  transition: border-color 180ms ease, transform 140ms ease-out, box-shadow 180ms ease;
}
.walkbike-section .wv-b__card.is-active {
  border-color: var(--ink);
  box-shadow: var(--fc-shadow-hover);
}
.walkbike-section .wv-b__card:active { transform: scale(0.98); }
.wv-b__card-top { display: flex; align-items: center; gap: 9px; }
.wv-b__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 12px;
  transition: background-color 180ms ease, color 180ms ease;
}
.wv-b__card.is-active .wv-b__icon { background: var(--ink); color: #fff; }
.wv-b__kind {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green);
}
.wv-b__idx {
  margin-left: auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--warm-gray);
  font-variant-numeric: tabular-nums;
}
.wv-b__name {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wv-b__detail {
  margin-top: 3px;
  font-size: 13px;
  color: var(--warm-gray);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wv-b__foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.wv-b__time { font-size: 13px; font-weight: 600; color: var(--green-dark); white-space: nowrap; }
.wv-b__time b { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1; }
.wv-b__mode { margin-left: 6px; font-size: 13px; }
.wv-b__more { font-size: 12px; font-weight: 600; color: var(--warm-gray); white-space: nowrap; }
.wv-b__arrows {
  position: absolute;
  z-index: 2;
  right: 24px;
  top: -54px;
  display: flex;
  gap: 8px;
}

/* "Drag to scroll", phones only (the arrows above cover it on wider
   screens). Fades out for good once the row has been swiped. */
.wv-b__swipe {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--warm-gray);
  transition: opacity 300ms ease;
}
.wv-b__swipe .wv-icon { font-size: 12px; color: var(--green); }
.wv-b__swipe.is-gone { opacity: 0; }

@media (max-width: 760px) {
  /* Map pill on phones: shortened to "Full Map" so it fits beside the
     Walk / Bike control, but never reduced to a bare arrow. */
  .walkbike-section .wv-stage .map-cta-pill { top: 12px; right: 12px; padding: 9px 12px; }
  .wv-stage .wv-pill__long { display: none; }

  /* Full-bleed map, one card and a peek of the next. */
  .wv-b { margin: 0 -30px; }
  .wv-b__stage { height: 500px; border-radius: 0; border-left: 0; border-right: 0; }
  .wv-b__top { right: 116px; top: 12px; left: 12px; }
  .wv-b__legend { display: none; }
  .wv-b__rail { margin-top: -106px; }
  .wv-b__track { padding: 0 30px 8px; scroll-padding: 0 30px; }
  .walkbike-section .wv-b__card { flex-basis: calc(100% - 96px); max-width: 320px; min-height: 126px; padding: 12px 14px; }
  .wv-b__icon { width: 24px; height: 24px; font-size: 11px; }
  .wv-b__kind { font-size: 10px; letter-spacing: 1.3px; }
  .wv-b__idx { font-size: 11px; }
  .wv-b__name { margin-top: 8px; font-size: 18px; }
  .wv-b__detail { font-size: 12px; }
  .wv-b__foot { padding-top: 8px; }
  .wv-b__time b { font-size: 22px; }
  .wv-b__arrows { display: none; }
  .wv-b__swipe { display: flex; }
}

@media (max-width: 640px) {
  .wv-b { margin-left: -16px; margin-right: -16px; }
  .wv-b__stage { height: 480px; }
  .wv-b__track { padding: 0 16px 8px; scroll-padding: 0 16px; }
  .walkbike-section .wv-b__card { flex-basis: calc(100% - 72px); }
}

@media (prefers-reduced-motion: reduce) {
  .walkbike-section *,
  .walkbike-section *::before,
  .walkbike-section *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Loading skeleton ----
   Server-rendered in the mount (template-homepage.php) so the section has
   its real height before the script runs. Once the section is built it
   overlays it (.is-built), then fades once Google's tiles are in
   (.is-loaded). The map part is home.css's shared .fc-map-skel. */
.wv-mount { position: relative; }
.wv-skel {
  max-width: 1280px;
  margin: 0 auto;
  pointer-events: none;
  transition: opacity 400ms ease, visibility 0s linear 400ms;
}
.wv-mount.is-built > .wv-skel { position: absolute; inset: 0; z-index: 20; }
.wv-mount.is-loaded > .wv-skel { opacity: 0; visibility: hidden; }
.wv-skel__stage {
  position: relative;
  isolation: isolate; /* keeps .fc-map-skel's z-index under the cards below */
  height: 620px;
  overflow: hidden;
  border-radius: var(--fc-radius-stage);
  border: 1px solid var(--line);
}
.wv-skel__cards {
  position: relative;
  display: flex;
  gap: 12px;
  margin-top: -128px;
  padding: 0 24px 6px;
  overflow: hidden;
}
.wv-skel__cards span {
  flex: 0 0 300px;
  height: 152px;
  border-radius: var(--fc-radius-card);
  background: #fff;
  box-shadow: var(--fc-shadow-raised);
}

@media (max-width: 760px) {
  .wv-skel { margin: 0 -30px; }
  .wv-skel__stage { height: 500px; border-radius: 0; border-left: 0; border-right: 0; }
  .wv-skel__cards { margin-top: -106px; padding: 0 30px 8px; }
  .wv-skel__cards span { flex-basis: calc(100% - 96px); max-width: 320px; height: 131px; }
  /* Room for the "Drag to scroll" line under the real cards. */
  .wv-skel::after { content: ''; display: block; height: 21px; }
}

@media (max-width: 640px) {
  .wv-skel { margin-left: -16px; margin-right: -16px; }
  .wv-skel__stage { height: 480px; }
  .wv-skel__cards { padding: 0 16px 8px; }
  .wv-skel__cards span { flex-basis: calc(100% - 72px); }
}
