/* /ride-planner: interactive route planner. Layered on preview/home-redesign.css + info-pages.css.
   Type scale (px): 13 / 16 / 20 / 25 / 31 / 39 / 49 / 61. Spacing: 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 96 / 128.
   Teal only on the primary button, links, focus rings, the selected route line and the closing CTA band. */

.rp-hero {
  padding: 96px var(--pad-x);
  background: var(--snow);
  border-bottom: 1px solid var(--line);
}

.rp-hero h1 {
  max-width: 18ch;
  margin: 8px 0 0;
  font-family: "Barlow Condensed", "Barlow Condensed Fallback", "Barlow Condensed Fallback 2", sans-serif;
  font-weight: 700;
  font-size: 61px;
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}

.rp-hero > p {
  max-width: 65ch;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.55;
}

.rp-hero .info-hero-actions { margin-top: 24px; }

.rp-proof {
  margin: 16px 0 0;
  font-size: 16px;
  color: var(--muted);
}

.rp-proof a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- First-timer pick ---------- */

.rp-pick {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  max-width: 65ch;
  margin-top: 32px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-rest);
}

.rp-pick img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius);
}

.rp-pick strong { display: block; font-size: 20px; line-height: 1.3; }
.rp-pick p { margin: 4px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.rp-pick a { color: var(--teal); font-weight: 600; }

/* ---------- Planner layout ---------- */

.rp-planner {
  padding: 96px var(--pad-x);
}

.rp-planner > h2,
.rp-section > h2 {
  margin: 0;
  font-family: "Barlow Condensed", "Barlow Condensed Fallback", "Barlow Condensed Fallback 2", sans-serif;
  font-weight: 700;
  font-size: 39px;
  line-height: 1.1;
  text-transform: uppercase;
}

.rp-lede {
  max-width: 65ch;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.rp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.rp-tab {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: 600 16px/1.5 "Barlow", "Barlow Fallback", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.rp-tab small { color: var(--muted); font-weight: 500; font-size: 13px; }

.rp-tab:hover { border-color: var(--ink); }

.rp-tab[aria-pressed="true"] {
  background: var(--rock);
  border-color: var(--rock);
  color: var(--white);
}

.rp-tab[aria-pressed="true"] small { color: var(--on-rock-muted); }

.rp-tab:focus-visible,
.rp-route__head:focus-visible,
.rp-action:focus-visible,
.rp-profile:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.rp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: start;
  margin-top: 24px;
}

.rp-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rp-tier-label {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rp-tier-label:first-child { margin-top: 0; }

/* ---------- Route card ---------- */

.rp-route {
  scroll-margin-top: 96px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-rest);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.rp-route:hover { box-shadow: var(--shadow-hover); }

.rp-route.is-active { border-color: var(--ink); box-shadow: var(--shadow-hover); }

.rp-route__head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rp-route__head img {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--snow);
}

.rp-route__num {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--rock);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  vertical-align: 2px;
}

.rp-route.is-active .rp-route__num { background: var(--ink); }

.rp-route__title {
  display: block;
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.rp-route__line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.rp-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 8px;
}

.rp-badge {
  padding: 0 8px;
  border-radius: var(--radius);
  background: var(--snow);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 24px;
  white-space: nowrap;
}

.rp-badge--pick { background: var(--rock); color: var(--white); }
.rp-badge--go { background: #E3F1EA; color: var(--success); }
.rp-badge--wait { background: #FBEFD9; color: #6B4A0B; }

.rp-route__body {
  padding: 0 16px 16px;
}

.rp-route:not(.is-active) .rp-route__body { display: none; }

.rp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rp-stats div { margin: 0; }
.rp-stats dt { color: var(--muted); font-size: 13px; line-height: 1.4; }
.rp-stats dd { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }

.rp-route__body h3 {
  margin: 16px 0 4px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.rp-route__body p,
.rp-route__body li {
  max-width: 65ch;
  font-size: 16px;
  line-height: 1.55;
}

.rp-route__body p { margin: 0; }
.rp-route__body ul { margin: 0; padding-left: 24px; }
.rp-route__body li + li { margin-top: 4px; }

.rp-photo {
  margin: 16px 0 0;
}

.rp-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}

.rp-photo figcaption { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.4; }

.rp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.rp-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--input-line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: 600 16px/1.5 "Barlow", "Barlow Fallback", system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.rp-action:hover { border-color: var(--ink); box-shadow: var(--shadow-hover); }

.rp-action--map { display: none; }

/* Google Maps hand-off: our page shows the path, Google Maps does the turn-by-turn. */
.rp-navs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.rp-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 16px;
  border: 2px solid var(--rock);
  border-radius: var(--radius);
  background: var(--rock);
  color: var(--white);
  font: 600 16px/1.5 "Barlow", "Barlow Fallback", system-ui, sans-serif;
  text-decoration: none;
  box-shadow: var(--shadow-rest);
  transition: box-shadow var(--ease), background-color var(--ease);
}

.rp-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.rp-nav:hover { box-shadow: var(--shadow-hover); background: #0B1110; }
.rp-nav--alt { background: var(--white); color: var(--ink); border-color: var(--input-line); }
.rp-nav--alt:hover { background: var(--white); border-color: var(--ink); }
.rp-nav:focus-visible, .rp-stops a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.rp-stops-label { margin: 12px 0 0 !important; color: var(--muted); font-size: 13px !important; }

.rp-stops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0 !important;
  padding: 0 !important;
  list-style: none;
}

.rp-stops li { margin: 0 !important; }

.rp-stops a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--snow);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--ease);
}

.rp-stops a:hover { background: var(--line); }
.rp-stops svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2.2; flex: none; }

.rp-popup strong { display: block; font-size: 16px; line-height: 1.4; }
.rp-popup a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.rp-popup button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink); font: 600 16px/1.5 "Barlow", "Barlow Fallback", system-ui, sans-serif; text-decoration: underline; cursor: pointer; }

/* ---------- Map panel ---------- */

.rp-mapcol {
  position: sticky;
  top: 96px;
}

.rp-map {
  height: min(64vh, 640px);
  min-height: 400px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--snow);
  z-index: 0;
}

.rp-map .leaflet-control-attribution { font-size: 13px; }
.rp-map .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.rp-map .leaflet-control-zoom-in,
.rp-map .leaflet-control-zoom-out { font-size: 20px; }
.rp-map .leaflet-tooltip.rp-label {
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: 700 13px/24px "Barlow", "Barlow Fallback", system-ui, sans-serif;
  box-shadow: var(--shadow-rest);
}
.rp-map .leaflet-tooltip.rp-label::before { display: none; }

.rp-pin {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--rock);
  color: var(--white);
  font: 700 13px/1 "Barlow", "Barlow Fallback", system-ui, sans-serif;
  box-shadow: var(--shadow-hover);
}

.rp-pin.is-active { background: var(--ink); outline: 2px solid var(--white); }

.rp-pin--shop { width: 32px; height: 32px; background: var(--ink); }
.rp-pin--shop svg { width: 16px; height: 16px; }

.rp-profile-wrap {
  margin-top: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.rp-profile-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.rp-profile-head strong { color: var(--ink); font-size: 16px; }

.rp-profile {
  display: block;
  width: 100%;
  height: 120px;
  margin-top: 8px;
  touch-action: pan-y;
  cursor: crosshair;
}

.rp-profile .area { fill: #DCE7E5; }
.rp-profile .ridge { fill: none; stroke: var(--rock); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rp-profile .cursor { stroke: var(--teal); stroke-width: 2; vector-effect: non-scaling-stroke; }
.rp-profile .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }

.rp-profile-read { min-height: 20px; margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Supporting sections ---------- */

.rp-section {
  padding: 96px var(--pad-x);
  border-top: 1px solid var(--line);
}

.rp-section--snow { background: var(--snow); }

.rp-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.rp-card {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-rest);
}

.rp-card h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.rp-card p { margin: 8px 0 0; font-size: 16px; line-height: 1.55; color: var(--ink); }
.rp-card p.rp-card__meta { color: var(--muted); font-size: 13px; }
.rp-card a { color: var(--teal); }

.rp-credits {
  max-width: 65ch;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.rp-credits a { color: var(--muted); }

.rp-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 50;
  padding: 8px 16px;
  border-radius: var(--radius);
  background: var(--rock);
  color: var(--white);
  font-size: 16px;
  box-shadow: var(--shadow-hover);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.rp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .rp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .rp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .rp-grid { grid-template-columns: 1fr; }
  .rp-mapcol { position: relative; top: auto; order: -1; }
  .rp-map { height: 360px; min-height: 0; }
  .rp-action--map { display: inline-flex; }
  .rp-navs .rp-nav { flex: 1 1 100%; justify-content: center; }
  .rp-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .rp-hero { padding: 64px var(--pad-x); }
  .rp-hero h1 { font-size: 36px; }
  .rp-hero > p { font-size: 16px; }
  .rp-planner { padding: 64px var(--pad-x); }
  .rp-planner > h2, .rp-section > h2 { font-size: 31px; }
  .rp-section { padding: 64px var(--pad-x); }
  .rp-route__head { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .rp-route__head img { width: 80px; height: 80px; }
  .rp-route__title { font-size: 16px; }
  .rp-route__line { font-size: 13px; }
  .rp-map { height: 300px; }
  .rp-pick { grid-template-columns: 64px 1fr; gap: 12px; }
  .rp-pick img { width: 64px; height: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .rp-toast, .rp-route, .rp-tab, .rp-action { transition: none; }
}
