/* Ritter'Hoft — Carte des itinéraires vélo.
 *
 * Page-scoped, loaded only by itineraires-velo. Not in styles.css, which is
 * generated by Hallmark and would lose anything written there.
 *
 * Layout: filters and route list on the left, map sticky on the right so the
 * map stays in view while the list is scrolled. Below 900px the map moves on
 * top at a fixed height and the list flows underneath — a sticky map on a phone
 * would eat the whole screen.
 */

.velo-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 24px;
  margin-top: 30px;
  align-items: start;
}

/* ---- Filters ------------------------------------------------------------ */

.velo-filters {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.velo-filters__row + .velo-filters__row { margin-top: 16px; }

.velo-filters label {
  display: block;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.velo-filters input[type="range"] { width: 100%; accent-color: var(--gold-deep); }

.velo-filters output {
  font-family: var(--logo);
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}

.velo-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
}

.velo-check input { width: 18px; height: 18px; accent-color: var(--gold-deep); flex: none; }

.velo-count {
  font-size: .8rem;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

.velo-count b { font-family: var(--logo); font-size: 1.05rem; color: var(--gold-deep); }

/* ---- Route list --------------------------------------------------------- */

.velo-list { display: grid; gap: 10px; max-height: 620px; overflow-y: auto; padding-right: 4px; }

.velo-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: .18s ease;
}

.velo-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.velo-card:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.velo-card[aria-pressed="true"] { border-color: var(--gold); background: var(--paper-2); }

.velo-card__top {
  display: block;
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 5px;
}

/* Routes that literally pass the hotel are the reason this page exists, so
   they are called out rather than left to be spotted in a list. */
.velo-card[data-doorstep] .velo-card__top { color: var(--gold-deep); font-weight: 600; }

.velo-card__name { display: block; font-weight: 500; font-size: .95rem; line-height: 1.35; }

.velo-card__meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  font-size: .8rem;
  color: var(--ink-faint);
}

.velo-card__meta b {
  font-family: var(--logo);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}

.velo-empty {
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  text-align: center;
  font-size: .88rem;
  color: var(--ink-faint);
}

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

.velo-map__wrap { position: sticky; top: 100px; }

#velo-map {
  height: 640px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: var(--paper-2);
  z-index: 0; /* keep Leaflet panes under the site header */
}

/* Leaflet ships its own control chrome; align it with the site instead of
   leaving default Bootstrap-ish blue links. */
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: .68rem; }
.leaflet-control-attribution a { color: var(--gold-deep); }

.velo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: .78rem;
  color: var(--ink-faint);
}

.velo-legend span { display: inline-flex; align-items: center; gap: 7px; }
.velo-legend i { width: 22px; height: 3px; border-radius: 2px; flex: none; }
/* Must stay in step with GOLD/INK in velo-map.js, which paints the same lines. */
.velo-legend .k-door { background: var(--gold); height: 4px; }
.velo-legend .k-other { background: var(--teal); opacity: .55; }
.velo-legend .k-hotel { width: 11px; height: 11px; border-radius: 50%; background: var(--gold); border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--line); }

.velo-source { margin-top: 16px; font-size: .78rem; color: var(--ink-faint); }
.velo-source a { color: var(--gold-deep); }

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

@media (max-width: 900px) {
  .velo-layout { grid-template-columns: 1fr; }
  /* Map first: on a phone the map is the orientation device, the list is the
     detail. Sticky is dropped so it does not occupy the viewport permanently. */
  .velo-map__wrap { position: static; order: -1; }
  #velo-map { height: 380px; }
  .velo-list { max-height: none; }
}
