/* ==========================================================================
   caelyss.de – Barrierefreiheit (ab v2.5): Bedienfeld unten rechts und die Darstellungen, die es einschaltet.
   Vorlage: Müllers Elektrotechnik (v1.3), angepasst an Caelyss:
   - Knopf und Kopf des Bedienfelds im Markenrot #8d0916 (Logo, Vorschaubild; Weiß darauf 9,6 : 1),
     Bedienfeld dunkel wie Konfigurator und Dialoge der Seite, Schrift wie der Fließtext (Inter Display),
     Titel in Satoshi; nur Schnitte, die die Seite ohnehin lädt (kein künstliches Fett).
   - Knopf 40 px wie die anderen runden Knöpfe der Seite (Karussell-Pfeile, Schließen), unten rechts 20 px.
   - Ebene 11: über der Unschärfe-Leiste (10), unter der Preisleiste (12) und dem Maus-Punkt (13);
     Dialoge (<dialog>) liegen ohnehin in der obersten Ebene darüber.
   Skripte: js/barrierefreiheit-start.js (im Kopf vor frueh.js, setzt die gespeicherte Auswahl vor dem
   Zeichnen), js/barrierefreiheit.js (Bedienfeld). Jede Darstellung = Klasse bf-… auf <html>, keine
   Inline-Stile (CSP). Das Bedienfeld selbst (.bf) ist von den Text- und Kontrast-Regeln ausgenommen.
   bauen.py hängt dieses Stylesheet als letztes in den <head> jeder Seite (nach grillz.css/galerie.css).
   ========================================================================== */

/* OpenDyslexic 3 (© Abbie Gonzalez, SIL Open Font License 1.1), vom eigenen Server.
   Der Browser lädt die Datei erst, wenn „Legasthenie-Schrift“ eingeschaltet ist. */
@font-face {
  font-family: "OpenDyslexic";
  src: url("/schriften/opendyslexic3-regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Bedienfeld -------------------------------------------------------------------------------- */
.bf {
  --bf-rot: #8d0916;           /* Markenrot: Weiß darauf 9,6 : 1 */
  --bf-rot-dunkel: #6c0711;    /* Hover */
  --bf-flaeche: #0e0e10;       /* wie die Flächen des Konfigurators */
  --bf-text-2: rgb(255 255 255 / .62);   /* auf der Fläche 7 : 1 */
  --bf-unten: 20px;
  position: fixed;
  right: 20px;
  bottom: var(--bf-unten);
  z-index: 11;
  font-family: "Inter Display", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: normal;
  color: #fff;
  transition: bottom .5s cubic-bezier(.22, 1, .36, 1);
}
/* Startseite unter 1000 px: Die Preisleiste des Konfigurators sitzt dann fest unten über die ganze Breite
   (12 px Rand, 66 px hoch, Knopf „Request“ rechts) – eine freie untere Ecke gibt es nicht. Der Knopf rückt
   deshalb über die Leiste (12 px Abstand) und fährt zurück, sobald sie verschwindet. Ab 1000 px ist die Leiste
   ausgeblendet (grillz.css), die Klasse .an setzt oberflaeche.js aber trotzdem – daher nur unter 1000 px. */
@media (max-width: 999.98px) {
  body:has(.konf-leiste.an) .bf { --bf-unten: calc(max(12px, env(safe-area-inset-bottom)) + 78px); }
}

.bf .bf-knopf {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--bf-rot);
  color: #fff;
  box-shadow: 0 4px 16px rgb(0 0 0 / .5);
  cursor: pointer;
}
.bf .bf-knopf:hover,
.bf .bf-knopf:focus-visible { background: var(--bf-rot-dunkel); color: #fff; border-color: #fff; }
.bf .bf-knopf svg { width: 24px; height: 24px; fill: currentColor; }
/* Fokus am Knopf: weißer Ring mit schwarzem Rand – sichtbar auf der schwarzen Seite und im hellen Kontrast */
.bf .bf-knopf:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 7px #000; }
/* Punkt am Knopf, solange eine Darstellung eingeschaltet ist */
.bf .bf-knopf.bf-an::after {
  content: "";
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bf-rot);
  border-radius: 50%;
  background: #fff;
}
.bf .bf-fenster button:focus-visible,
.bf .bf-fenster a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.bf .bf-fenster {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  display: flex;
  flex-direction: column;
  width: 340px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - var(--bf-unten) - 76px);
  max-height: calc(100dvh - var(--bf-unten) - 76px);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .14);
  border-radius: 18px;
  background: var(--bf-flaeche);
  box-shadow: 0 24px 70px rgb(0 0 0 / .6);
}
.bf .bf-fenster[hidden] { display: none; }

.bf .bf-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 11px 11px 18px;
  background: var(--bf-rot);
  color: #fff;
}
.bf .bf-titel {
  margin: 0;
  padding: 0;
  font-family: "Satoshi", sans-serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -.01em;
  text-transform: none;
  color: #fff;
}
.bf .bf-zu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.bf .bf-zu:hover,
.bf .bf-zu:focus-visible { background: rgb(255 255 255 / .16); color: #fff; }
.bf .bf-zu svg { width: 20px; height: 20px; }

.bf .bf-inhalt {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 16px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgb(255 255 255 / .25) transparent;
}
.bf .bf-gruppe {
  margin: 16px 0 8px;
  padding: 0;
  font-family: "Inter", sans-serif;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bf-text-2);
}
.bf .bf-raster {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.bf .bf-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 80px;
  margin: 0;
  padding: 10px 4px 8px;
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 12px;
  background: rgb(255 255 255 / .04);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: normal;
  text-align: center;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
}
.bf .bf-option:hover,
.bf .bf-option:focus-visible { border-color: rgb(255 255 255 / .42); background: rgb(255 255 255 / .08); color: #fff; }
.bf .bf-option svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bf .bf-option[aria-pressed="true"] { border-color: rgb(255 255 255 / .5); background: var(--bf-rot); color: #fff; }
/* Häkchen zusätzlich zur Farbe (Zustand nicht nur über die Farbe erkennbar) */
.bf .bf-option[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
}
.bf .bf-option[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 10.5px;
  width: 4px;
  height: 8px;
  border: solid var(--bf-rot);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.bf .bf-fuss {
  padding: 12px 16px 14px;
  border-top: 1px solid rgb(255 255 255 / .1);
}
.bf .bf-zurueck {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / .3);
  border-radius: 12px;
  background: transparent;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.01em;
  text-transform: none;
  cursor: pointer;
}
.bf .bf-zurueck:hover,
.bf .bf-zurueck:focus-visible { background: #fff; color: var(--bf-flaeche); border-color: #fff; }
.bf .bf-zurueck svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bf .bf-hinweis {
  margin: 10px 0 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--bf-text-2);
}
.bf .bf-hinweis a,
.bf .bf-hinweis a:hover,
.bf .bf-hinweis a:focus,
.bf .bf-hinweis a:visited {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / .5);
  text-underline-offset: 2px;
}
.bf .bf-status {            /* nur für Screenreader („All settings have been reset.“) */
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media print {
  .bf { display: none !important; }
}

/* --- Farbe und Kontrast ------------------------------------------------------------------------ */
/* Dunkler und heller Kontrast: einheitlicher Grund, einheitliche Schrift. Anders als bei Müllers sind alle
   übrigen Flächen durchsichtig statt einfarbig – die Seite hat viele Ebenen über dem Inhalt (Rahmen um
   „Meet Marten“, Karussell-Pfeile, Kopfleiste der 3D-Bühne), die sonst Inhalt verdecken würden. Deckend
   bleiben nur Flächen über Bildern/3D und Dialoge (Liste unten). Rauch (WebGL), Unschärfe-Leiste und
   Maus-Punkt sind aus; Fotos, das 3D-Modell, Farb- und Materialmuster des Konfigurators bleiben, weil sie
   Inhalt sind. */
html.bf-dunkel { --bf-grund: #181818; --bf-schrift: #fff; --bf-link: #ffd75e; }
html.bf-hell { --bf-grund: #fff; --bf-schrift: #000; --bf-link: #0645ad; }

html:is(.bf-dunkel, .bf-hell),
html:is(.bf-dunkel, .bf-hell) body {
  background: var(--bf-grund) !important;
  color: var(--bf-schrift) !important;
}
html:is(.bf-dunkel, .bf-hell) body :not(.bf, .bf *, .konf-schema *, .konf-karte-bild, .konf-karte-bild *, .konf-farbe-punkt, .konf-pille-punkt) {
  background-color: transparent !important;
  background-image: none !important;
  border-color: currentColor !important;
  color: var(--bf-schrift) !important;
  -webkit-text-fill-color: currentColor !important;   /* Text mit Farbverlauf (Titel, „Sawora. Solutions“) */
  text-shadow: none !important;
  box-shadow: none !important;                         /* Schatten und Leuchten (im hellen Kontrast schwere Flecken) */
}
html:is(.bf-dunkel, .bf-hell) body :not(.bf, .bf *, .konf-schema *, .konf-karte-bild, .konf-karte-bild *)::before,
html:is(.bf-dunkel, .bf-hell) body :not(.bf, .bf *, .konf-schema *, .konf-karte-bild, .konf-karte-bild *)::after {
  background-color: transparent !important;
  background-image: none !important;
}
/* Deckend: Dialoge, Vollbild, Preisleiste und alles, was über Fotos oder dem 3D-Modell liegt */
html:is(.bf-dunkel, .bf-hell) body :is(.konf-dialog-innen, .lb-hintergrund, .konf-leiste, .konf-schild, .konf-toast,
  .konf-tipp, .konf-segment, .konf-pille, .karussell-pfeil, .lb-knopf, .konf-karte-bild) {
  background-color: var(--bf-grund) !important;
}
html.bf-hell body .konf-karte-bild { background-color: #181818 !important; }   /* helle Formen-Bilder brauchen Grund */
/* Ausgewählte Optionen (Reiter, Ansicht, Form, Metall, Farbe …): umgekehrte Farben – die Auswahl war sonst
   nur über feine Hintergründe erkennbar */
html:is(.bf-dunkel, .bf-hell) body :is([aria-checked="true"], [aria-selected="true"], [aria-pressed="true"]):not(.bf *, .konf-schema *) {
  background-color: var(--bf-schrift) !important;
  color: var(--bf-grund) !important;
}
html:is(.bf-dunkel, .bf-hell) body :is([aria-checked="true"], [aria-selected="true"], [aria-pressed="true"]):not(.bf *, .konf-schema *)
  :not(.konf-karte-bild, .konf-karte-bild *, .konf-farbe-punkt, .konf-pille-punkt) {
  color: var(--bf-grund) !important;
}
/* Anzahl-Marke an den Formen-Karten („× 4“): umgekehrte Farben wie im Original (weiß mit schwarzer Schrift) */
html:is(.bf-dunkel, .bf-hell) body .konf-karte::after {
  background-color: var(--bf-schrift) !important;
  color: var(--bf-grund) !important;
  box-shadow: 0 0 0 1px var(--bf-grund);
}
/* Links deutlich abgesetzt (die großen Knöpfe bekommen stattdessen einen Rahmen) */
html:is(.bf-dunkel, .bf-hell) body a:not(.bf *, .knopf),
html:is(.bf-dunkel, .bf-hell) body a:not(.bf *, .knopf) * { color: var(--bf-link) !important; }
html:is(.bf-dunkel, .bf-hell) body :is(.knopf-rahmen, .karussell-pfeil, .konf-leiste-knopf, .konf-senden, .lb-knopf,
  .sozial-knopf, input:not([type="checkbox"]), textarea):not(.bf *) {
  border: 1px solid currentColor !important;
}
html:is(.bf-dunkel, .bf-hell) body input[type="checkbox"] { accent-color: var(--bf-link) !important; }
/* Trenner und Fortschritt in Schriftfarbe statt Weiß (sonst im hellen Kontrast unsichtbar) */
html:is(.bf-dunkel, .bf-hell) body :is(.linie, .scroll-linie, .fuss-trenner, .badge-punkt, .konf-abdruck-balken span) {
  background-color: currentColor !important;
}
html:is(.bf-dunkel, .bf-hell) body :is(.linie, .scroll-linie, .fuss-trenner) { opacity: .45 !important; }
/* Zierde aus: Rauch (WebGL), Unschärfe-Leiste am Fensterrand, Maus-Punkt */
html:is(.bf-dunkel, .bf-hell) body :is(.rauch, .unschaerfe, .maus-punkt) { display: none !important; }
/* Symbole in Schriftfarbe; Zahnschema und Materialbilder des Konfigurators behalten ihre Farben */
html:is(.bf-dunkel, .bf-hell) body svg:not(.bf *, .konf-schema *, .konf-karte-bild *) { fill: currentColor; }
html:is(.bf-dunkel, .bf-hell) body svg:not(.bf *, .konf-schema *, .konf-karte-bild *) [stroke]:not([stroke="none"]) {
  stroke: currentColor !important;
}
/* Heller Kontrast: weiße Blüte (SVG-Bild) und das für Schwarz gebaute Zahnschema umkehren */
html.bf-hell body :is(.hero-emblem, .karte-alle-emblem) { filter: invert(1) !important; }
html.bf-hell body .konf-schema { filter: invert(1); }

/* Hoher Kontrast und Sättigung: Filter auf <html> (erzeugt dort keinen neuen Bezugsrahmen für
   position: fixed); Kontrast und Sättigung lassen sich kombinieren */
html.bf-kontrast { --bf-k: contrast(1.35); }
html.bf-saettigung-hoch { --bf-s: saturate(1.6); }
html.bf-saettigung-niedrig { --bf-s: saturate(.45); }
html.bf-graustufen { --bf-s: grayscale(1); }
html:is(.bf-kontrast, .bf-saettigung-hoch, .bf-saettigung-niedrig, .bf-graustufen) {
  filter: var(--bf-k, contrast(1)) var(--bf-s, saturate(1));
}

/* --- Text und Inhalt (ohne Grafiken; die Seite hat keine Icon-Schrift) -------------------------- */
html.bf-ueberschriften body :is(h1, h2, h3, h4, h5, h6):not(.bf *) {
  outline: 2px solid currentColor !important;
  outline-offset: 4px !important;
}
html.bf-links body a:not(.bf *) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  outline: 2px dashed currentColor !important;
  outline-offset: 2px !important;
}
html.bf-legasthenie body :not(.bf, .bf *, svg, svg *, canvas) {
  font-family: "OpenDyslexic", "Comic Sans MS", sans-serif !important;
}
/* Abstände wie WCAG 1.4.12 (Zeichen 0,12 em, Wörter 0,16 em) */
html.bf-zeichenabstand body :not(.bf, .bf *, svg, svg *, canvas) {
  letter-spacing: .12em !important;
  word-spacing: .16em !important;
}
html.bf-zeilenhoehe body :not(.bf, .bf *, svg, svg *, canvas) {
  line-height: 1.8 !important;
}
html.bf-fett body :not(.bf, .bf *, svg, svg *, canvas) {
  font-weight: 700 !important;
}
/* breitere Schrift: „View all work“ darf unter „Recent Work“ rutschen statt am Handy abgeschnitten zu werden */
html:is(.bf-legasthenie, .bf-zeichenabstand, .bf-fett) body .projekte-kopf { flex-wrap: wrap; }

/* --- Bewegung: Animationen und Übergänge springen sofort ans Ende. Dazu (wie bei „Bewegung reduzieren“):
   site.js – Einblendungen sofort, kein weiches Scrollen, keine Footer-Parallaxe, Badge-Punkt blinkt nicht,
   Maus-Punkt ohne Feder; rauch.js – Rauch steht; galerie.js – keine Spalten-Tiefe, Vollbild ohne Flug;
   Konfigurator – Modell pendelt nicht, Preis ohne Hochzählen ----------------------------------------- */
html.bf-ruhig *,
html.bf-ruhig *::before,
html.bf-ruhig *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
html.bf-ruhig .scroll-maus svg,
html.bf-ruhig .konf-laden-linie::after { animation: none !important; }
