/* Flat, neutral, modern-app styling. Color lives only in icon tiles, chips,
   and the map; cards and page surface stay white/neutral. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --ink: #1c1c1e;
  --muted: #6e6e73;
  --hairline: #e6e6e8;
  --wine: #7b2d43;           /* route line + single accent */
  --gold: #b8860b;

  --c-food: #d1553f;
  --c-wine: #8c3a54;
  --c-lodging: #3672a8;
  --c-bar: #c98a2e;
  --c-bike: #3f8a4c;
  --c-scenery: #7263b8;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.site-header {
  display: flex; align-items: center;
  padding: 0.8rem 1.6rem;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
.site-header { justify-content: space-between; }
.brand { display: flex; align-items: baseline; gap: 0.5rem; text-decoration: none; color: inherit; }
.back-link { font-size: 0.78rem; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--ink); }
.brand-mark { color: var(--wine); font-size: 1rem; }
.brand-name { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-tag { font-size: 0.75rem; color: var(--muted); }

.route-hero { padding: 1.7rem 1.6rem 0.6rem; background: var(--surface); }
.route-hero h1 { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; }
.route-meta { margin-top: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.route-meta .dot { margin: 0 0.5rem; color: var(--hairline); }

.day-tabs {
  display: flex; gap: 0.45rem; padding: 0.9rem 1.6rem 0; flex-wrap: wrap;
  background: var(--surface);
}
.day-tab {
  font: inherit; font-size: 0.82rem; cursor: pointer; text-align: left;
  padding: 0.42rem 0.95rem; border-radius: 10px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
}
.day-tab:hover { border-color: #c9c9cd; }
.day-tab .sub { display: block; font-size: 0.66rem; color: var(--muted); margin-top: 1px; }
.day-tab.active { background: var(--wine); border-color: var(--wine); color: #fff; }
.day-tab.active .sub { color: rgba(255, 255, 255, 0.72); }

.day-tab .stat { display: block; font-size: 0.66rem; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.day-tab.active .stat { color: rgba(255, 255, 255, 0.72); }

.gpx-btn {
  margin-left: auto; text-decoration: none; text-align: left;
  font-size: 0.82rem; color: var(--wine); font-weight: 500;
  padding: 0.42rem 0.95rem; border-radius: 10px;
  border: 1px dashed var(--hairline); background: var(--surface);
}
.gpx-btn:hover { border-color: var(--wine); }
.gpx-btn .sub { display: block; font-size: 0.66rem; color: var(--muted); font-weight: 400; margin-top: 1px; }

.filter-bar {
  display: flex; gap: 0.35rem; padding: 0.7rem 1.6rem 0.9rem; flex-wrap: wrap;
  background: var(--surface); border-bottom: 1px solid var(--hairline);
}
.filter-chip {
  font: inherit; font-size: 0.76rem; cursor: pointer;
  padding: 0.26rem 0.72rem; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--muted);
}
.filter-chip:hover { border-color: #c9c9cd; color: var(--ink); }
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-chip .swatch {
  display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; margin-right: 0.4em;
}

.layout {
  display: grid; grid-template-columns: minmax(360px, 480px) 1fr;
  /* header + hero + tabs + filters + footer ≈ 285px */
  height: calc(100vh - 285px); min-height: 480px;
}
.sidebar { overflow-y: auto; padding: 1.1rem 1.3rem 3rem; }
.map-wrap { position: relative; border-left: 1px solid var(--hairline); }
#map { position: absolute; inset: 0; }

.town-group { margin-bottom: 1.9rem; }
.town-heading {
  display: flex; align-items: baseline; gap: 0.5rem;
  border-bottom: 1px solid var(--hairline); padding-bottom: 0.45rem; margin-bottom: 0.75rem;
}
.town-heading h2 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.town-heading .town-sub { font-size: 0.72rem; color: var(--muted); }

.section-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 0.9rem 0 0.45rem; font-weight: 500;
}

/* --- Cards: flat, hairline, icon tile left --- */
.card {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 0.72rem 0.8rem; margin-bottom: 0.5rem; cursor: pointer;
}
.card:hover { border-color: #c9c9cd; }
.card.curated { border-left: 3px solid var(--wine); }
.ourpick {
  font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--wine);
}

.icon-tile {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.icon-tile svg { width: 17px; height: 17px; }

.card-body { flex: 1; min-width: 0; }
.card-line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.card-name { font-weight: 500; font-size: 0.9rem; letter-spacing: -0.01em; }
.card-line2 { font-size: 0.78rem; color: var(--muted); margin-top: 0.18rem; }
.card-line2 .mich { color: var(--gold); font-weight: 600; }
.card-line2 a { color: var(--wine); text-decoration: none; }
.card-line2 a:hover { text-decoration: underline; }
.card-desc { font-size: 0.78rem; color: var(--muted); margin-top: 0.28rem; line-height: 1.4; }

.chip {
  flex: 0 0 auto; font-size: 0.68rem; padding: 0.13rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--hairline); color: var(--muted); background: var(--surface);
  white-space: nowrap;
}
.chip.bucket-on { background: #eef6ee; border-color: #d5e8d5; color: #2e6b34; }
.chip.bucket-off { background: #faf4e8; border-color: #ecdfc3; color: #8a6414; }
.chip.bucket-gateway { background: #f0eef8; border-color: #ddd7ee; color: #55489a; }
.chip.bucket-excursion { background: #f0eef8; border-color: #ddd7ee; color: #55489a; }

.av { color: #2e6b34; font-weight: 600; }

/* --- Map declutter / progressive disclosure --- */
.town-label {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-size: 0.68rem; font-weight: 600; color: var(--ink); padding: 1px 6px;
}
.town-label::before { display: none; }

.showall-toggle {
  font: inherit; font-size: 0.78rem; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 0.35rem 0.7rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.showall-toggle:hover { color: var(--ink); border-color: #c9c9cd; }

.marker-cluster, .marker-cluster div { background-clip: padding-box; border-radius: 50%; }
.marker-cluster { background: rgba(123, 45, 67, 0.18); }
.marker-cluster div {
  background: var(--wine); color: #fff; width: 28px; height: 28px; margin: 4px;
  display: flex; align-items: center; justify-content: center;
  font: 600 11px/1 -apple-system, sans-serif;
}

.day-note {
  background: var(--surface); border: 1px solid var(--hairline); border-left: 3px solid var(--wine);
  border-radius: 12px; padding: 0.75rem 0.9rem; margin-bottom: 1rem;
  font-size: 0.82rem; color: var(--ink); line-height: 1.5;
}
.day-note-label {
  display: block; font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--wine); margin-bottom: 0.25rem;
}

/* --- On-ride mode --- */
.onride-toggle {
  font: inherit; font-size: 0.8rem; font-weight: 500; cursor: pointer;
  background: var(--surface); color: var(--wine);
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 0.4rem 0.75rem; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.onride-toggle:hover { border-color: var(--wine); }
body.onride .onride-toggle { background: var(--wine); color: #fff; border-color: var(--wine); }
body.onride .day-tabs, body.onride .filter-bar, body.onride .route-hero { display: none; }

.onride-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 1rem; margin-bottom: 0.7rem;
}
.onride-exit {
  font: inherit; font-size: 0.78rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 8px;
  padding: 0.25rem 0.7rem; color: var(--muted);
}
.onride-exit:hover { color: var(--ink); border-color: #c9c9cd; }

.onride-status {
  border: 1px solid var(--hairline); border-radius: 10px;
  padding: 0.65rem 0.8rem; font-size: 0.85rem; color: var(--muted);
  margin-bottom: 0.7rem; line-height: 1.45;
}
.onride-status.ok { background: #eef6ee; border-color: #d5e8d5; color: #2e6b34; }
.onride-status.warn { background: #faf4e8; border-color: #ecdfc3; color: #7a5a12; }

.onride-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.7rem; }

.disclaimer {
  margin-top: 1rem; font-size: 0.7rem; color: var(--muted); font-style: italic;
  border-top: 1px solid var(--hairline); padding-top: 0.6rem; line-height: 1.5;
}

.excursion-marker {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #7263b8; color: #fff; font-size: 14px; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 0 0 1px #7263b8;
}

.tips-box {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 0.75rem 0.9rem; margin-bottom: 1.3rem; font-size: 0.8rem; color: var(--muted);
  line-height: 1.45;
}
.tips-box strong { color: var(--ink); font-weight: 600; }

.coming-soon {
  font-size: 0.75rem; color: var(--muted);
  padding: 0.4rem 0.6rem; margin-bottom: 0.45rem;
  background: var(--bg); border-radius: 8px; border: 1px dashed var(--hairline);
}

.show-more {
  font: inherit; font-size: 0.76rem; cursor: pointer; border: none; background: none;
  color: var(--wine); padding: 0.1rem 0; margin: 0.05rem 0 0.5rem;
}
.show-more:hover { text-decoration: underline; }

.empty-note { color: var(--muted); font-size: 0.83rem; }

.leaflet-popup-content { font-family: inherit; }
.popup-name { font-weight: 600; font-size: 0.86rem; }
.popup-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; line-height: 1.45; }
.popup-meta a { color: var(--wine); }

/* --- Landing page --- */
.landing { max-width: 880px; margin: 0 auto; padding: 0 1.6rem 3rem; }

.landing-hero { padding: 3.2rem 0 2.4rem; }
.landing-hero h1 {
  font-size: 1.9rem; font-weight: 650; letter-spacing: -0.025em; line-height: 1.25;
}
.landing-sub {
  margin-top: 0.9rem; max-width: 620px;
  color: var(--muted); font-size: 0.95rem; line-height: 1.6;
}
.cta {
  display: inline-block; margin-top: 1.4rem;
  background: var(--wine); color: #fff; text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
  padding: 0.6rem 1.1rem; border-radius: 10px;
}
.cta:hover { background: #692639; }

.landing-section { padding: 1.6rem 0 0.6rem; }
.landing-heading {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); font-weight: 600; margin-bottom: 1rem;
}

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; }
.step {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 1.1rem;
}
.step-tile { width: 38px; height: 38px; }
.step h3 { font-size: 0.92rem; font-weight: 600; margin-top: 0.75rem; letter-spacing: -0.01em; }
.step p { font-size: 0.8rem; color: var(--muted); line-height: 1.55; margin-top: 0.35rem; }

.route-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 1.1rem 1.2rem; text-decoration: none; color: inherit;
}
a.route-card:hover { border-color: #c9c9cd; }
.route-card.featured { border-left: 3px solid var(--wine); }
.route-card-body { flex: 1; min-width: 0; }
.route-card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.route-card-name { font-weight: 600; font-size: 1.02rem; letter-spacing: -0.015em; }
.route-card-meta { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }
.route-card-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.5; margin-top: 0.5rem; }
.route-card-stats { font-size: 0.76rem; color: var(--ink); margin-top: 0.55rem; }
.route-card-cta { color: var(--wine); font-size: 0.85rem; font-weight: 500; white-space: nowrap; }

.coming-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-top: 0.9rem;
}
.route-card.ghost { opacity: 0.55; align-items: flex-start; }
.route-card.ghost .route-card-name { color: var(--muted); }

@media (max-width: 720px) {
  .steps, .coming-strip { grid-template-columns: 1fr; }
  .landing-hero h1 { font-size: 1.5rem; }
}

.site-footer {
  padding: 0.7rem 1.6rem;
  background: var(--surface);
  border-top: 1px solid var(--hairline);
  font-size: 0.72rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); text-decoration: underline; }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: 45vh auto; height: auto; }
  .map-wrap { order: -1; height: 45vh; border-left: none; border-bottom: 1px solid var(--hairline); }
}
