/* BFP Platz-Verzeichnisse (Camping, Golf) – Karte + Liste, Shortcode [bfp-plaetze].
   Baut auf bfp-map-home.css auf (Marker, Cluster, Popup-Rahmen) und laesst die
   Startseiten-Karte bewusst unberuehrt. */

/* Abstand nach oben zur Ueberschrift. Der Abstand nach unten kommt ueber die
   Bootstrap-Klasse mb-4 am Wrapper (siehe inc/places.php) – nicht hier, sonst
   gibt es zwei Quellen fuer denselben Wert und die Utility gewinnt per
   !important ohnehin. */
.bfp-places {
  margin-top: 2rem;
}

@media (min-width: 992px) {
  .bfp-places {
    margin-top: 2.5rem;
  }
}

.bfp-places-map {
  width: 100%;
  min-height: 360px;
  border-radius: 4px;
  overflow: hidden;
}

/* Basiskarte in Graustufen – wie auf der Startseite, aber eigene Regel,
   damit bfp-map-home.css nicht angefasst werden muss. */
.bfp-places-map .mapboxgl-canvas {
  filter: grayscale(1);
}

/* ---------- Popup ----------
   Optisch an die Wetterkarte angeglichen (.bfp-weather-popup): gepolsterter
   Kasten, Titel 0.75rem fett, Infozeilen 0.6875rem, keine Trennlinien.

   Alle Regeln haengen an div.bfp-map-popup. Die Startseiten-Karte baut ihr
   Popup als <a class="bfp-map-popup"> – die bleibt damit unberuehrt und
   behaelt ihr Layout aus bfp-map-home.css. */
div.bfp-map-popup {
  display: block;
  width: auto;
  min-width: 150px;
  padding: 9px 11px;
  color: #1b2e18;
}

div.bfp-map-popup .bfp-map-popup__main {
  display: block;
  text-decoration: none;
  color: inherit;
}
div.bfp-map-popup .bfp-map-popup__main:hover .bfp-map-popup__title {
  text-decoration: underline;
}

/* Bild nur, wenn ein Beitrag verlinkt ist – innerhalb der Polsterung. */
div.bfp-map-popup .bfp-map-popup__thumb {
  width: 100%;
  height: 84px;
  margin-bottom: 6px;
  border-radius: 3px;
  object-fit: cover;
}

div.bfp-map-popup .bfp-map-popup__title {
  display: block;
  padding: 0;
  margin-bottom: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1b2e18;
}

div.bfp-map-popup .bfp-map-popup__meta {
  display: block;
  padding: 0;
  margin: 0 0 6px;
  font-size: 0.6875rem;
  line-height: 1.5;
  color: #6c757d;
}

/* Aktionen als schlichte Links in Zeilengroesse statt randbreiter Kaesten. */
div.bfp-map-popup .bfp-map-popup__link {
  display: inline-block;
  padding: 0;
  border: 0;
  margin-right: 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: underline;
  color: #1b2e18;
}
div.bfp-map-popup .bfp-map-popup__link:last-child {
  margin-right: 0;
}
div.bfp-map-popup .bfp-map-popup__link:hover {
  background: none;
  text-decoration: none;
}

/* ---------- Split-Layout: Liste links, Karte rechts ----------
   Store-Locator-Muster: das Suchfeld steht fest oben, die Liste scrollt in
   ihrem eigenen Bereich, die Karte daneben ist genauso hoch. Mobil
   untereinander mit der Karte oben (order-first im Markup).
   Der Kartenausschnitt begrenzt die Liste – das erledigt bfp-map-home.js. */

.bfp-places--split {
  /* Eine Quelle fuer beide Spaltenhoehen */
  --bfp-places-h: 420px;
}

.bfp-places--split .bfp-places-map {
  height: var(--bfp-places-h) !important;
}

@media (min-width: 992px) {
  .bfp-places--split {
    --bfp-places-h: min(calc(100vh - 8rem), 780px);
  }
  .bfp-places--split .bfp-places__col--list {
    display: flex;
    flex-direction: column;
    height: var(--bfp-places-h);
  }
  .bfp-places--split .bfp-places__scroll {
    flex: 1 1 auto;
    min-height: 0; /* sonst waechst der Flex-Kindcontainer statt zu scrollen */
  }
}

/* Scrollbereich der Liste */
.bfp-places__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 0 1rem;
  scrollbar-width: thin;
}
.bfp-places__scroll:focus-visible {
  outline: 2px solid #1b2e18;
  outline-offset: 2px;
}
.bfp-places__scroll::-webkit-scrollbar {
  width: 8px;
}
.bfp-places__scroll::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 4px;
}
.bfp-places__scroll::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}

/* Mobil ohne Flex-Hoehe, aber begrenzt – sonst schiebt die Liste alles weg */
@media (max-width: 991.98px) {
  .bfp-places--split .bfp-places__scroll {
    max-height: 520px;
  }
}

/* ---------- Zeilen-Liste im Split-Layout ---------- */

.bfp-places__item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid #eef0f2;
}
.bfp-places__item:last-child {
  border-bottom: 0;
}

.bfp-places__pin {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  line-height: 0;
  color: #1b2e18;
}
.bfp-places__body {
  min-width: 0; /* damit lange Namen umbrechen statt die Spalte zu sprengen */
}

.bfp-places__name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  line-height: 1.3;
}
.bfp-places__meta,
.bfp-places__adresse,
.bfp-places__desc {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.bfp-places__meta {
  color: #6c757d;
}
.bfp-places__adresse {
  color: #495057;
}
.bfp-places__desc {
  color: #212529;
}

/* Route, Website und Telefonnummer stehen in einer Zeile auf einer Grundlinie.
   nowrap, damit die Nummer nicht mitten im Zeichen umbricht und dadurch
   optisch unter die anderen beiden rutscht. */
.bfp-places__links {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.85rem;
  row-gap: 0.25rem;
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.4;
}
.bfp-places__links a,
.bfp-places__links button {
  white-space: nowrap;
  color: #1b2e18;
  text-decoration: underline;
}
.bfp-places__links a:hover {
  text-decoration: none;
}

/* Regionen-Ueberschrift bleibt beim Scrollen oben stehen */
.bfp-places__scroll .bfp-places__region {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 0.75rem 0 0.5rem;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #dee2e6;
}
.bfp-places__scroll .bfp-places__count {
  text-transform: none;
  letter-spacing: 0;
}

/* ---------- Suche ---------- */

.bfp-places__search {
  display: none;
  margin-bottom: 1.25rem;
}
.bfp-places.is-interactive .bfp-places__search {
  display: block;
}
.bfp-places__searchinput {
  border-color: #ced4da;
}
.bfp-places__searchinput:focus {
  border-color: #1b2e18;
  box-shadow: 0 0 0 0.2rem rgba(27, 46, 24, 0.15);
}
.bfp-places__searchcount {
  margin-top: 0.4rem;
  min-height: 1.2em;
}

/* Von der Suche ausgefilterte Eintraege und leere Regionen */
.bfp-places__list > li[hidden],
.bfp-places__group[hidden] {
  display: none !important;
}

/* ---------- Liste ---------- */

.bfp-places__region {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.bfp-places__region:first-child {
  margin-top: 1.5rem;
}
.bfp-places__count {
  font-size: 0.75rem;
  font-weight: 400;
  color: #6c757d;
  white-space: nowrap;
}

.bfp-places__list {
  margin-bottom: 0;
}
.bfp-places-map-wrap + .bfp-places__list,
.bfp-places-map-wrap + .bfp-places__region {
  margin-top: 2rem;
}

.bfp-places-card {
  border-color: #e9ecef;
}
.bfp-places-card__meta {
  margin-bottom: 0.5rem;
}
.bfp-places-card__ausstattung {
  line-height: 1.5;
}

/* Zielmarkierung nach einem Deep-Link (#platz-xyz) */
.bfp-places__list > li:target .bfp-places-card {
  border-color: #1b2e18;
  box-shadow: 0 0 0 2px rgba(27, 46, 24, 0.15);
}

/* Ein Klick auf den Eintrag zeigt den Platz auf der Karte. Der Name ist dafuer
   ein Button – so geht es auch per Tastatur. Ohne JS bleibt es ein normaler
   Text, deshalb haengt der Zeiger an .is-interactive. */
.bfp-places__namebtn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: default;
}
.bfp-places.is-interactive .bfp-places__namebtn {
  cursor: pointer;
}
.bfp-places.is-interactive .bfp-places__namebtn:hover {
  text-decoration: underline;
}
.bfp-places__namebtn:focus-visible {
  outline: 2px solid #1b2e18;
  outline-offset: 2px;
}

.bfp-places.is-interactive .bfp-places__item {
  cursor: pointer;
}
.bfp-places.is-interactive .bfp-places__item:hover {
  background: #f8f9fa;
}

/* Quellen- und Standzeile: Fussnote, deutlich kleiner als der Fliesstext.
   Ueberschreibt .small (0.875em, ohne !important). Farbe kommt von .text-muted
   und Abstaende von mt-4/mb-3 am Element (siehe inc/places.php) – beide setzen
   !important, eigene Angaben waeren hier wirkungslos. */
.bfp-places__source {
  font-size: 0.625rem;
  line-height: 1.6;
}
.bfp-places__source a {
  color: inherit;
}

/* ---------- Extern-Link-Icon des Themes zurueckdrehen ----------
   src/scss/_theme.scss haengt an jedes .site-content a[target=_blank] ein
   Extern-Icon und setzt dafuer padding:10px 0 + padding-left:1.5rem. Fuer
   Links im Fliesstext ist das gewollt, fuer Buttons und fuer den Link im
   Karten-Popup nicht: dort frisst es das horizontale Padding.
   Die Quellenzeile (.bfp-places__source) behaelt das Icon absichtlich. */
.bfp-places .btn[target="_blank"] {
  padding: var(--bs-btn-padding-y, 0.25rem) var(--bs-btn-padding-x, 0.5rem);
}
.bfp-places .btn[target="_blank"]::before {
  content: none !important;
  display: none !important;
}

/* Spezifitaet muss .site-content a[target=_blank] (0,2,1) uebertreffen – das
   Theme haengt dort sonst Icon und Einzug an. Die Polsterung sitzt jetzt am
   Popup selbst, die Links brauchen keine eigene. */
.bfp-map-popup a.bfp-map-popup__link[target="_blank"] {
  padding: 0;
}
.bfp-map-popup__link[target="_blank"]::before {
  content: none !important;
  display: none !important;
}
