/* Explore page (explore.html). Palette and typography come from base.css; category colours from poi.js. */
body { color: var(--fg); min-height: 100svh; }

/* header: the title with room around it, then the category filters; below the fixed menu on phones */
.explore-head { padding: 84px var(--gutter) 0; }
.explore-head .eyebrow { margin-bottom: .7rem; }
.explore-head h1 { font-family: var(--serif); font-weight: 400; line-height: 1; letter-spacing: -.01em; font-size: clamp(2.1rem, 4.4vw, 3.4rem); }

/* category filters: one at a time, "All" first. Rounded chips; the chosen one is filled */
.explore-bar { padding: 22px var(--gutter) 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters[hidden] { display: none; }
.filter {
  display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 1.1rem 0 .95rem; border-radius: 999px;
  background: #fff; color: var(--fg-soft); border: 1px solid var(--rule); cursor: pointer;
  font: inherit; font-size: .82rem; letter-spacing: .02em;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.filter:hover { border-color: var(--fg-muted); color: var(--fg); }
.filter[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.filter-all .filter-dot { background: conic-gradient(#5b9a5f 0 20%, #1795a0 0 40%, #b89b72 0 60%, #8e6bb0 0 80%, #8a8f98 0); }
.filter-count { font-size: .74rem; color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.filter[aria-pressed="true"] .filter-count { color: rgba(246, 244, 238, .65); }

/* route mode (?route=<id>) */
.route-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem; }
.route-bar[hidden] { display: none; }
.route-name { font-family: var(--serif); font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.1; }
.route-all { display: inline-flex; align-items: center; min-height: 44px; color: var(--sand); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; }
.route-all::before { content: "\2190"; margin-right: .6rem; letter-spacing: 0; }
.route-all:hover { text-decoration: underline; }

/* search and "My location": one row under the filters */
.explore-tools { display: flex; gap: 10px; margin-top: 12px; }
.search {
  flex: 1 1 auto; min-width: 0; max-width: 420px; min-height: 44px; padding: 0 1rem; border-radius: 999px;
  background: #fff; color: var(--fg); border: 1px solid var(--rule); font: inherit; font-size: .9rem;
}
.search::placeholder { color: var(--fg-muted); opacity: 1; }
.search:focus-visible { outline: 2px solid var(--sand-dark); outline-offset: 2px; border-color: var(--fg-muted); }
.search[hidden] { display: none; }
.locate {
  flex: none; display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 1.1rem 0 .95rem; border-radius: 999px;
  background: #fff; color: var(--fg-soft); border: 1px solid var(--rule); cursor: pointer; font: inherit; font-size: .82rem; letter-spacing: .02em;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.locate:hover { border-color: var(--fg-muted); color: var(--fg); }
.locate[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.locate:disabled { cursor: progress; opacity: .7; }
.locate-icon { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; position: relative; flex: none; }
.locate-icon::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: currentColor; }
.locate-msg { margin-top: 10px; font-size: .85rem; line-height: 1.45; color: var(--fg-muted); }
.locate-msg[hidden] { display: none; }

/* map and list: side by side from 900px (the page is one screen high, the map takes what the header leaves), list under the map on phones */
.explore-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; border-top: 1px solid var(--rule); }
#map { height: 100%; background: var(--mist); z-index: 0; }
.poi-list { overflow-y: auto; border-left: 1px solid var(--rule); padding: 20px 0 28px; overscroll-behavior: contain; }
.poi-list h2 { font-family: var(--sans); font-weight: 400; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; line-height: 1.4; color: var(--acc); padding: 0 20px 10px; }
.poi-count { letter-spacing: .1em; color: var(--fg-muted); }
.route-missing { padding: 0 20px 12px; font-size: .85rem; color: var(--fg-muted); }
.route-missing[hidden] { display: none; }
.poi-items { list-style: none; counter-reset: stop; }
.poi-item {
  display: grid; grid-template-columns: 12px minmax(0, 1fr); column-gap: 12px; align-items: baseline; width: 100%; min-height: 44px;
  padding: 10px 20px; background: none; border: 0; border-top: 1px solid var(--rule); color: var(--fg); text-align: left; cursor: pointer; font: inherit;
}
.poi-item:hover { background: rgba(21, 26, 24, .04); }
.poi-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); align-self: center; grid-row: span 2; }
.poi-name { font-family: var(--serif); font-size: 1.2rem; line-height: 1.2; }
.poi-cat { grid-column: 2; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-muted); }
.list-note { padding: 0 20px 12px; font-size: .85rem; line-height: 1.45; color: var(--fg-muted); }
.list-note[hidden] { display: none; }
/* distance from the visitor, at the right of each row */
.with-dist .poi-item { grid-template-columns: 12px minmax(0, 1fr) auto; }
.poi-dist { grid-column: 3; grid-row: 1 / span 2; align-self: center; padding-left: 12px; font-size: .8rem; color: var(--fg-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.numbered .poi-item { grid-template-columns: 26px minmax(0, 1fr); }
.numbered.with-dist .poi-item { grid-template-columns: 26px minmax(0, 1fr) auto; }
.numbered .poi-dot { width: 22px; height: 22px; counter-increment: stop; display: flex; align-items: center; justify-content: center; font-size: .72rem; color: var(--deep); }
.numbered .poi-dot::before { content: counter(stop); }

@media (min-width: 900px) {
  .explore-app { display: flex; flex-direction: column; height: 100svh; min-height: 680px; }
  .explore-head { padding-top: 88px; }
  .explore-main { flex: 1 1 auto; min-height: 0; }
  .poi-list { min-height: 0; }
  .filter { min-height: 40px; }
}
@media (max-width: 899px) {
  .explore-bar { padding: 18px 0 18px; }
  .explore-main { display: block; height: auto; }
  #map { height: calc(100svh - 250px); min-height: 340px; }
  .poi-list { border-left: 0; overflow: visible; }
  /* filters in one row that scrolls sideways instead of wrapping into several rows; the row runs to the screen edges */
  .filters { flex-wrap: nowrap; overflow-x: auto; padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }
  .route-bar { padding: 0 var(--gutter); }
  .explore-tools, .locate-msg { margin-left: var(--gutter); margin-right: var(--gutter); }
}

/* soften the standard tiles so they sit well with the palette */
.leaflet-tile-pane { filter: grayscale(.45) sepia(.12) saturate(.85) brightness(.97); }

/* point: a circle in the category colour, same ring and hover as before */
.pin span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--c, var(--sand)); border: 3px solid var(--deep); box-shadow: 0 0 0 1px var(--c, var(--sand)), 0 2px 8px rgba(21, 26, 24, .45); transition: transform .2s ease; }
.pin:hover span, .pin:focus span { transform: scale(1.2); }
/* the visitor: a dark dot with a light ring, so it does not look like a category */
.me-pin span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--ink); border: 3px solid var(--paper); box-shadow: 0 0 0 2px var(--ink), 0 2px 8px rgba(21, 26, 24, .45); }
.cluster span { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; background: var(--deep); color: var(--paper); border: 2px solid var(--sand); box-shadow: 0 2px 8px rgba(21, 26, 24, .45); font-family: var(--sans); font-size: .8rem; }

.legend { background: rgba(246, 244, 238, .94); color: var(--ink); padding: 10px 12px; border-radius: 2px; font-family: var(--sans); font-size: .75rem; line-height: 1.5; box-shadow: 0 2px 8px rgba(21, 26, 24, .25); }
.legend-title { letter-spacing: .2em; text-transform: uppercase; font-size: .65rem; color: var(--sand-dark); margin-bottom: 4px; }
.legend ul { list-style: none; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

.leaflet-popup-content-wrapper { background: var(--paper); color: var(--ink); border-radius: 2px; }
.leaflet-popup-tip { background: var(--paper); }
.pop { font-family: var(--sans); padding: 4px 2px; max-width: 240px; }
.pop strong { display: block; font-family: var(--serif); font-weight: 500; font-size: 1.35rem; line-height: 1.1; margin-bottom: .4rem; }
.pop-cat { display: inline-flex; align-items: center; gap: 6px; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(21, 26, 24, .7); }
.pop-cat::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.pop-short { margin: .5rem 0 0 !important; font-size: .85rem; line-height: 1.45; color: rgba(21, 26, 24, .85); }
.pop a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sand-dark); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; }
.pop a:hover { text-decoration: underline; }
.leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 22px; line-height: 44px; color: var(--ink); }
.leaflet-touch .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.leaflet-container :focus-visible { outline: 2px solid var(--sand-dark); outline-offset: 2px; }

@supports not (view-transition-name: none) { body { animation: pagein .5s ease; } }
@keyframes pagein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  body { animation: none !important; }
  .pin span { transition: none; }
}
