/* ── NERJA PUBLIC PAGE ── prefix nn- */

/* Distance bands ("near you"). Colour is never the only signal: each band has
   its own shape (circle, rounded square, diamond), the distance is written
   and there is a legend. On white: green 5.0:1, blue 4.8:1, pink 6.0:1.
   Green and blue look alike in grey or with colour blindness: the shapes and
   the words carry the difference. */
.nn-page {
  --nn-near: #15803D;
  --nn-mid: var(--hp-blue);
  --nn-far: #BE185D;
}

.nn-page {
  background: var(--hp-bg);
  min-height: 60vh;
  padding: 40px 0 calc(var(--aml-footer-h, 70px) + env(safe-area-inset-bottom, 0px));
}
.nn-header { padding: 24px 0 20px; }
.nn-eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--hp-mid); margin: 0 0 10px;
}
.nn-title {
  font-size: clamp(28px, 4vw, 42px); font-weight: 700; letter-spacing: -.025em;
  line-height: 1.15; color: var(--hp-ink); margin: 0 0 10px;
}
.nn-note { font-size: 14px; color: var(--hp-mid); margin: 0 0 6px; max-width: 60ch; }
.nn-note a { color: var(--hp-blue); text-decoration: none; }
.nn-section-title {
  font-size: 18px; font-weight: 700; letter-spacing: -.01em;
  color: var(--hp-ink); margin: 0 0 14px;
}

/* ── EMERGENCY BLOCK ── */
.nn-emergency {
  background: var(--hp-white); border: 1px solid var(--hp-rule);
  border-left: 4px solid var(--hp-blue); border-radius: 14px;
  padding: 18px 20px; margin: 8px 0 32px;
}
.nn-emergency-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px; grid-template-columns: 1fr;
}
@media (min-width: 640px) { .nn-emergency-list { grid-template-columns: repeat(2, 1fr); } }
.nn-emergency-item { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; row-gap: 2px; align-items: baseline; }
.nn-emergency-number {
  grid-row: 1 / span 2; font-size: 28px; font-weight: 800; line-height: 1;
  color: var(--hp-blue); text-decoration: none; min-width: 3ch;
}
.nn-emergency-number:hover { color: var(--hp-blue-d); }
.nn-emergency-label { font-size: 15px; font-weight: 600; color: var(--hp-ink); }
.nn-emergency-source { font-size: 12px; color: var(--hp-mid); }

/* ── CHIPS ── */
.nn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.nn-chips[hidden] { display: none; }
.nn-chip {
  font: inherit; font-size: 13px; font-weight: 600; color: var(--hp-mid);
  background: var(--hp-white); border: 1px solid var(--hp-rule);
  border-radius: 20px; padding: 10px 16px; min-height: 44px; cursor: pointer;
}
.nn-chip:focus-visible { outline: 3px solid var(--hp-blue-d); outline-offset: 2px; }
.nn-chip:hover { background: var(--hp-bg-warm); color: var(--hp-ink); }
.nn-chip[aria-pressed="true"] { background: var(--hp-blue); border-color: var(--hp-blue); color: #fff; }

/* Visually hidden, still read by screen readers. */
.nn-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── MAP ──
   isolation keeps Leaflet's internal z-indexes (up to 1000) inside the map,
   so they can never rise above the sticky footer (z-index var(--aml-footer-z)). */
.nn-map-wrap { position: relative; z-index: 0; isolation: isolate; border-radius: 14px; overflow: hidden; border: 1px solid var(--hp-rule); }
.nn-map {
  width: 100%;
  height: clamp(320px, 62dvh, 640px);
  max-height: calc(100dvh - var(--aml-footer-h, 70px) - env(safe-area-inset-bottom, 0px) - 120px);
  background: var(--hp-bg-warm);
}
.nn-marker {
  /* A span is inline by default and then ignores width and height. */
  display: block;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--hp-blue); border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}
.nn-popup { font-size: 13px; line-height: 1.45; max-width: 240px; }
.leaflet-popup-content .nn-popup p { margin: 0 0 3px; }
.nn-popup-title { font-size: 15px; font-weight: 700; }
.leaflet-popup-content .nn-popup .nn-popup-cat { color: var(--hp-mid); margin-bottom: 6px; }
.nn-popup-line { white-space: pre-line; }
.leaflet-popup-content .nn-popup .nn-popup-meta { margin-top: 6px; color: var(--hp-mid); font-size: 12px; }
.nn-count { font-size: 13px; color: var(--hp-mid); margin: 10px 0 28px; }

/* ── LIST ── */
.nn-group { margin-bottom: 36px; }
.nn-group[hidden] { display: none; }
.nn-group-title {
  font-size: 17px; font-weight: 700; color: var(--hp-ink);
  margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--hp-rule);
}
.nn-items { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .nn-items { grid-template-columns: repeat(2, 1fr); } }
.nn-item { background: var(--hp-white); border: 1px solid var(--hp-rule); border-radius: 14px; padding: 16px 18px; }
.nn-item { position: relative; }
.nn-item .nn-edit { position: absolute; top: 12px; right: 14px; font-size: 12px; font-weight: 600; padding: 2px 8px; border: 1px solid var(--hp-rule); border-radius: 12px; background: var(--hp-white); }
.nn-edit + .nn-item-title { padding-right: 56px; }
.nn-item-title { font-size: 16px; font-weight: 700; color: var(--hp-ink); margin: 0 0 6px; }
.nn-item-line { font-size: 14px; color: var(--hp-mid); margin-bottom: 3px; }
.nn-item-hours { white-space: pre-line; }
/* Opening hours: one row per day (or range), today highlighted by JS. */
.nn-hours { margin: 10px 0 4px; padding: 10px 12px; background: var(--hp-bg); border-radius: 10px; }
.nn-hours-head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hp-mid); margin-bottom: 6px; }
.nn-hours-list { margin: 0; }
.nn-hours-row { display: grid; grid-template-columns: 124px 1fr; gap: 8px; align-items: baseline; padding: 4px 6px; margin: 0 -6px; border-radius: 6px; font-size: 14px; }
.nn-hours-row dt { color: var(--hp-mid); font-weight: 600; white-space: nowrap; }
.nn-hours-row dd { margin: 0; color: var(--hp-ink); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.nn-hours-row--closed dd { color: var(--hp-mid); font-style: italic; }
.nn-slot { white-space: nowrap; }
.nn-hours-row.is-today { background: var(--hp-white); border-left: 3px solid var(--hp-blue); border-radius: 0 6px 6px 0; padding-left: 10px; margin-left: -13px; }
.nn-hours-row.is-today dt { color: var(--hp-ink); }
.nn-hours-row.is-today dt::after { content: attr(data-today); margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--hp-blue); }
.nn-item a { color: var(--hp-blue); text-decoration: none; }
.nn-item a:hover { color: var(--hp-blue-d); }
.nn-item-meta { font-size: 12px; color: var(--hp-mid); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--hp-rule); }
.nn-empty { text-align: center; padding: 40px 20px; color: var(--hp-mid); }
.nn-attribution { font-size: 12px; color: var(--hp-mid); margin-top: 8px; }

/* ── NEAR YOU ── */
.nn-nearby {
  background: var(--hp-white); border: 1px solid var(--hp-rule);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
}
.nn-nearby[hidden] { display: none; }
.nn-nearby-title { font-size: 16px; font-weight: 700; color: var(--hp-ink); margin: 0 0 6px; }
.nn-nearby-privacy { font-size: 13px; color: var(--hp-mid); margin: 0 0 12px; max-width: 70ch; }
.nn-nearby-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nn-btn {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--hp-ink);
  background: var(--hp-white); border: 1px solid var(--hp-light);
  border-radius: 22px; padding: 10px 18px; min-height: 44px; cursor: pointer;
}
.nn-btn:hover { background: var(--hp-bg-warm); }
.nn-btn:focus-visible { outline: 3px solid var(--hp-blue-d); outline-offset: 2px; }
.nn-btn[hidden] { display: none; }
.nn-btn[disabled] { opacity: .6; cursor: progress; }
.nn-btn--primary { background: var(--hp-blue); border-color: var(--hp-blue); color: #fff; }
.nn-btn--primary:hover { background: var(--hp-blue-d); }
.nn-status { font-size: 14px; color: var(--hp-ink); margin: 12px 0 0; max-width: 70ch; }
.nn-status:empty { display: none; }

/* Shapes: same footprint (about 18 px) in the map and 12 px next to text. */
.nn-marker--near { background: var(--nn-near); }
.nn-marker--mid { background: var(--nn-mid); border-radius: 4px; }
.nn-marker--far {
  background: var(--nn-far); border-radius: 2px;
  width: 14px; height: 14px; margin: 2px; box-sizing: border-box; transform: rotate(45deg);
}
.nn-shape { display: inline-block; flex: 0 0 auto; width: 12px; height: 12px; vertical-align: -1px; margin-right: 8px; }
.nn-shape--near { background: var(--nn-near); border-radius: 50%; }
.nn-shape--mid { background: var(--nn-mid); border-radius: 3px; }
.nn-shape--far { background: var(--nn-far); border-radius: 1px; transform: rotate(45deg) scale(.85); }

.nn-legend { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--hp-rule); }
.nn-legend[hidden] { display: none; }
.nn-legend-list { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.nn-legend-item { font-size: 14px; color: var(--hp-ink); display: flex; align-items: center; }
.nn-legend-item .nn-shape { margin-right: 8px; }
.nn-legend-note { font-size: 12px; color: var(--hp-mid); margin: 0; }

.nn-item-dist { font-size: 14px; font-weight: 600; color: var(--hp-ink); margin: 0 0 6px; display: flex; align-items: center; }
.nn-item-dist .nn-shape { vertical-align: baseline; }
.leaflet-popup-content .nn-popup .nn-popup-dist { font-weight: 600; margin-bottom: 6px; }

/* Origin: a ring with a label, no accuracy circle (it would suggest a
   precision we do not have). */
.nn-origin {
  display: block; width: 20px; height: 20px; box-sizing: border-box; border-radius: 50%;
  border: 4px solid var(--hp-ink); background: transparent;
  box-shadow: 0 0 0 2px #fff, inset 0 0 0 2px #fff;
}
.nn-origin-label {
  position: absolute; left: 26px; top: 0; white-space: nowrap; pointer-events: none;
  font-size: 12px; font-weight: 700; line-height: 20px; color: var(--hp-ink);
  background: #fff; border-radius: 10px; padding: 0 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

/* Cross at the centre of the map while choosing a point. */
.nn-crosshair {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  box-sizing: border-box; border: 2px solid var(--hp-ink); border-radius: 50%;
  box-shadow: 0 0 0 1px #fff, inset 0 0 0 1px #fff; pointer-events: none; z-index: 1000;
}
.nn-crosshair[hidden] { display: none; }
.nn-pickbar {
  position: absolute; left: 0; right: 0; bottom: 30px; z-index: 1000;
  display: flex; justify-content: center; gap: 8px; padding: 0 12px; pointer-events: none;
}
.nn-pickbar[hidden] { display: none; }
.nn-pickbar .nn-btn { pointer-events: auto; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.nn-crosshair::before, .nn-crosshair::after {
  content: ''; position: absolute; background: var(--hp-ink); box-shadow: 0 0 0 1px #fff;
}
.nn-crosshair::before { left: 50%; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; }
.nn-crosshair::after { top: 50%; left: -8px; right: -8px; height: 2px; margin-top: -1px; }
