.map-intro, .map-content { padding-block: clamp(2rem, 4vw, 3.5rem); }
#map-filter:not([hidden]) { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem 1rem; }
#map-filter #map-count { flex-basis: 100%; }
#map-jump, #map-location-select { min-inline-size: 0; max-inline-size: 100%; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.map-layout:has(#map-panel[hidden]) { grid-template-columns: 1fr; }
#activity-map { height: clamp(320px, 52vh, 520px); border: 1px solid var(--line); border-radius: 16px; background: #e9ecdf; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem; margin-top: .6rem; font-size: .875rem; }
.map-dot { width: .9rem; height: .9rem; border: 2px solid var(--forest-dark); border-radius: 50%; background: var(--forest); }
.map-dot.is-approximate, .map-marker.is-approximate { background: var(--paper); border-style: dashed; }
.map-marker { display: block; border: 3px solid white; border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 2px var(--forest-dark); }
.map-marker.is-approximate { border-color: var(--forest-dark); box-shadow: 0 0 0 2px white; }
.map-marker:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.map-location { margin-bottom: 1rem; padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; }
.map-location h2 { margin: 0; font-size: 1.75rem; }
.map-place, .map-note, .map-date, #map-count, .map-help { margin: .3rem 0; color: var(--muted); font-size: .875rem; }
.map-activity { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.map-activity h3 { margin-bottom: .45rem; font-size: 1.25rem; }
.map-activity a, .map-note a { color: var(--forest-dark); text-decoration: underline; }
.map-photo { margin: .7rem 0 0; color: var(--muted); font-size: .85rem; }
.map-photo img { width: 100%; max-width: 18rem; height: auto; border-radius: 8px; }
.map-photo figcaption { margin-top: .25rem; }
.map-reference { color: #536052; font-size: .75rem; font-weight: 650; white-space: nowrap; pointer-events: none; }
.map-locate { margin-top: .25rem; padding: .25rem .6rem; color: var(--forest-dark); background: var(--paper); border: 1px solid var(--line); border-radius: .4rem; font: inherit; font-size: .875rem; cursor: pointer; }
.leaflet-popup-content h2 { font-size: 1.35rem; }
.leaflet-popup-content p { margin: .35rem 0; }
[dir="rtl"] .leaflet-popup-content-wrapper { text-align: right; }
[dir="rtl"] #activity-map .leaflet-popup-close-button { left: 0; right: auto; }
@media (max-width: 760px) {
  .map-layout { grid-template-columns: 1fr; }
}

.map-cluster {
  display: grid;
  place-items: center;
  color: white;
  background: var(--forest-dark);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--forest-dark);
  font: 700 .875rem system-ui, sans-serif;
}
.map-cluster:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.map-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.map-location:target { outline: 2px solid var(--forest); outline-offset: 3px; }
