:root {
  --bg: #0d1a12;
  --panel: #12261b;
  --panel-2: #183526;
  --line: #244a34;
  --text: #e8f0e8;
  --muted: #9db8a6;
  --accent: #5fbf7f;
  --accent-2: #c4972f;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ---- header ---- */
.site-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px;
  padding: 20px 4px 12px;
}
.brand h1 { margin: 0; font-size: 30px; letter-spacing: -0.5px; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.anchor {
  margin-left: auto; font-size: 13px; color: var(--text);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.anchor-badge { color: var(--accent-2); font-weight: 700; }

/* ---- map ---- */
#map {
  height: 420px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); margin: 4px 0 16px;
}
.leaflet-container { background: #0a140e; }
.leaflet-popup-content { font: 13px/1.4 system-ui, sans-serif; }
.leaflet-popup-content a { color: #1a6b3a; }

/* cluster bubbles themed by density: green → amber → red */
.marker-cluster div { color: #0d1a12; font-weight: 700; }
.marker-cluster-small { background: rgba(95,191,127,0.35); }
.marker-cluster-small div { background: rgba(95,191,127,0.85); }
.marker-cluster-medium { background: rgba(196,151,47,0.35); }
.marker-cluster-medium div { background: rgba(196,151,47,0.85); }
.marker-cluster-large { background: rgba(196,74,74,0.35); }
.marker-cluster-large div { background: rgba(196,74,74,0.85); }

/* ---- controls ---- */
.controls {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
}
.control { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.control.grow { grid-column: span 1; }
.control.span2 { grid-column: span 2; }
.control label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.control label.ghost { visibility: hidden; }
.control.check { justify-content: flex-end; }

select, input[type="search"] {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; width: 100%;
}
input[type="search"]::placeholder { color: #6e8a76; }

.loc-row { display: flex; gap: 6px; }
.loc-row select { flex: 0 0 40%; }
button { cursor: pointer; font: inherit; }
.nearme, .surprise, .reset {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; white-space: nowrap;
}
.nearme { flex: 1; }
.surprise:hover, .reset:hover, .nearme:hover { border-color: var(--accent); }
.toggle-pill {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; white-space: nowrap;
}
.toggle-pill.active { background: var(--accent-2); color: #1a1205; border-color: var(--accent-2); font-weight: 700; }

/* ---- multi-select ---- */
.multi { position: relative; }
.multi-btn {
  width: 100%; text-align: left; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.multi-panel {
  display: none; position: absolute; z-index: 500; top: calc(100% + 4px); left: 0;
  min-width: 100%; max-height: 300px; overflow: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.multi.open .multi-panel { display: block; }
.multi-group {
  display: flex; align-items: center; gap: 5px; width: 100%; margin: 6px 0 2px;
  border-bottom: 1px solid var(--line);
  color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 4px 6px 3px; cursor: pointer;
}
.multi-group:first-child { margin-top: 0; }
.multi-group:hover { color: #8ff0b0; }
.multi-group input { cursor: pointer; }
.multi-opt { display: flex; align-items: center; gap: 4px; padding: 5px 6px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.multi-opt:hover { background: var(--panel); }
.multi-clear { width: 100%; margin-top: 4px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 6px; }

/* ---- summary + results ---- */
.summary { color: var(--muted); font-size: 14px; margin: 6px 2px 12px; }
.group-head {
  font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent);
  border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 22px 0 12px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: border-color 0.2s, transform 0.1s;
}
.card:hover { border-color: var(--accent); }
.card.feat { border-color: #35603f; background: linear-gradient(180deg, #143223, var(--panel)); }
.card.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 100% { border-color: var(--line); } 20% { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(95,191,127,0.25); } }

.thumb {
  position: relative; display: block; margin: -14px -14px 2px; height: 168px; overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--panel-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.card:hover .thumb img { transform: scale(1.04); }
.thumb[data-id] { cursor: zoom-in; }
.thumb.placeholder { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, color-mix(in srgb, var(--cat) 42%, #0d1a12), #0d1a12); }
.ph-icon { font-size: 46px; opacity: 0.9; filter: saturate(1.1); }
.gcount {
  position: absolute; top: 8px; left: 8px; font-size: 11.5px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.6); border-radius: 999px; padding: 2px 8px;
}

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.9); padding: 40px 16px; }
.lb.open { display: flex; }
.lb-img { max-width: 96vw; max-height: 82vh; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.lb-close { position: absolute; top: 14px; right: 18px; font-size: 22px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 40px; width: 54px; height: 74px; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-close, .lb-nav { background: rgba(255,255,255,0.1); color: #fff; border: none; border-radius: 10px; cursor: pointer; line-height: 1; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,0.22); }
.lb-cap { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #e8f0e8; font-size: 13px; padding: 0 16px; }
.lb-cap .lb-name { font-weight: 700; margin-right: 8px; }
.lb-cap a { color: #9fd8b2; }
.lb-count { color: var(--muted); margin-left: 8px; }
@media (max-width: 600px) { .lb-nav { width: 40px; height: 60px; font-size: 30px; } }
.thumb .credit {
  position: absolute; left: 0; bottom: 0; right: 0; font-size: 10.5px; color: #dfe8e0;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.72)); padding: 14px 8px 4px;
  opacity: 0; transition: opacity 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb:hover .credit { opacity: 1; }
.thumb .star {
  position: absolute; top: 8px; right: 8px; font-size: 15px; color: var(--accent-2);
  background: rgba(0,0,0,0.55); border-radius: 999px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.pop-thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; display: block; }

.row1 { display: flex; align-items: center; justify-content: space-between; }
.cat-chip {
  font-size: 12px; font-weight: 600; color: var(--text);
  background: color-mix(in srgb, var(--cat) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat) 55%, transparent);
  border-radius: 999px; padding: 3px 9px;
}
.star { color: var(--accent-2); font-size: 16px; }
.name { margin: 0; font-size: 17px; line-height: 1.25; }
.blurb { font-size: 14px; color: #d2e0d4; }
.know { font-size: 12.5px; color: var(--muted); background: var(--panel-2); border-radius: 8px; padding: 7px 9px; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11.5px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
button.tagbtn { cursor: pointer; font-family: inherit; line-height: 1.4; transition: border-color 0.15s, color 0.15s, background 0.15s; }
button.tagbtn:hover { color: var(--text); border-color: var(--accent); }
button.tagbtn.active { color: #0d1a12; background: var(--accent); border-color: var(--accent); font-weight: 600; }
.tag.diff { text-transform: capitalize; font-weight: 600; }
.tag.diff.easy { color: #7fd89a; border-color: #2f6b42; }
.tag.diff.moderate { color: #e0b45a; border-color: #6b551f; }
.tag.diff.strenuous { color: #e08a6a; border-color: #6b3a2a; }
/* terrain / exposure — its own severity ramp, distinct from effort */
.tag.terr { font-weight: 600; }
.tag.terr.walk { color: #7fd89a; border-color: #2f6b42; }
.tag.terr.rugged { color: #e0b45a; border-color: #6b551f; }
.tag.terr.scramble { color: #e0955a; border-color: #6b471f; }
.tag.terr.exposed { color: #e0745a; border-color: #6b3a2a; }
.tag.terr.ladder-trail { color: #e07a8a; border-color: #6b2f3a; }
.tag.terr.via-ferrata { color: #c49ae0; border-color: #4a2f6b; }
.tag.terr.technical-climb { color: #e05a6a; border-color: #6b2a34; }
button.tag.terr.active { color: #0d1a12; }

.meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dog.ok { color: #8fb89a; }
.dog.no { color: #e08a6a; }
.actions { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: auto; padding-top: 4px; }
.link { font-size: 13px; text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.link.maps { color: var(--accent); }
.link.info { color: #8fbfe0; }
.link.trail { color: #7fd89a; }
.link.topo { color: #c9b98f; }
.link.book { color: #1a1205; background: var(--accent-2); padding: 3px 10px; border-radius: 999px; }
.link.book:hover { text-decoration: none; filter: brightness(1.08); }

.trail-stats { font-size: 13px; font-weight: 600; color: #cfe0d4; letter-spacing: 0.2px; }
.trail-stats .dot { color: var(--muted); font-weight: 400; }
.trail-stats + .blurb { margin-top: -2px; }
.season { font-size: 12.5px; color: #c7b98a; }

.plan-badge {
  font-size: 11px; font-weight: 700; color: var(--accent-2);
  border: 1px solid color-mix(in srgb, var(--accent-2) 55%, transparent);
  background: color-mix(in srgb, var(--accent-2) 16%, transparent);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}

/* seasonal access + live river conditions */
.acc { font-size: 12px; font-weight: 700; border-radius: 8px; padding: 4px 10px; border: 1px solid transparent; }
.acc.warn { color: #f0d68a; background: rgba(217,138,43,0.16); border-color: #8a6a2b; }
.acc.closed { color: #f4a58a; background: rgba(196,74,74,0.18); border-color: #8a3b3b; }
.acc.ok { color: var(--muted); background: var(--panel-2); border-color: var(--line); font-weight: 500; }

.advisory { margin: 0; }
.advisory.warn, .advisory.high { margin: 2px 2px 12px; font-size: 13.5px; border-radius: 10px; padding: 10px 14px; }
.advisory.warn { color: #f0d68a; background: rgba(217,138,43,0.12); border: 1px solid #6b551f; }
.advisory.high { color: #f4a58a; background: rgba(196,74,74,0.14); border: 1px solid #7a2f2f; }

.cond-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.cond {
  display: inline-block; font-size: 12px; font-weight: 700; text-decoration: none;
  border-radius: 8px; padding: 4px 10px; border: 1px solid transparent;
}
.cond:hover { filter: brightness(1.1); }
.cond.good { color: #8ff0b0; background: rgba(47,158,95,0.18); border-color: #2f9e5f; }
.cond.caution { color: #f0d68a; background: rgba(217,138,43,0.18); border-color: #d98a2b; }
.cond.high { color: #f4a58a; background: rgba(196,74,74,0.20); border-color: #c44a4a; }
.cond.low { color: #b7c4cc; background: rgba(120,140,150,0.18); border-color: #6e8a96; }
.cond.info { color: #8fbfe0; background: rgba(58,114,196,0.16); border-color: #3a72c4; }
.cond.na, .cond.loading { color: var(--muted); background: var(--panel-2); border-color: var(--line); font-weight: 500; }

.empty { color: var(--muted); text-align: center; padding: 40px 20px; }
.site-foot { color: #6e8a76; font-size: 12px; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  .controls { grid-template-columns: repeat(2, 1fr); }
  .control.span2 { grid-column: span 2; }
  #map { height: 320px; }
  .anchor { margin-left: 0; width: 100%; }
}
