/* Explore Montréal map page. Colour and type tokens match styles.css. */
:root {
  --bg: #fbfdff;
  --blue-50: #eef5fc;
  --blue-100: #dbe9f7;
  --blue-300: #a3c6e8;
  --blue-700: #3a6391;
  --ink: #1d3452;
  --serif: "Cormorant Garamond", Georgia, serif;
  --caps: "Cinzel", "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--serif); -webkit-font-smoothing: antialiased; }
a { color: var(--blue-700); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-700); outline-offset: 2px; }

/* Phones: header, chips, map, then a list that scrolls on its own (so map and page gestures never fight) */
.explore {
  height: 100vh; height: 100dvh; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas: "top" "chips" "map" "list";
}

.top { grid-area: top; text-align: center; padding: max(10px, env(safe-area-inset-top)) 16px 6px; }
.back { display: inline-block; font-family: var(--caps); font-size: .6rem; letter-spacing: .24em; text-transform: uppercase; text-decoration: none; padding: 4px 0; }
.top h1 { font-family: var(--caps); font-weight: 400; font-size: 1.25rem; letter-spacing: .18em; padding-left: .18em; text-transform: uppercase; }
.top p { display: none; font-style: italic; font-size: 1.1rem; line-height: 1.4; color: var(--blue-700); margin-top: 6px; }

.chips { grid-area: chips; display: flex; gap: 8px; overflow-x: auto; padding: 6px 16px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--blue-100); font-size: 1.02rem; font-weight: 500; line-height: 1.2;
}
.chip:hover { border-color: var(--blue-300); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px #fff; }

.map-pane { grid-area: map; position: relative; min-height: 0; background: var(--blue-50); border-block: 1px solid var(--blue-100); }
#guideMap { position: absolute; inset: 0; }
.map-error { position: absolute; inset: 0; display: grid; place-content: center; padding: 24px; text-align: center; font-size: 1.15rem; background: var(--blue-50); }
.recenter {
  position: absolute; z-index: 2; left: 10px; top: 10px; padding: 8px 14px; border-radius: 999px;
  font-family: var(--caps); font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: var(--blue-700);
  background: rgba(255,255,255,.92); border: 1px solid rgba(58,99,145,.35); box-shadow: 0 4px 14px rgba(29,52,82,.16);
}

.list { grid-area: list; position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px max(20px, env(safe-area-inset-bottom)); }
.group h2 {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 9px; padding: 14px 0 8px; background: var(--bg);
  font-family: var(--caps); font-weight: 500; font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--blue-700);
}
.place { border-top: 1px solid var(--blue-100); padding: 10px 0; scroll-margin-top: 44px; }
.place.active { background: var(--blue-50); box-shadow: 0 0 0 100vmax var(--blue-50); clip-path: inset(0 -16px); }
.place-main { display: block; width: 100%; text-align: left; background: none; border: 0; }
.place-name { display: block; font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
.place-area { font-family: var(--caps); font-size: .56rem; letter-spacing: .18em; text-transform: uppercase; color: var(--blue-700); margin-left: 6px; white-space: nowrap; }
.place-note { display: block; font-size: 1.08rem; line-height: 1.35; margin-top: 2px; }
.place-address { display: block; font-style: italic; font-size: .95rem; color: var(--blue-700); margin-top: 2px; }
.links { display: flex; gap: 18px; margin-top: 6px; }
.links a { font-family: var(--caps); font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; padding: 4px 0; text-underline-offset: 4px; }

/* Map popups */
.maplibregl-popup { z-index: 3; }
.maplibregl-popup-content { font-family: var(--serif); color: var(--ink); padding: 14px 16px 10px; border-radius: 4px; box-shadow: 0 12px 30px rgba(29,52,82,.22); }
.maplibregl-popup-content h3 { font-size: 1.2rem; line-height: 1.2; padding-right: 14px; }
.maplibregl-popup-content p { font-size: 1.02rem; line-height: 1.3; margin-top: 4px; }
.maplibregl-popup-close-button { font-size: 1.2rem; width: 28px; height: 28px; color: var(--blue-700); }

.noscript { position: fixed; inset: auto 0 0; padding: 16px; text-align: center; background: var(--blue-100); }

/* Wider screens and landscape phones: sidebar on the left, map on the right */
@media (min-width: 820px), (orientation: landscape) and (min-width: 560px) {
  .explore {
    grid-template-columns: clamp(270px, 34vw, 420px) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "top map" "chips map" "list map";
  }
  .map-pane { border-block: 0; border-left: 1px solid var(--blue-100); }
  .chips { flex-wrap: wrap; overflow: visible; padding-bottom: 14px; border-bottom: 1px solid var(--blue-100); }
}
@media (min-width: 820px) and (min-height: 720px) {
  .top { padding-top: 24px; }
  .top h1 { font-size: 1.6rem; margin-top: 8px; }
  .top p { display: block; }
}
/* Short landscape screens: keep the chips on one line so the list has room */
@media (orientation: landscape) and (max-height: 560px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; }
  .top h1 { font-size: 1rem; }
}
