/* Tag der Befreiung — Karte (Leaflet-Variante) */

.tbr-karte-wrapper {
  position: relative;
  height: 700px;
  max-height: 80vh;
  background: #ecebe7;
}

#tbr-karte {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
}

/* ---------- Marker ---------- */

.tbf-marker-wrapper {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='80px' width='75px'%3E%3Cline x1='50%25' y1='62%25' x2='50%25' y2='100%25' style='stroke:%23000000;stroke-width:3' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

.tbf-marker {
  width: 75px;
  height: 50px;
  background-size: cover;
  background-position: center;
  background-color: #d8d6d0;
  border: 3px solid #000;
  border-style: solid;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.12s ease-out;
}

.tbf-marker:hover {
  transform: scale(1.08);
}

.tbf-cluster {
  position: relative;
}

.tbf-cluster-zahl {
  position: absolute;
  right: -8px;
  top: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border-radius: 11px;
  background: #fff;
  border: 2px solid currentColor;
  color: #000;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-sizing: border-box;
}

/* ---------- Bild-Overlay ---------- */

.tbf-overlay-wrapper {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.85);
  z-index: 1000;
}

.tbf-overlay-inner-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
  max-height: 92%;
  min-height: 0;
  padding: 12px;
  background: #fff;
  border: 2px solid #767676;
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* Das Bild bekommt den Platz, der nach Rahmen und Bildunterschrift
   uebrig bleibt - min-height:0 ist noetig, damit es im Flex-Container
   ueberhaupt schrumpfen darf. */
.tbf-overlay-inner-wrapper img {
  flex: 0 1 auto;
  min-height: 0;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.tbfpictitle-wrapper {
  flex: 0 0 auto;
  margin-top: 10px;
  padding: 0 24px;
  font-size: 0.85em;
  text-align: center;
}

.tbf-overlay-inner-wrapper .closeme {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.tbf-overlay-inner-wrapper .closeme::before,
.tbf-overlay-inner-wrapper .closeme::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  width: 14px;
  height: 2px;
  background: #fff;
}

.tbf-overlay-inner-wrapper .closeme::before { transform: rotate(45deg); }
.tbf-overlay-inner-wrapper .closeme::after  { transform: rotate(-45deg); }

/* ---------- Legende / Filter ---------- */

.tbf-legende {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 500;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #c9c7c1;
  font-size: 0.75em;
  line-height: 1.7;
  max-width: 60%;
}

.tbf-legende-titel {
  font-weight: 700;
  margin-bottom: 4px;
}

.tbf-legende-zeile {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.tbf-legende-farbe {
  display: inline-block;
  width: 14px;
  height: 10px;
  border: 2px solid currentColor;
  flex: 0 0 auto;
}

.tbf-legende-zahl {
  color: #767676;
}

/* ---------- Platzhalter vor dem Laden ---------- */

.tbf-platzhalter {
  position: absolute;
  inset: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ecebe7;
  border: 1px solid #c9c7c1;
}

.tbf-platzhalter-inner {
  max-width: 32em;
  padding: 24px;
  text-align: center;
}

.tbf-platzhalter-inner h3 {
  margin: 0 0 0.6em;
}

.tbf-platzhalter-inner p {
  margin: 0 0 1em;
  font-size: 0.85em;
  line-height: 1.6;
}

.tbf-platzhalter-hinweis {
  color: #6d6d6d;
  font-size: 0.75em !important;
}

.tbf-platzhalter-button {
  padding: 10px 22px;
  border: 0;
  background: #000;
  color: #fff;
  font-size: 0.9em;
  cursor: pointer;
}

.tbf-platzhalter-button:hover {
  background: #333;
}

/* ---------- Kleinkram ---------- */

.tbf-scrollhinweis {
  position: absolute;
  left: 12px;
  bottom: 28px;
  z-index: 500;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #c9c7c1;
  font-size: 0.7em;
  color: #6d6d6d;
  transition: opacity 0.4s;
}

.tbf-fehler {
  padding: 2em;
  text-align: center;
  color: #a3251a;
}

.leaflet-container {
  font: inherit;
}

@media (max-width: 640px) {
  .tbr-karte-wrapper { height: 480px; }
  .tbf-legende { font-size: 0.68em; right: 6px; top: 6px; padding: 7px 8px; }
  .tbf-scrollhinweis { display: none; }
}

/* Ohne CARTO-Schluessel laufen OpenStreetMap-Kacheln durch einen
   Graufilter, damit die Bildmarken im Vordergrund bleiben. */
.tbf-entfaerbt .leaflet-tile-pane {
  filter: grayscale(1) contrast(0.85) brightness(1.08);
}
