/**
 * Karten aus [maplibre_map].
 *
 * Die Höhe kommt als Custom Property aus dem Shortcode, damit pro Karte ein
 * anderer Wert möglich ist, ohne Inline-Styles am Canvas.
 */

.cicero-maplibre {
  position: relative;
  width: 100%;
}

.cicero-maplibre__canvas {
  width: 100%;
  height: var(--cicero-maplibre-height, 480px);
  background: #e9e7e2; /* Fläche vor dem ersten Kachelbild, statt Weiß. */
}

/* Popup -----------------------------------------------------------------
   MapLibre positioniert Popup und Marker über transform und schreibt den Wert
   bei jeder Kartenbewegung neu. Erbt das Element eine Transition darauf (Themes
   setzen gern transition: all), fliegt das Popup beim Öffnen aus der Kartenecke
   heran und zieht beim Verschieben nach. Deshalb hier ausdrücklich abschalten;
   die eigene Einblendung läuft über die Deckkraft von Inhalt und Spitze und
   lässt transform unberührt. */

.cicero-maplibre .maplibregl-popup,
.cicero-maplibre .maplibregl-marker {
  transition: none !important;
  animation: none !important;
}

@keyframes cicero-maplibre-popup-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.cicero-maplibre .maplibregl-popup-content,
.cicero-maplibre .maplibregl-popup-tip {
  /* !important, weil Animationen des Themes sonst gewinnen können. */
  animation: cicero-maplibre-popup-in 260ms cubic-bezier(0.22, 0.61, 0.36, 1) both !important;
}

@media (prefers-reduced-motion: reduce) {
  .cicero-maplibre .maplibregl-popup-content,
  .cicero-maplibre .maplibregl-popup-tip {
    animation-duration: 1ms !important;
  }
}

/* MapLibre setzt am Canvas eine eigene Schrift; im Popup soll die Schriftart des
   Themes greifen, damit die Karte nicht aus dem Seitenbild fällt — die Größe
   aber nicht, sonst wird die Adresse je Theme unterschiedlich klein. Über die
   Custom Property lässt sie sich pro Projekt nachziehen. */
.cicero-maplibre .maplibregl-popup-content {
  /* rechts Platz für das Schließen-X, damit es nicht im Text sitzt */
  padding: 1.05rem 2.6rem 1.05rem 1.15rem;
  font-family: inherit;
  font-size: var(--cicero-maplibre-popup-font-size, 15px);
  line-height: 1.55;
  border-radius: 2px;
  box-shadow: 0 4px 20px rgb(0 0 0 / 18%);
}

.cicero-maplibre .maplibregl-popup-content :first-child {
  margin-top: 0;
}

.cicero-maplibre .maplibregl-popup-content :last-child {
  margin-bottom: 0;
}

/* Das Schließen-X liegt bei MapLibre ohne eigene Maße in der Ecke
   (right: 0; top: 0) und rutscht damit in den Text. Hier wird es eine runde
   Fläche mit Abstand zum Rand und mittig sitzendem Zeichen. */
.cicero-maplibre .maplibregl-popup-close-button {
  display: flex;
  align-items: center;
  justify-content: center;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  color: #6b7280;
  font-family: inherit;
  font-size: 19px;
  line-height: 1;
}

.cicero-maplibre .maplibregl-popup-close-button:hover,
.cicero-maplibre .maplibregl-popup-close-button:focus-visible {
  background-color: rgb(0 0 0 / 6%);
  color: #111827;
}

/* Navigations-Symbol: ein <a> in der Button-Gruppe von MapLibre. Die Maße
   entsprechen den übrigen Steuerelementen (29px), damit die Gruppe bündig
   bleibt. */
.cicero-maplibre a.cicero-maplibre__navigate {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  color: #333;
  text-decoration: none;
  box-shadow: none;
}

.cicero-maplibre a.cicero-maplibre__navigate:hover,
.cicero-maplibre a.cicero-maplibre__navigate:focus-visible {
  background-color: rgb(0 0 0 / 5%);
  color: #333;
}

.cicero-maplibre a.cicero-maplibre__navigate svg {
  display: block;
}

.cicero-maplibre__noscript-link {
  margin: 0.75rem 0 0;
}

.cicero-maplibre .maplibregl-ctrl-attrib {
  font-size: 11px;
}

.cicero-maplibre__error,
.cicero-maplibre__noscript {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 8rem;
  margin: 0;
  padding: 1.5rem;
  text-align: center;
  background: #e9e7e2;
}

.cicero-maplibre__notice {
  padding: 0.75rem 1rem;
  border-left: 3px solid #b32d2e;
  background: #fdf3f3;
  font-size: 0.9em;
}
