/* ==========================================================================
   Location map — sits under the Heiligenberg story.
   Every value comes from the token set; nothing new is introduced here.
   ========================================================================== */

.map-figure {
  margin: 0;
  margin-block-start: clamp(4rem, 8vw, 7rem);
}

.map-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--r-xl);
  background: var(--c-cream-deep);
  box-shadow: var(--shadow-md);
}

.map-frame__canvas {
  height: clamp(20rem, 42vw, 30rem);
  width: 100%;
  background: var(--c-cream-deep);
}

/*
   The basemap is a neutral grey. Tinting it here — rather than paying for a
   custom tile style — pulls it into the rosé palette. Scoped to the tile
   pane so the marker, tooltip and controls keep their true colour.
*/
.map-frame .leaflet-tile-pane {
  filter: sepia(0.2) saturate(0.8) contrast(1.04) hue-rotate(-22deg);
}

/* Leaflet paints its own background behind the tiles */
.map-frame .leaflet-container {
  background: var(--c-cream-deep);
  font-family: var(--font-text);
}

.map-frame .leaflet-container:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: -4px;
}

/* ------------------------------------------------------------------ Pin -- */

.map-pin {
  /* Leaflet sizes the icon box; the parts inside centre on it. */
  position: relative;
}

.map-pin__dot,
.map-pin__pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.map-pin__dot {
  border: 2px solid var(--c-accent-on);
  background: var(--c-accent);
  box-shadow: var(--shadow-accent);
}

.map-pin__pulse {
  background: var(--c-accent);
  opacity: 0.35;
  animation: map-pin-pulse 2800ms var(--ease-out) infinite;
}

@keyframes map-pin-pulse {
  0% {
    transform: scale(1);
    opacity: 0.35;
  }
  70%,
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-pin__pulse {
    animation: none;
    opacity: 0.22;
  }
}

/* Permanent label beside the pin, set in the display face like a caption */
.map-frame .map-pin__label {
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  background: var(--c-cream-raised);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: var(--fs-small);
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.map-frame .map-pin__label::before {
  display: none; /* Leaflet's callout arrow */
}

/* ------------------------------------------------------------- Controls -- */

.map-frame__zoom {
  position: absolute;
  right: clamp(0.75rem, 1.6vw, 1.25rem);
  bottom: clamp(0.75rem, 1.6vw, 1.25rem);
  z-index: 500; /* over Leaflet's panes, under the page header */
  display: grid;
  gap: 0.4rem;
}

.map-frame__zoom-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-color: var(--c-line-strong);
  background: rgba(252, 248, 247, 0.9);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  font-size: 1rem;
}

/* ----------------------------------------------------------- Wheel hint -- */

.map-frame__hint {
  position: absolute;
  inset-inline: 0;
  bottom: clamp(0.75rem, 1.6vw, 1.25rem);
  z-index: 500;
  width: fit-content;
  max-width: calc(100% - 6rem);
  margin-inline: auto;
  padding: 0.5rem 1rem;
  border-radius: var(--r-pill);
  background: rgba(36, 28, 30, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--c-cream);
  font-size: var(--fs-meta);
  text-align: center;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

.map-frame__hint.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------- Attribution -- */

.map-frame .leaflet-control-attribution {
  /* Extra room on the right so the rounded frame corner never clips it. */
  padding: 0.15rem 1.4rem 0.15rem 0.75rem;
  border-radius: var(--r-pill) 0 0 0;
  background: rgba(252, 248, 247, 0.72);
  color: var(--c-ink-muted);
  font-family: var(--font-text);
  font-size: 0.625rem;
  letter-spacing: 0.01em;
}

.map-frame .leaflet-control-attribution a {
  color: var(--c-ink-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-frame .leaflet-control-attribution a:hover {
  color: var(--c-accent);
}

/* ------------------------------------------------------------- Caption -- */

.map-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-5) var(--sp-8);
  margin-block-start: clamp(1.5rem, 2.6vw, 2.25rem);
}

.map-caption__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5) clamp(2rem, 4vw, 3.5rem);
}

.map-caption__facts li {
  display: grid;
  gap: 0.3rem;
}

.map-caption__value {
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  line-height: 1.25;
}

.map-caption__label {
  color: var(--c-ink-muted);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.map-caption__note {
  /* 26ch waren enger als die Zeile selbst: „Haus Mali · Steigen · 88633
     Heiligenberg" brach dadurch in jeder Breite um, auch wenn daneben
     1.000 px frei blieben. Die Deckelung bleibt, sie greift nur nicht
     mehr gegen den eigenen Text. */
  max-width: 34ch;
  color: var(--c-ink-muted);
  font-size: var(--fs-meta);
  line-height: 1.5;
  text-align: right;
}

@media (max-width: 720px) {
  .map-caption {
    flex-direction: column;
    align-items: flex-start;
  }

  .map-caption__note {
    max-width: none;
    text-align: left;
  }
}
