/*
  The pickup card (pickupCard.js), the one way of choosing a pickup site on the home page's share
  builder and the shop's picker, as the redesign draws the builder's step 1 (direction F,
  `Site-Home`, "Route line"): its words at the left; the map small beside the stops on a dotted
  line, north to south, the picked one's dot filled green; down the page on a phone, the line
  down the dots, the map a strip at their right. Each stop draws the line to its neighbors, half on each side of its dot, so the line
  runs from the first dot to the last however many stops there are.
*/

.route-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px 48px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--rule);
  background: var(--cream);
}

.route-words {
  flex: 0 1 280px;
  min-width: 0;
}

.route-label {
  margin: 0;
  font-family: var(--font-label);
  font-size: var(--size-label);
  letter-spacing: 0.2em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--green);
}

.route-title {
  margin: 6px 0 0;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
}

.route-lede {
  margin: 6px 0 0;
  font-size: 16px;
  color: var(--text-faint);
}

.route-choose {
  flex: 1 1 440px;
  min-width: 0;
}

.route {
  display: flex;
  align-items: center;
  gap: 20px;
}

.route-map {
  flex: none;
  width: 92px;
  border: 1px solid var(--rule);
}

/* As tall as its crop is for its width (pickupMap.js, `MAP_VIEW`); its markers' tap areas may
   reach past its edges. */
.route-map .pickup-map-drawing {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* A marker: its icon, ringed in green on the chosen site's; the round area a tap takes is
   unseen but for the keyboard's ring. */
.map-pin {
  cursor: pointer;
  outline: none;
}

.map-hit {
  fill: transparent;
}

.map-ring {
  fill: none;
}

.map-pin.is-picked .map-ring {
  fill: rgb(255 253 247 / 0.9);
  stroke: var(--green);
  stroke-width: 12px;
}

.map-pin:focus-visible .map-hit {
  stroke: var(--green);
  stroke-width: 10px;
}

.map-icon {
  filter: drop-shadow(0 0 1.5px var(--card))
    drop-shadow(0 1px 2px rgb(43 42 36 / 0.35));
}

.route-stops {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
}

.route-stop {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* The dotted line: from this stop's dot to halfway to each neighbor's. */
.route-stop::before,
.route-stop::after {
  content: '';
  position: absolute;
  top: 20px;
  border-top: 3px dotted #b5a98d;
}

.route-stop::before {
  left: 0;
  right: 50%;
}

.route-stop::after {
  left: 50%;
  right: 0;
}

.route-stop:first-child::before,
.route-stop:last-child::after {
  display: none;
}

.route-stop:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.route-dot {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.route-dot::before {
  content: '';
  flex: none;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
}

/* The chosen stop: the same circle, in green, filled to a thin cream ring inside its rim, so
   the dotted line stays even (Jeff, 2026-11-18: "make the dot like a little bit less
   enthusiastic"). */
.route-stop.is-picked .route-dot::before {
  border-color: var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 2px var(--cream);
}

.route-name {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.2;
}

/* The chosen stop is told by its green name, its filled dot and the dot's motion; no underline,
   which stayed under the stop just chosen (Jeff, 2026-11-18: "Remove the underline from the
   location picker. It already animates, it already ticks in the radio button and it changes the
   color. I think that's enough."). A keyboard's focus has its own outline (above). */
.route-stop.is-picked .route-name {
  color: var(--green);
  font-weight: 500;
}

.route-when {
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-faint);
}

.route-stop.is-picked .route-when {
  color: var(--text-muted);
}

/* A stop's line under its hours: on a product's page, that the product isn't sold there (R347). */
.route-note {
  font-size: 13px;
  line-height: 1.3;
  font-style: italic;
  color: var(--text-faint);
}

.route-current {
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
}

/* On a phone the stops run down the page, the line down their dots, and the map stands beside
   them at the right as a strip about their height (Jeff, 2026-11-18: "The map is just like way
   too huge now"). */
@media (max-width: 639px) {
  .route {
    gap: 16px;
  }

  .route-map {
    order: 2;
    width: 112px;
  }

  .route-stops {
    flex-direction: column;
  }

  .route-stop {
    display: grid;
    grid-template-columns: 26px 1fr;
    column-gap: 12px;
    row-gap: 0;
    align-items: center;
    justify-items: start;
    padding: 8px 4px 8px 9px;
    text-align: left;
  }

  .route-stop::before,
  .route-stop::after {
    left: 20.5px;
    right: auto;
    border-top: 0;
    border-left: 3px dotted #b5a98d;
  }

  .route-stop::before {
    top: 0;
    bottom: 50%;
  }

  .route-stop::after {
    top: 50%;
    bottom: 0;
  }

  .route-dot {
    grid-row: 1 / span 3;
  }

  .route-name {
    margin-top: 0;
  }
}
