/* =========================================================================
   karte.css: selbst gehostete Straßenkarte (Kartenbausatz, 21.10.2026).
   Gehört zu app/partials/karte.php und assets/js/karte.js.
   Ruhig und hell; Marke nur am Marker (Navy #08004B, Gold #FFBD59).
   ========================================================================= */
.karte {
  background: #fff;
  border: 1px solid var(--linie, #E6E0D4);
  border-radius: var(--radius, 6px);
  overflow: hidden;
}

.karte__buehne {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  max-height: 560px;
  width: 100%;
  background: #F7F4EE; /* = Landfarbe der Karte, kein Sprung beim Einblenden */
}

/* Falle: maplibre-gl.css setzt .maplibregl-map { position: relative } und lädt
   später. Mit gleicher Spezifität fiele die Fläche auf 0 px Höhe. Darum zwei
   Klassen. */
.karte__buehne > .karte__flaeche {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s ease;
}
.karte__buehne > .karte__flaeche.ist-geladen { opacity: 1; }
.karte__buehne > .karte__flaeche.ist-ruhig { transition: none; }

.karte__hinweis {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  color: var(--grau, #4D4B63);
  font-size: .95rem;
}

/* Ohne WebGL oder bei Ladefehler: keine Kartenfläche, nur Adresse + Route */
.karte--ohne .karte__buehne { display: none; }

.karte__fuss {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--linie, #E6E0D4);
}
.karte--ohne .karte__fuss { border-top: 0; }
.karte__adresse {
  font-style: normal;
  line-height: 1.5;
  color: var(--tinte, #17143A);
}
.karte__adresse strong {
  font-family: var(--font-display, "Poppins", system-ui, sans-serif);
  font-weight: 500;
  color: var(--navy, #08004B);
}
.karte__ohne {
  flex-basis: 100%;
  order: 3;
  margin: 0;
  font-size: .9rem;
  color: var(--grau, #4D4B63);
}
.karte__ohne[hidden] { display: none; }
.karte__route { flex: 0 0 auto; }

/* ---------- Marker -------------------------------------------------------
   Hülle: MapLibre setzt hier transform (Position). Drehung nur an der Nadel. */
.kmarker {
  position: relative;
  width: 32px;
  height: 38px;
  pointer-events: none;
}
.kmarker__nadel {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  background: var(--navy, #08004B);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(8, 0, 75, .28);
}
.kmarker__nadel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--gold, #FFBD59);
}
.kmarker__schild {
  position: absolute;
  left: calc(100% + 4px);
  top: 3px;
  padding: .2rem .55rem;
  white-space: nowrap;
  font-family: var(--font-display, "Poppins", system-ui, sans-serif);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--navy, #08004B);
  background: #fff;
  border: 1px solid var(--linie, #E6E0D4);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(8, 0, 75, .10);
}

/* ---------- Bedienelemente von MapLibre, ruhig --------------------------- */
.karte .maplibregl-ctrl-group {
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(8, 0, 75, .14);
}
.karte .maplibregl-ctrl-attrib {
  background: rgba(255, 255, 255, .85);
  font-size: 11px;
  color: var(--grau, #4D4B63);
}
.karte .maplibregl-ctrl-attrib a { color: var(--grau, #4D4B63); }
.karte .maplibregl-cooperative-gesture-screen {
  background: rgba(8, 0, 75, .62);
  font-family: var(--font-body, "Heebo", system-ui, sans-serif);
}

@media (max-width: 759px) {
  .karte__buehne { aspect-ratio: 1 / 1; max-height: 70vh; min-height: 280px; }
  .karte__fuss { padding: 1rem; }
  .karte__route { width: 100%; text-align: center; }
  .kmarker__schild { font-size: 12px; }
}
