/* Camplix · Modus-Umschalter (Alle · Camper · Zelt · Unterkunft), aus PR #104
   Variante A. Lädt auf /spots/ und der Startseite (extraHead), build.mjs
   versioniert die Datei wie die übrigen. Farben stehen nicht hier, sondern
   als CSS-Variablen aus modi.js (modusStil): --mx-flaeche (Fläche unter
   weißer Schrift), --mx-text (Schrift), --mx-hell (Linien), --mx-tint
   (Tönung); [data-modus-farbe] trägt die Farben eines Modus. */

/* Start abseits des Gebauten (gemerkter Modus, ?modus=, ?anreise=): Das
   Vorab-Skript im Kopf von /spots/ setzt data-mx-start, das Seiten-Skript
   nimmt es nach dem ersten Rendern weg. Verborgen per visibility, der Platz
   bleibt: kein Sprung von „Alle“ in den Modus, kein Layoutsprung.
   Sicherheitsnetz: nach 1,5 s sichtbar, auch wenn das Seiten-Skript ausfällt. */
html[data-mx-start] .cx-mx-seg,
html[data-mx-start] #dir-aktiv-zeile,
html[data-mx-start] #dir-grid { visibility: hidden; animation: cx-mx-zeigen 0s linear 1.5s forwards; }
@keyframes cx-mx-zeigen { to { visibility: visible; } }

/* ── Umschalter (Segmented Control) ──────────────────────────────── */
/* Läuft beim Scrollen über der Liste mit: CSS sticky, kein Skript und kein
   IntersectionObserver nötig, also auch ohne beides sichtbar und bedienbar.
   Unter der Navigation (h-16 / sm:h-18), unter dem Filter-Sheet (z 55/60). */
.cx-mx-band {
  position: sticky;
  top: 64px;
  z-index: 30;
  margin: 0 -4px;
  padding: 6px 4px;
  background: rgba(248, 247, 244, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
@media (min-width: 640px) { .cx-mx-band { top: 72px; } }
.cx-mx-frage { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #6B5E53; margin: 0 0 6px 2px; }
.cx-mx-seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  max-width: 48rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
}
.cx-mx-seg-knopf {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #2C2C2C;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, color 150ms, box-shadow 150ms;
}
.cx-mx-seg-knopf > iconify-icon { color: var(--mx-text); flex: none; }
.cx-mx-seg-knopf:hover { background: var(--mx-tint); }
.cx-mx-seg-knopf[data-an] { background: var(--mx-flaeche); color: #fff; box-shadow: 0 6px 16px -8px var(--mx-flaeche); }
.cx-mx-seg-knopf[data-an] > iconify-icon { color: #fff; }
.cx-mx-seg-knopf:focus-visible { outline: 2px solid var(--mx-flaeche); outline-offset: 2px; }
.cx-mx-seg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cx-mx-seg-zahl {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(44, 44, 44, 0.06);
  color: #6B5E53;
  font-variant-numeric: tabular-nums;
}
.cx-mx-seg-knopf[data-an] .cx-mx-seg-zahl { background: rgba(255, 255, 255, 0.24); color: #fff; }

/* Schmale Schirme: Icon über dem Namen, Zahl als kleines Kennzeichen oben rechts. */
@media (max-width: 639.98px) {
  .cx-mx-seg-knopf { flex-direction: column; gap: 3px; padding: 7px 2px 6px; font-size: 12px; min-height: 52px; }
  .cx-mx-seg-name { max-width: 100%; text-align: center; }
  .cx-mx-seg-zahl { position: absolute; top: 3px; right: 3px; padding: 2px 5px; font-size: 10px; }
}

/* ── Hinweis über der Liste: „Modus: Zelt · 10 von 22 · Alle zeigen“ ── */
.cx-mx-hinweis {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  padding: 3px 4px 3px 12px;
  border-radius: 999px;
  background: var(--mx-tint);
  border: 1px solid var(--mx-hell);
  font-size: 14px;
  font-weight: 600;
  color: var(--mx-text);
}
.cx-mx-hinweis[hidden] { display: none; }
.cx-mx-hinweis-alle {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #1B7474;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cx-mx-hinweis-alle:hover { background: rgba(43, 168, 168, 0.10); }
.cx-mx-hinweis-alle:focus-visible { outline: 2px solid #1F8080; outline-offset: 2px; }

/* ── Startseite: Modus-Knöpfe im Suchformular (dunkles Hero-Foto) ── */
.cx-mx-start-knopf[data-an] { background: rgba(255, 255, 255, 0.28); box-shadow: inset 0 0 0 2px #fff; }
