/* Protected map pages. The map tiles stay untouched for readability; only the surrounding interface is themed. */

@font-face {
  font-family: 'Cormorant Garamond Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(../fonts/cormorant-garamond-latin-ext-wght-normal.woff2?v=2) format('woff2-variations'), url(../fonts/cormorant-garamond-latin-ext-wght-normal.woff2?v=2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url(../fonts/cormorant-garamond-latin-wght-normal.woff2) format('woff2-variations'), url(../fonts/cormorant-garamond-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Cormorant Garamond Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 300 700;
  src: url(../fonts/cormorant-garamond-latin-ext-wght-italic.woff2?v=2) format('woff2-variations'), url(../fonts/cormorant-garamond-latin-ext-wght-italic.woff2?v=2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Cormorant Garamond Variable';
  font-style: italic;
  font-display: swap;
  font-weight: 300 700;
  src: url(../fonts/cormorant-garamond-latin-wght-italic.woff2) format('woff2-variations'), url(../fonts/cormorant-garamond-latin-wght-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #050607;
  --bg-2: #090c0d;
  --surface: #0d1112;
  --surface-2: #131819;
  --ivory: #efe8dc;
  --ivory-2: #d8d0c2;
  --muted: #a59d90;
  --faint: #8a8478;
  --line: rgba(239, 232, 220, .12);
  --line-2: rgba(239, 232, 220, .26);
  --amber: #e0a458;
  --amber-hi: #efb877;
  --amber-soft: #e6bf8e;
  --amber-ink: #1b1207;
  --pin: #0b0f10;
  --water: #7fa6a0;
  --serif: 'Cormorant Garamond Variable', 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, Menlo, monospace;
  --gutter: clamp(16px, 3.4vw, 48px);
  --ease: cubic-bezier(.22, .7, .18, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 420px at 85% 0%, rgba(224, 164, 88, .07), rgba(224, 164, 88, 0) 70%) no-repeat,
    var(--bg);
  color: var(--ivory-2);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  body { overflow-x: clip; }
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
[hidden] { display: none !important; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.18em;
}

.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9999;
  padding: 12px 16px;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
}

/* Header */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 70px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 7, .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ivory);
  font: 500 22px/1 var(--serif);
  white-space: nowrap;
}

.brand-mark { width: 32px; height: 32px; flex: none; color: var(--ivory); }
.brand-light { color: var(--ivory-2); font-style: italic; font-weight: 400; }

.preview-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(224, 164, 88, .45);
  border-radius: 2px;
  color: var(--amber-hi);
  font: 700 10.5px/1.2 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.preview-label .icon { width: 13px; height: 13px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-left: auto;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  color: var(--ivory);
  font: 700 11.5px/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color .3s, background-color .3s;
}

.back:hover { border-color: var(--ivory); background: rgba(239, 232, 220, .07); }
.back .icon { width: 16px; height: 16px; }

/* Page heading */

main {
  width: min(1520px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 26px 0 36px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
  color: var(--faint);
  font: 600 11px/1.4 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.breadcrumb a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.breadcrumb a:hover { color: var(--ivory); }
.breadcrumb strong { color: var(--ivory-2); font-weight: 600; }

.heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}

.heading > div:first-child { min-width: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--muted);
  font: 600 11px/1.3 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
}

.eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--amber); flex: none; }

h1 {
  margin: 0 0 12px;
  color: var(--ivory);
  font: 500 clamp(42px, 5.4vw, 80px)/.98 var(--serif);
  letter-spacing: -.005em;
}

h1 em, .detail h2 em { color: var(--amber-soft); font-style: italic; font-weight: 400; }

.intro { margin: 0; color: var(--muted); font-size: 16px; }

.water-select label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font: 600 11px/1.3 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.water-select select {
  min-width: 290px;
  height: 50px;
  padding: 0 44px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0a458' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 18px no-repeat;
  color: var(--ivory);
  appearance: none;
  -webkit-appearance: none;
}

.water-select select option { background: var(--surface); color: var(--ivory); }

.info-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}

.info-line b { color: var(--ivory); font-weight: 700; }

.preview-warning {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0 22px;
  color: var(--faint);
  font-size: 13.5px;
}

.preview-warning .icon { width: 15px; height: 15px; color: var(--amber); }

/* Offline copy in use (shared/locked-map.js). */
.offline-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--amber);
  border-radius: 4px;
  background: rgba(224, 164, 88, .1);
  color: var(--ivory);
  font-size: 14px;
  line-height: 1.5;
}

/* Controls */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.view-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--bg-2);
}

.view-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 15px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background-color .25s, color .25s;
}

.view-switch button:hover { color: var(--ivory); }
.view-switch button[aria-pressed="true"] { background: var(--ivory); color: var(--bg); }
.kind-switch span { opacity: .7; font-size: 12px; }

.outline,
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: transparent;
  color: var(--ivory);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background-color .25s, border-color .25s, color .25s;
}

.outline:hover { border-color: var(--ivory); background: rgba(239, 232, 220, .06); }
.outline .icon { width: 17px; height: 17px; color: var(--amber); }

.outline[aria-pressed="true"] {
  border-color: var(--amber);
  background: rgba(224, 164, 88, .12);
  color: var(--amber-hi);
}

#saved-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(239, 232, 220, .1);
  font-size: 11.5px;
  font-weight: 700;
}

.primary {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
}

.primary:hover { border-color: var(--amber-hi); background: var(--amber-hi); }
.primary .icon { width: 16px; height: 16px; stroke-width: 1.9; }

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--ivory-2);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
}

.text-button:hover { color: var(--ivory); text-decoration-color: var(--amber); }
.text-button .icon { width: 15px; height: 15px; }

/* Map workspace */

.workspace {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  height: clamp(520px, calc(100vh - 210px), 820px);
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .9);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}

.sidebar-top { padding: 18px 16px 14px; border-bottom: 1px solid var(--line); }

.sidebar h2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
  color: var(--ivory);
  font: 700 11.5px/1.3 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.sidebar h2 span {
  min-width: 26px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(224, 164, 88, .16);
  color: var(--amber-hi);
  font-size: 11.5px;
  letter-spacing: 0;
  text-align: center;
}

.search-field { position: relative; }

.search-field .icon {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px 10px 40px;
  border: 1px solid var(--line-2);
  border-radius: 2px;
  background: var(--bg);
  color: var(--ivory);
  font-size: 14.5px;
}

.search-field input::placeholder { color: var(--faint); }
.search-field input:focus-visible { border-color: var(--amber); outline-offset: 1px; }

.places {
  flex: 1;
  min-height: 0;
  padding: 6px;
  overflow: auto;
  scrollbar-color: rgba(239, 232, 220, .2) transparent;
  scrollbar-width: thin;
}

.place-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 10px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ivory-2);
  text-align: left;
  transition: background-color .2s;
}

.place-row + .place-row { margin-top: 2px; }
.place-row:hover { background: rgba(239, 232, 220, .05); }

.place-row[aria-pressed="true"] {
  background: rgba(224, 164, 88, .12);
  box-shadow: inset 2px 0 0 var(--amber);
}

.place-number {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  color: var(--ivory);
  font-size: 11.5px;
  font-weight: 700;
}

.place-row[aria-pressed="true"] .place-number { border-color: var(--amber); background: var(--amber); color: var(--amber-ink); }
.place-row b { color: var(--ivory); font-size: 14px; font-weight: 600; }

.place-row small {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font: 11.5px/1.4 var(--mono);
}

.saved-mark { width: 13px; height: 13px; margin-left: 7px; color: var(--amber); vertical-align: -1px; }
.empty { padding: 16px 10px; color: var(--faint); font-size: 14px; }

/* isolation keeps the legend and status overlays below the sticky header */
.map-panel { position: relative; isolation: isolate; min-width: 0; }

#map {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #dfe5df;
}

/* Dark map (default, toggled by #map-theme): the same OpenStreetMap tiles, recoloured in the browser. */
.map-dark #map { background: #11171a; }

.map-dark .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(.95) contrast(.88) saturate(.6);
}

.map-theme {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 600;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: rgba(9, 12, 13, .92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  color: var(--ivory);
}

.map-theme:hover { border-color: var(--ivory); }
.map-theme .icon { width: 20px; height: 20px; }
.map-theme .icon-moon { color: var(--amber); }
.map-theme[aria-pressed="true"] .icon-sun,
.map-theme[aria-pressed="false"] .icon-moon { display: none; }

/* "Mano vieta" (shared/map.js): under the theme button, blue while the visitor's position is shown. */
.map-locate {
  position: absolute;
  top: 62px;
  right: 10px;
  z-index: 600;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: rgba(9, 12, 13, .92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  color: var(--ivory);
}

.map-locate:hover { border-color: var(--ivory); }
.map-locate .icon { width: 20px; height: 20px; }
.map-locate[aria-pressed="true"] { border-color: #5aa9ff; color: #5aa9ff; }
.map-locate[aria-pressed="true"] .icon { fill: currentColor; }
.map-locate.is-busy .icon { animation: locate-wait 1.1s ease-in-out infinite; }

@keyframes locate-wait {
  50% { opacity: .35; }
}

.me-pin { border: 0; background: none; }

.me-pin span {
  display: block;
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2f8cff;
  box-shadow: 0 0 0 0 rgba(90, 169, 255, .55), 0 2px 8px rgba(0, 0, 0, .5);
  animation: me-pulse 2.4s ease-out infinite;
}

@keyframes me-pulse {
  0% { box-shadow: 0 0 0 0 rgba(90, 169, 255, .55), 0 2px 8px rgba(0, 0, 0, .5); }
  70%, 100% { box-shadow: 0 0 0 16px rgba(90, 169, 255, 0), 0 2px 8px rgba(0, 0, 0, .5); }
}

.place-distance { display: block; color: var(--amber); font-weight: 600; }

.sort-note {
  margin: 4px 10px 8px;
  color: var(--faint);
  font-size: 12px;
}

/* Selected place card on the map */
.place-peek {
  position: absolute;
  left: 12px;
  bottom: 28px;
  z-index: 600;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "num text close" "actions actions actions";
  align-items: center;
  gap: 10px 12px;
  width: min(430px, calc(100% - 24px));
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: rgba(9, 12, 13, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  animation: peek-in .35s var(--ease) both;
}

@keyframes peek-in {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to { opacity: 1; transform: none; }
}

.peek-number {
  grid-area: num;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--amber);
  color: var(--amber-ink);
  font: 700 13px/1 var(--sans);
}

.peek-text { grid-area: text; min-width: 0; margin: 0; }

.peek-text b {
  display: block;
  overflow: hidden;
  color: var(--ivory);
  font: 500 22px/1.1 var(--serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.peek-text small { display: block; margin-top: 3px; color: var(--muted); font: 12px/1.4 var(--mono); }

.peek-close {
  grid-area: close;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -6px -6px -6px 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--ivory-2);
}

.peek-close:hover { background: rgba(239, 232, 220, .08); color: var(--ivory); }
.peek-close .icon { width: 20px; height: 20px; }

.peek-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.peek-actions .primary,
.peek-actions .outline { min-height: 44px; padding: 8px 12px; font-size: 13.5px; }
.peek-actions .icon { width: 15px; height: 15px; }
.map-panel.has-peek .map-legend { display: none; }

.map-legend {
  position: absolute;
  left: 12px;
  bottom: 30px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: rgba(5, 6, 7, .82);
  color: var(--ivory-2);
  font-size: 11.5px;
  pointer-events: none;
}

.legend-dot { width: 12px; height: 12px; border: 2px solid var(--amber); border-radius: 50%; background: var(--pin); }

.legend-group {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--amber);
  color: var(--amber-ink);
  font-weight: 700;
}

.map-message {
  position: absolute;
  top: 10px;
  left: 54px;
  right: 64px;
  z-index: 500;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(224, 164, 88, .5);
  border-radius: 3px;
  background: rgba(9, 12, 13, .94);
  color: var(--ivory);
  font-size: 13px;
}

/* Markers: dark pins with an amber ring read clearly on the light map tiles. */
.number-pin { border: 0; background: none; }

.number-pin span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--amber);
  border-radius: 50%;
  background: var(--pin);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .45);
  color: #fff;
  font: 700 11px/1 var(--sans);
  transition: transform .2s;
}

.number-pin.selected span {
  border-color: var(--pin);
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(224, 164, 88, .45), 0 3px 12px rgba(0, 0, 0, .5);
  color: var(--amber-ink);
  transform: scale(1.15);
}

.number-pin.cluster span {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(11, 15, 16, .55);
  background: var(--amber);
  background-clip: padding-box;
  color: var(--amber-ink);
  font-size: 13px;
}

/* On the dark map the pins switch to ivory so they stay the brightest thing on screen. */
.map-dark .number-pin span { border-color: var(--amber); background: var(--ivory); color: #0b0f10; box-shadow: 0 0 0 3px rgba(5, 6, 7, .45), 0 4px 12px rgba(0, 0, 0, .6); }
.map-dark .number-pin.selected span { border-color: var(--ivory); background: var(--amber); color: var(--amber-ink); box-shadow: 0 0 0 5px rgba(224, 164, 88, .35), 0 4px 14px rgba(0, 0, 0, .6); }
.map-dark .number-pin.cluster span { border-color: rgba(239, 232, 220, .35); background: var(--amber); background-clip: padding-box; color: var(--amber-ink); }
.map-dark .legend-dot { background: var(--ivory); }

/* Selected place */

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 40px;
  margin-top: 20px;
  padding: 32px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background:
    radial-gradient(ellipse 50% 80% at 100% 0%, rgba(224, 164, 88, .07), rgba(224, 164, 88, 0) 70%),
    var(--surface);
  scroll-margin-top: 90px;
}

.detail > div:first-child { min-width: 0; }

.detail h2 {
  margin: 0 0 10px;
  color: var(--ivory);
  font: 500 clamp(32px, 3.4vw, 46px)/1.02 var(--serif);
}

.detail p { margin: 6px 0; }

#coordinates {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ivory-2);
  font: 13.5px/1.5 var(--mono);
}

#coordinates:not(:empty)::before {
  content: '';
  width: 15px;
  height: 15px;
  background: var(--amber);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.7-6.5-11.2a6.5 6.5 0 0 1 13 0C18.5 15.3 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.8' r='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.7-6.5-11.2a6.5 6.5 0 0 1 13 0C18.5 15.3 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.8' r='2.4'/%3E%3C/svg%3E") center / contain no-repeat;
}

.detail-note {
  max-width: 760px;
  color: var(--ivory-2);
  font-size: 15.5px;
  white-space: pre-line;
}

#detail-kind:not(:empty) {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(224, 164, 88, .45);
  border-radius: 2px;
  color: var(--amber-hi);
  font: 700 10.5px/1.3 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
}

#detail-kind:empty { display: none; }

.detail-tip {
  max-width: 760px;
  margin: 14px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--water);
  color: var(--muted);
  font-size: 14px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.gallery figure { margin: 0; }

.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 12.5px;
  transition: border-color .25s;
}

.gallery button:hover { border-color: var(--amber); }

.gallery img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  transition: transform .6s var(--ease);
}

.gallery button:hover img { transform: scale(1.04); }
.gallery figcaption { margin-top: 6px; color: var(--faint); font-size: 12.5px; }

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

#copy-status { min-height: 1.5em; margin: 0; color: var(--muted); font-size: 12.5px; text-align: center; }

.hint { margin: 16px 0; color: var(--faint); font-size: 13.5px; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 22px 0 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

footer span { display: inline-flex; align-items: center; gap: 10px; }
footer .icon { width: 18px; height: 18px; color: var(--water); }
footer small { color: var(--faint); font-size: 12.5px; }
footer small a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ivory-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
footer small a:hover { color: var(--ivory); }

.noscript { margin: 24px var(--gutter); color: var(--ivory); }

/* Access check shown by locked-map.js before the map loads (its inline sizing is overridden here). */

.access-gate {
  max-width: min(560px, calc(100% - 32px)) !important;
  margin: clamp(56px, 12vh, 120px) auto !important;
  padding: 36px 32px !important;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ivory);
  font-size: 16px;
  text-align: center;
}

.access-gate:not(:has(a))::before {
  content: '';
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 18px;
  border: 2px solid var(--line-2);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: gate-spin 1s linear infinite;
}

@keyframes gate-spin { to { transform: rotate(360deg); } }

.access-gate p { margin: 0 0 22px; color: var(--ivory-2); }

.access-gate a:not(.gate-link) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--amber);
  border-radius: 2px;
  background: var(--amber);
  color: var(--amber-ink);
  font: 700 12.5px/1.2 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.access-gate a:not(.gate-link):hover { background: var(--amber-hi); }

/* The map's offer for a visitor without access (locked-map.js). */
.access-gate.is-offer { border-color: rgba(224, 164, 88, .5); }
.access-gate.is-offer::before { display: none; }

.gate-eyebrow {
  margin: 0 0 12px !important;
  color: var(--muted) !important;
  font: 600 11.5px/1.3 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.access-gate h1 { margin: 0 0 12px; font-size: clamp(36px, 6vw, 52px); line-height: 1.02; }
.access-gate .gate-text { margin-bottom: 18px; }
.gate-price { margin-bottom: 20px !important; color: var(--ivory-2); font-size: 15px; }
.gate-price strong { color: var(--ivory); font: 500 46px/1 var(--serif); }
.access-gate .gate-buy { width: min(320px, 100%); min-height: 54px; }

.access-gate .gate-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 6px;
  color: var(--ivory);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(224, 164, 88, .6);
  text-underline-offset: 4px;
}

.access-gate .gate-link:hover { color: var(--amber-hi); }
.access-gate .gate-alt { margin-top: 12px; color: var(--amber-hi); }
.gate-login { margin: 14px 0 0 !important; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted) !important; font-size: 14.5px; }
.gate-login .gate-link { display: inline-flex; margin: 0; }

/* Photo viewer */

.photo-dialog {
  max-width: min(94vw, 1100px);
  max-height: 94vh;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--ivory);
}

.photo-dialog::backdrop { background: rgba(3, 4, 5, .9); }
.photo-dialog nav { display: flex; justify-content: space-between; gap: 12px; }
.photo-dialog nav .outline .icon { color: var(--ivory); }

.photo-dialog img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  margin: 14px auto;
  object-fit: contain;
}

.photo-dialog p { margin: 0; color: var(--muted); font-size: 13.5px; text-align: center; }

/* Leaflet controls, popups and attribution in the site's palette */

.leaflet-container { font-family: var(--sans); }
.leaflet-container a { color: var(--amber-hi); }

.leaflet-bar,
.leaflet-touch .leaflet-bar {
  overflow: hidden;
  border: 1px solid var(--line-2) !important;
  border-radius: 3px !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35) !important;
}

.leaflet-bar a,
.leaflet-touch .leaflet-bar a {
  width: 36px;
  height: 36px;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: rgba(9, 12, 13, .94) !important;
  color: var(--ivory) !important;
  line-height: 34px;
}

.leaflet-bar a:last-child { border-bottom: 0 !important; }

@media (pointer: coarse) {
  .leaflet-bar a,
  .leaflet-touch .leaflet-bar a { width: 44px; height: 44px; font-size: 22px !important; line-height: 42px; }
}
.leaflet-bar a:hover, .leaflet-bar a:focus { background: var(--surface-2) !important; }
.leaflet-bar a.leaflet-disabled { color: var(--faint) !important; }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color: var(--ivory);
}

.leaflet-popup-content-wrapper { border: 1px solid var(--line-2); border-radius: 3px; }
.leaflet-popup-content { margin: 11px 30px 11px 14px; font: 600 14px/1.5 var(--sans); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--ivory); }

.leaflet-container .leaflet-control-attribution {
  background: rgba(5, 6, 7, .78);
  color: var(--ivory-2);
  font-size: 10.5px !important;
}

/* Responsive */

@media (min-width: 761px) {
  .workspace[data-view="list"] { grid-template-columns: 1fr; }
  .workspace[data-view="list"] .map-panel { display: none; }
  .workspace[data-view="list"] .sidebar { border-right: 0; }
}

@media (max-width: 1000px) {
  .workspace { grid-template-columns: 280px minmax(0, 1fr); }
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .detail-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .detail-actions > .primary, .detail-actions > .outline { flex: 1 1 220px; }
  #copy-status { flex-basis: 100%; text-align: left; }
}

@media (max-width: 760px) {
  header { height: 62px; gap: 10px; }
  .brand { gap: 9px; font-size: 19px; }
  .brand-mark { width: 28px; height: 28px; }
  .preview-label { display: none; }
  .back { min-height: 44px; padding: 0 12px; letter-spacing: .1em; }

  main { padding-top: 18px; }
  .breadcrumb { margin-bottom: 22px; }
  .heading { display: block; }
  h1 { font-size: clamp(38px, 11vw, 52px); }
  .intro { font-size: 15px; }
  .water-select { margin-top: 22px; }
  .water-select select { width: 100%; min-width: 0; font-size: 16px; }
  .search-field input { font-size: 16px; }
  .breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .breadcrumb { align-items: center; gap: 6px 10px; margin-bottom: 14px; }
  .info-line { gap: 6px 18px; font-size: 13px; }

  .toolbar { gap: 8px; }
  .view-switch { display: flex; width: 100%; }
  .view-switch button { flex: 1; padding: 0 8px; }
  .toolbar > .outline { flex: 1 1 140px; font-size: 13.5px; padding: 10px; }

  .workspace { display: block; height: clamp(440px, 68vh, 640px); }
  .sidebar { height: 100%; border: 0; }
  .map-panel { height: 100%; }
  .workspace[data-view="map"] .sidebar { display: none; }
  .workspace[data-view="list"] .map-panel { display: none; }
  .places { padding: 6px 8px; }
  .place-row { padding: 13px 8px; }

  .map-legend { bottom: 28px; padding: 6px 9px; font-size: 10.5px; }
  .place-peek { left: 8px; right: 8px; bottom: 24px; width: auto; padding: 12px; }
  .peek-text b { font-size: 20px; }
  .map-message { font-size: 12px; }

  .detail { margin-top: 16px; padding: 22px 18px; }
  .detail-actions { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .detail-actions > .primary, .detail-actions > .outline { flex: none; }
  #copy-status { flex-basis: auto; text-align: center; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery img { height: 120px; }

  footer { flex-direction: column; gap: 8px; }
}

@media (max-width: 430px) {
  .peek-actions { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .brand-light { display: none; }
  .back { letter-spacing: .06em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .access-gate:not(:has(a))::before { animation-duration: 2.4s; }
  .place-peek { animation: none; }
  .me-pin span, .map-locate.is-busy .icon { animation: none; }
}
