/* ===========================================================
   feelSacra — Maps (shared)
   /wp-content/uploads/maps/maps.css
   Walking: <body>   Car: <body class="map-car">   Zones: <body class="map-zones">
   Fraunces: names, tooltips, legend items, village labels.
   Figtree:  stats, buttons, numbers, legend title, UI.
   =========================================================== */

@font-face{font-family:'Fraunces';font-style:normal;font-weight:100 900;font-display:swap;
  src:url('/wp-content/themes/riverbank-child/assets/fonts/Fraunces-Roman.woff2') format('woff2');}
@font-face{font-family:'Figtree';font-style:normal;font-weight:300 900;font-display:swap;
  src:url('/wp-content/themes/riverbank-child/assets/fonts/Figtree-Roman.woff2') format('woff2');}

/* ── Tokens ── */
:root {
  --ink:       #1a1a18;
  --paper:     #f5f0e8;
  --paper-alt: #f0ebe0;
  --accent:    #8b3a2a;
  --muted:     rgba(26,26,24,0.55);
  --border:    rgba(26,26,24,0.18);
  --serif:     'Fraunces', Georgia, serif;
  --ui:        'Figtree', system-ui, sans-serif;
}
.map-car { --accent: #1a3272; }

/* ── Base ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  font-family: var(--serif);
  background: var(--paper);
  height: 100vh;
  overflow: hidden;
}

#map-wrap, #map-container { position: relative; width: 100%; height: 100vh; overflow: hidden; }
#map { width: 100%; height: 100%; background: var(--paper); }
.leaflet-container { font-family: var(--serif); background: var(--paper); }

/* Warm tint on CARTO base tiles only (not OpenTopoMap) */
.map-car .leaflet-tile-pane .leaflet-layer:first-child,
.map-zones .leaflet-tile-pane .leaflet-layer:first-child {
  filter: sepia(0.05) saturate(1.2) brightness(1.02);
}

/* ── Header: route name + stats ── */
#route-header {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 900;
  background: rgba(245,240,232,0.96);
  border-left: 3px solid var(--accent);
  padding: 10px 16px 10px 14px;
  max-width: 280px;
  pointer-events: none;
}

#route-name {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin-bottom: 6px;
  text-wrap: balance;
}

#route-stats {
  display: flex;
  gap: 14px;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#route-stats span { display: flex; align-items: center; gap: 4px; }

#route-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#route-legend span { display: flex; align-items: center; gap: 6px; }
#route-legend i { width: 16px; border-top: 2px dashed; border-color: inherit; }

.route-btn--nav1 .day { color: #9a6a3a; }
.route-btn--nav2 .day { color: #1a3272; }

/* ── Action buttons ── */
#route-actions {
  position: absolute;
  bottom: 22px;
  right: 14px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 130px;
}

.route-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  width: 100%;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--ink);
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}
.route-btn--gpx { background: var(--ink); color: var(--paper); }
.route-btn--gpx:hover { background: var(--accent); border-color: var(--accent); }
.route-btn--wikiloc,
.route-btn--nav { background: var(--paper); color: var(--ink); }
.route-btn--wikiloc:hover,
.route-btn--nav:hover { background: var(--ink); color: var(--paper); }
.route-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Loading (walking) ── */
#loading {
  position: absolute;
  inset: 0;
  z-index: 800;
  background: rgba(245,240,232,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ui);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: none;
  transition: opacity 0.4s;
}

/* ── Tooltip (car stops + zones) ── */
#stop-tooltip, #tooltip {
  position: absolute;
  display: none;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  line-height: 1.55;
  padding: 10px 14px;
  max-width: 240px;
  pointer-events: none;
  border-left: 3px solid var(--accent);
  z-index: 999;
}
#stop-tooltip-name, #tooltip-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 3px;
  text-wrap: balance;
}
#stop-tooltip-desc, #tooltip-desc {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ── Legend (zones) ── */
#legend {
  position: absolute;
  bottom: 28px;
  left: 12px;
  background: rgba(245,240,232,0.95);
  border: 1px solid var(--border);
  padding: 10px 14px;
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink);
  z-index: 500;
  line-height: 1.8;
}
#legend-title {
  font-family: var(--ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.6;
}
.legend-item { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; }
.legend-swatch { width: 14px; height: 10px; border: 1px solid rgba(26,26,24,0.3); flex-shrink: 0; }

#legend-toggle {
  display: none;
  position: absolute;
  bottom: 22px;
  left: 12px;
  background: rgba(245,240,232,0.96);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
  z-index: 501;
  cursor: pointer;
}
#legend-toggle:hover { background: var(--paper); }

/* ── Village markers (zones) ── */
.village-marker { background: transparent !important; border: none !important; }
.village-inner { position: relative; width: 100px; height: 30px; pointer-events: none; }
.village-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink);
  border: 1.5px solid var(--paper-alt);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.15);
}
.village-dot.major { width: 12px; height: 12px; background: var(--accent); }
.village-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 10px;
  color: var(--ink);
  white-space: nowrap;
  text-shadow: 0 0 3px var(--paper-alt), 0 0 6px var(--paper-alt), 0 0 9px var(--paper-alt);
}
.village-label.major { font-size: 11px; font-weight: 600; }
.village-label.label-above { bottom: calc(50% + 8px); }
.village-label.label-below { top: calc(50% + 8px); }
a.village-label {
  pointer-events: auto;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ── Leaflet controls ── */
.leaflet-control-attribution {
  font-family: var(--ui) !important;
  font-size: 9px !important;
  background: rgba(245,240,232,0.85) !important;
  padding: 2px 6px !important;
}
.leaflet-control-attribution,
.leaflet-control-attribution a { color: #1a1a18 !important; text-decoration: none !important; }
.leaflet-control-attribution a:hover { text-decoration: underline !important; }

.leaflet-control-zoom { border: none !important; box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important; }
.leaflet-control-zoom a {
  background: rgba(245,240,232,0.95) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  font-family: var(--ui) !important;
}
.leaflet-control-zoom a:hover { background: var(--paper) !important; }

/* ── Mobile ── */
@media (max-width: 640px) {
  #route-header { max-width: calc(100% - 28px); }

  #stop-tooltip, #tooltip {
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    bottom: 60px !important;
    max-width: none !important;
  }

  #legend { display: none; bottom: 60px; max-width: calc(100% - 24px); }
  #legend.is-open { display: block; }
  #legend-toggle { display: block; }

  .village-label { font-size: 9px; }
  .village-label.major { font-size: 10px; }
}
