/* Zeltplatz-Finder. Regeln aus dem Style Book: keine Schatten, Linien 1 px,
   Überschriften in Stammesblau, Rot nur als Akzent, Fotos eckig. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--schrift); font-size: 16px; line-height: 24px;
  background: var(--seite); color: var(--fliesstext);
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { color: var(--text); margin: 0; font-weight: 700; }
h1 { font-size: 36px; line-height: 42px; }
h2 { font-size: 26px; line-height: 32px; }
h3 { font-size: 20px; line-height: 26px; font-weight: 600; }
p { margin: 0; }
a { color: var(--akzent); text-underline-offset: 2px; }
.beschriftung {
  font-size: 12px; line-height: 16px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--nebentext); margin: 0;
}
.hinweis { font-size: 14px; line-height: 20px; color: var(--nebentext); margin-top: var(--a1); }
.klein { font-size: 14px; line-height: 20px; }
[hidden] { display: none !important; }
.dunkel-nur { display: none; }
@media (prefers-color-scheme: dark) { .dunkel-nur { display: block; } .hell-nur { display: none; } }

/* ----- Formularelemente ----- */
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input[type="number"], input[type="date"], input[type="search"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%; min-height: 44px; padding: var(--a2) var(--a3);
  background: var(--feld); color: var(--text);
  border: 1px solid var(--linie); border-radius: var(--r-feld);
}
textarea { min-height: 96px; resize: vertical; line-height: 22px; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--a2);
  min-height: 44px; padding: var(--a3) var(--a4); border-radius: var(--r-button);
  border: 1px solid var(--primaer); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primaer { background: var(--primaer); color: var(--primaer-text); }
.btn-sekundaer { background: transparent; color: var(--text); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.badge {
  display: inline-block; padding: 2px var(--a3); border-radius: var(--r-badge);
  background: var(--flaeche); color: var(--text); font-size: 14px; line-height: 20px; white-space: nowrap;
}
.badge-warm { background: var(--sand); color: var(--blau-dunkel); }
.badge-ok { background: var(--petrol-hell); color: var(--blau-dunkel); }

/* ----- Kopf: flächig Blau, weißes Logo, Suche ----- */
.kopf { background: var(--stammesblau); color: var(--weiss); padding: var(--a6) var(--a8) var(--a8); }
.kopf-zeile { display: flex; align-items: center; gap: var(--a6); }
.logo { display: block; flex: none; padding: var(--a2); } /* Schutzraum */
.logo img { display: block; width: 96px; height: auto; }
.kopf-titel { flex: 1; min-width: 0; }
.kopf h1 { color: var(--weiss); }
.kopf .beschriftung { color: var(--blau-20); }
.konto { display: flex; align-items: center; gap: var(--a3); font-size: 14px; }
.konto .btn { border-color: var(--weiss); color: var(--weiss); background: transparent; min-height: 40px; padding: var(--a2) var(--a4); }
.suche {
  display: grid; grid-template-columns: 120px 170px 170px 190px 1fr; gap: var(--a4);
  margin-top: var(--a6); padding-top: var(--a6); border-top: 1px solid var(--blau-80);
}
.suche .feld { display: flex; flex-direction: column; gap: var(--a1); }
.suche input, .suche select { background: var(--weiss); color: var(--stammesblau); border-color: var(--weiss); color-scheme: light; }

/* ----- Leiste über der Liste ----- */
.leiste {
  display: flex; align-items: center; gap: var(--a4); padding: var(--a3) var(--a8);
  border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 500; background: var(--seite);
}
.treffer { flex: 1; font-weight: 600; color: var(--text); }
.sortierung { display: flex; align-items: center; gap: var(--a2); }
.sortierung select { width: auto; min-height: 40px; }
.nur-mobil { display: none; }
.umschalter { border: 1px solid var(--primaer); border-radius: var(--r-button); overflow: hidden; }
.umschalter button { border: 0; background: transparent; color: var(--text); min-height: 40px; padding: 0 var(--a4); font-weight: 600; cursor: pointer; }
.umschalter button[aria-selected="true"] { background: var(--primaer); color: var(--primaer-text); }

/* ----- Bühne: Filter | Liste | Karte ----- */
.buehne { display: grid; grid-template-columns: 280px minmax(360px, 1fr) minmax(320px, 1.1fr); align-items: start; }
.filter { padding: var(--a6) var(--a6) var(--a6) var(--a8); display: flex; flex-direction: column; gap: var(--a6); position: sticky; top: 65px; max-height: calc(100vh - 65px); overflow: auto; }
.filter fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--a2); }
.filter legend { padding: 0; margin-bottom: var(--a2); }
.chips { display: flex; flex-wrap: wrap; gap: var(--a2); }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: block; padding: var(--a1) var(--a3); border: 1px solid var(--linie); border-radius: var(--r-badge); color: var(--text); font-size: 14px; line-height: 20px; }
.chips input:checked + span { background: var(--primaer); border-color: var(--primaer); color: var(--primaer-text); }
.chips input:focus-visible + span { outline: 2px solid var(--akzent); outline-offset: 2px; }
.haken { display: flex; align-items: center; gap: var(--a2); min-height: 32px; cursor: pointer; color: var(--text); }
.haken input { width: 18px; height: 18px; accent-color: var(--stammesblau); flex: none; }
.mit-einheit { display: flex; align-items: center; gap: var(--a2); }
.mit-einheit input { width: 110px; }
.mit-einheit span { color: var(--nebentext); font-size: 14px; }

.liste { padding: var(--a6) var(--a4); display: flex; flex-direction: column; gap: var(--a4); min-width: 0; }
.leer { padding: var(--a12) var(--a6); text-align: center; border: 1px solid var(--linie); border-radius: var(--r-kachel); background: var(--karte); }
.leer h3 { margin-bottom: var(--a2); }

.platz {
  display: grid; grid-template-columns: 132px 1fr; gap: var(--a4); padding: var(--a4);
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--r-kachel);
  cursor: pointer; text-align: left; width: 100%;
}
.platz:hover, .platz.aktiv { border-color: var(--primaer); }
.platz-bild { width: 132px; height: 99px; background: var(--flaeche); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.platz-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.platz-bild svg { width: 44px; height: 44px; color: var(--blau-40); }
.platz-text { min-width: 0; display: flex; flex-direction: column; gap: var(--a2); }
.platz-ort { color: var(--nebentext); font-size: 14px; line-height: 20px; }
.platz h3 { overflow-wrap: anywhere; }
.badges { display: flex; flex-wrap: wrap; gap: var(--a2); }

.karte-spalte { position: sticky; top: 65px; height: calc(100vh - 65px); border-left: 1px solid var(--linie); }
#karte { width: 100%; height: 100%; background: var(--flaeche); z-index: 0; }
.pin { width: 18px; height: 18px; border-radius: 50%; background: var(--stammesblau); border: 3px solid var(--weiss); outline: 1px solid var(--stammesblau); }
.pin.ungenau { background: var(--weiss); border-color: var(--stammesblau); outline: 0; }
.pin.aktiv { background: var(--ocker); outline-color: var(--ocker-dunkel); transform: scale(1.35); }
.pin-start { width: 22px; height: 22px; background: var(--dpsg-rot); border: 3px solid var(--weiss); outline: 1px solid var(--dpsg-rot); transform: rotate(45deg); }
.leaflet-container { font-family: var(--schrift); font-size: 14px; }
.leaflet-popup-content-wrapper { border-radius: var(--r-button); box-shadow: none; border: 1px solid var(--blau-20); color: var(--grau-700); }
.leaflet-popup-tip { box-shadow: none; border: 1px solid var(--blau-20); }
.leaflet-popup-content { margin: var(--a3) var(--a4); }
.leaflet-popup-content strong { color: var(--stammesblau); display: block; font-size: 16px; }
.leaflet-popup-content button { margin-top: var(--a2); background: none; border: 0; padding: 0; color: var(--dpsg-rot); text-decoration: underline; cursor: pointer; font: inherit; }

.fuss { display: flex; align-items: center; gap: var(--a6); padding: var(--a8); border-top: 1px solid var(--linie); color: var(--nebentext); font-size: 14px; line-height: 20px; }
.schriftzug { height: 28px; width: auto; flex: none; }

/* ----- Dialoge ----- */
.dlg { border: 1px solid var(--linie); border-radius: var(--r-kachel); padding: 0; background: var(--seite); color: var(--fliesstext); width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
.dlg-gross { width: min(960px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 34, 60, 0.6); }
.dlg-kopf { display: flex; align-items: flex-start; gap: var(--a4); padding: var(--a6); border-bottom: 1px solid var(--linie); position: sticky; top: 0; background: var(--seite); z-index: 2; }
.dlg-kopf > div { flex: 1; min-width: 0; }
.dlg-inhalt { padding: var(--a6); display: flex; flex-direction: column; gap: var(--a6); }
.dlg-fuss { display: flex; flex-wrap: wrap; gap: var(--a3); justify-content: flex-end; padding: var(--a4) var(--a6); border-top: 1px solid var(--linie); position: sticky; bottom: 0; background: var(--seite); }
.schliessen { background: none; border: 1px solid var(--linie); border-radius: var(--r-button); width: 44px; height: 44px; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text); flex: none; }

.galerie { position: relative; background: var(--blau-dunkel); }
.galerie img { display: block; width: 100%; height: min(52vh, 440px); object-fit: contain; }
.galerie-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: rgba(0, 34, 60, 0.7); color: var(--weiss); font-size: 24px; cursor: pointer; }
.galerie-nav.vor { right: 0; } .galerie-nav.zurueck { left: 0; }
.galerie-fuss { display: flex; justify-content: space-between; gap: var(--a4); padding: var(--a2) var(--a3); background: var(--blau-dunkel); color: var(--blau-20); font-size: 14px; line-height: 20px; }
.galerie-fuss a { color: var(--gold); }
.galerie-leer { padding: var(--a6); background: var(--flaeche); color: var(--text); }

.fakten { display: grid; grid-template-columns: 180px 1fr; border-top: 1px solid var(--linie); margin: 0; }
.fakten dt, .fakten dd { padding: var(--a3) 0; border-bottom: 1px solid var(--linie); margin: 0; }
.fakten dt { padding-right: var(--a4); padding-top: 14px; }
.fakten dd { color: var(--fliesstext); overflow-wrap: anywhere; }
.kasten { padding: var(--a4); border-radius: var(--r-button); background: var(--flaeche); border: 1px solid var(--linie); color: var(--text); }
.kasten-intern { background: var(--intern-flaeche); border-color: transparent; color: var(--intern-text); }
.kasten-intern .beschriftung { color: inherit; margin-bottom: var(--a1); }
.kasten-warnung { background: var(--rot-20); border-color: transparent; color: var(--rot-dunkel); }
.linkliste { display: flex; flex-direction: column; gap: var(--a1); overflow-wrap: anywhere; }

.formular { display: grid; grid-template-columns: 1fr 1fr; gap: var(--a4); }
.formular label { display: flex; flex-direction: column; gap: var(--a1); }
.formular .breit { grid-column: 1 / -1; }
.formular .haken { flex-direction: row; }
#mailtext { min-height: 320px; font-size: 15px; }

/* ----- Schmal: eine Spalte, Liste und Karte per Umschalter ----- */
@media (max-width: 1100px) {
  .buehne { grid-template-columns: 260px 1fr; }
  .karte-spalte { display: none; }
  .nur-mobil.umschalter { display: flex; }
  .buehne[data-ansicht="karte"] .liste { display: none; }
  .buehne[data-ansicht="karte"] .karte-spalte { display: block; border-left: 0; }
}
@media (max-width: 760px) {
  h1 { font-size: 26px; line-height: 32px; }
  .kopf { padding: var(--a4); }
  .kopf-zeile { gap: var(--a3); }
  .konto span { display: none; }
  .suche { grid-template-columns: 1fr 1fr; gap: var(--a3); margin-top: var(--a4); padding-top: var(--a4); }
  .suche .feld-breit { grid-column: 1 / -1; }
  .leiste { padding: var(--a2) var(--a4); gap: var(--a2); flex-wrap: wrap; }
  .treffer { flex-basis: 100%; }
  .sortierung .beschriftung { display: none; }
  .nur-mobil { display: inline-flex; }
  .buehne { grid-template-columns: 1fr; }
  .filter { display: none; position: fixed; inset: 0; z-index: 1000; max-height: none; background: var(--seite); padding: var(--a4); top: 0; }
  .filter.offen { display: flex; }
  .filter-kopf { display: flex; justify-content: space-between; align-items: center; }
  .liste { padding: var(--a4); }
  .platz { grid-template-columns: 96px 1fr; gap: var(--a3); padding: var(--a3); }
  .platz-bild { width: 96px; height: 72px; }
  .karte-spalte { top: 105px; height: calc(100dvh - 105px); }
  .fakten { grid-template-columns: 1fr; }
  .fakten dt { border-bottom: 0; padding-bottom: 0; }
  .fakten dd { padding-top: var(--a1); }
  .formular { grid-template-columns: 1fr; }
  .dlg-kopf, .dlg-inhalt { padding: var(--a4); }
  .fuss { flex-direction: column; align-items: flex-start; padding: var(--a4); }
}
