/* Gasyco – Seitenfortschritt (Aufgabe 1.19, anforderungen/global.md § seitenfortschritt)
   Teile, die seitenfortschritt.js erzeugt (mobile Pille, Abschnittsblatt, Abdeckung) und Zustände.
   Rail und Nach-oben-Button sind Bricks-Elemente der Komponente → globale Klassen seitenfortschritt* (tools/komponenten-1.19.py).
   Lädt nach Bricks und ACSS über das Modul-Register (inc/seitenfortschritt.php). */

/* Pille unten links: Kurzname (rot) + aktiver Abschnitt + Chevron; rechts bleibt Platz für den Nach-oben-Button (52 px + 12 px) */
/* Selektoren mit „body button.…“: ACSS stylt button:not(nav button, [class*="btn--"]) mit Spezifität (0,1,1) – Großschrift, Laufweite, Zentrierung */
body button.seitenfortschritt-pille {
  position: fixed;
  left: clamp(14px, 2vw, 28px);
  right: calc(clamp(14px, 2vw, 28px) + 64px);
  bottom: clamp(14px, 2vw, 28px);
  z-index: 42;
  box-sizing: border-box;
  height: 52px;
  max-width: 420px;
  margin: 0;
  padding: 0 18px;
  border: 1px solid var(--neutral-light);
  border-radius: 999px;
  background: color-mix(in srgb, var(--white) 94%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--schatten-schwebend);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  color: var(--base);
  text-align: left;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.seitenfortschritt-pille.ist-sichtbar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
html.seitenfortschritt-ende .seitenfortschritt-pille {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}
.seitenfortschritt-pille__art {
  flex: none;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: calc(var(--text-xs) - 2px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--primary);
}
.seitenfortschritt-pille__aktiv {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-s);
  font-weight: 600;
  line-height: 1;
  color: var(--base);
}
.seitenfortschritt-pille svg {
  flex: none;
  width: 12px;
  height: 12px;
  color: var(--base);
}

/* Abdeckung + Blatt (Liste aller Abschnitte) */
.seitenfortschritt-abdeckung {
  position: fixed;
  inset: 0;
  z-index: 41;
  display: none;
  background: color-mix(in srgb, var(--base) 28%, transparent);
}
.seitenfortschritt-abdeckung.ist-offen {
  display: block;
}
.seitenfortschritt-blatt {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 84px;
  z-index: 42;
  display: none;
  flex-direction: column;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px 8px;
  border-radius: 16px;
  background: var(--white);
  box-shadow: var(--schatten-blatt);
}
.seitenfortschritt-blatt.ist-offen {
  display: flex;
}
.seitenfortschritt-blatt__kopf {
  padding: 10px 14px 12px;
  font-size: calc(var(--text-xs) - 2px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--grau-hell);
}
.seitenfortschritt-blatt__liste {
  display: flex;
  flex-direction: column;
}
body button.seitenfortschritt-blatt__eintrag {
  display: block;
  width: 100%;
  margin: 0;
  padding: 13px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-m);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  color: var(--neutral-dark);
}
body button.seitenfortschritt-blatt__eintrag:hover,
body button.seitenfortschritt-blatt__eintrag:focus-visible {
  color: var(--base);
}
body button.seitenfortschritt-blatt__eintrag.ist-aktiv {
  background: var(--flaeche-2);
  font-weight: 600;
  color: var(--base);
}

/* Ab der Rail-Breite gibt es keine Pille (Sicherheitsnetz zum Skript) */
@media (min-width: 1100px) {
  .seitenfortschritt-pille,
  .seitenfortschritt-blatt,
  .seitenfortschritt-abdeckung {
    display: none !important;
  }
}

/* Nach-oben-Button (BricksExtras, Optik: Klasse seitenfortschritt__nach-oben) am Seitenende mobil ausblenden –
   das BricksExtras-Skript setzt opacity/transform inline, daher !important */
html.seitenfortschritt-ende .x-back-to-top.seitenfortschritt__nach-oben {
  opacity: 0 !important;
  transform: translateY(10px) !important;
  pointer-events: none !important;
}

/* Vor dem ersten Scroll-Ereignis fehlt aria-hidden (BricksExtras setzt es erst dann): unsichtbarer Button darf nichts fangen */
.x-back-to-top.seitenfortschritt__nach-oben:not([aria-hidden="false"]) {
  pointer-events: none;
}

/* Sprungziel nach Klick auf einen Eintrag: fokussierbar, aber ohne Rahmen um den ganzen Abschnitt */
.seitenfortschritt-ziel:focus,
.seitenfortschritt-ziel:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .seitenfortschritt-pille {
    transition: none;
  }
}
