/* ============================================================
   erle-it · Barrierefreiheit (v1.0.7, 11/2026)
   1) Korrekturen: Tastaturfokus, Kontraste, Inhalte ohne JavaScript
   2) Schaltfläche „Darstellung anpassen“ und ihre Wirkungen
   ============================================================ */

/* -- 1) Korrekturen ----------------------------------------- */

/* Sichtbarer Tastaturfokus im Formular (0,4,2 schlägt Astras und unser outline:none) */
.wpcf7 form.wpcf7-form input.wpcf7-form-control:focus-visible,
.wpcf7 form.wpcf7-form textarea.wpcf7-form-control:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Feldrahmen ≥ 3:1 (#7b8aa0 = 3,51:1), Platzhalter ≥ 4,5:1 (muted = 4,76:1) */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form textarea { border-color: #7b8aa0; }
.wpcf7-form ::placeholder { color: var(--color-muted); opacity: 1; }

/* Kleine Akzenttexte auf getönten Flächen: dunkleres Blau (≥ 5:1) */
.hero-eyebrow, .project-meta__year { color: var(--color-accent-2); }

/* Beschriftung der Sicherheitsfrage (ersetzt das verschachtelte <label>) */
.wpcf7-form .cf7-label-text { display: block; font-size: var(--fs-sm); font-weight: 500; color: var(--color-navy); }

/* Ohne JavaScript bleiben eingeblendete Inhalte sonst unsichtbar */
html:not(.erle-js) .reveal,
html:not(.erle-js) .fade-in,
html:not(.erle-js) .scale-in,
html:not(.erle-js) .reveal-group > * { opacity: 1; transform: none; }

/* -- 2) Darstellung anpassen -------------------------------- */

.erle-darstellung {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 9990;
  font-family: var(--font-sans);
}
.erle-darstellung[hidden],
.erle-darstellung__panel[hidden] { display: none; }

.erle-darstellung__knopf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--color-navy);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  cursor: pointer;
}

.erle-darstellung__knopf svg { width: 20px; height: 20px; flex: none; }

.erle-darstellung :focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.erle-darstellung__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(19rem, calc(100vw - 32px)); /* rem: wächst mit der gewählten Schriftgröße */
  max-height: calc(100vh - 96px);
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #fff;
  color: var(--color-navy);
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.22);
}
.erle-darstellung__titel { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: var(--color-navy); }
.erle-darstellung__gruppe { margin: 4px 0 0; font-size: 0.8125rem; font-weight: 600; color: var(--color-navy-3); }

.erle-darstellung__panel button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #7b8aa0;
  border-radius: 8px;
  background: #fff;
  color: var(--color-navy);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.erle-darstellung__panel button[aria-pressed="true"] {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: #fff;
}
/* Zustand nicht nur über Farbe: Häkchen (für Screenreader stumm, aria-pressed trägt die Info) */
.erle-darstellung__panel button[aria-pressed="true"]::after { content: " ✓"; content: " ✓" / ""; }

.erle-darstellung__reihe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.erle-darstellung__reihe button { text-align: center; padding: 8px 4px; overflow-wrap: anywhere; }
.erle-darstellung__fuss { display: flex; gap: 8px; margin-top: 4px; }
.erle-darstellung__fuss button { flex: 1; text-align: center; }
.erle-darstellung__hinweis { margin: 2px 0 0; font-size: 0.8125rem; line-height: 1.4; color: var(--color-muted); }
.erle-darstellung__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media print { .erle-darstellung { display: none; } }

/* Wirkungen: Schriftgröße (Astra und die Tokens rechnen in rem) */
html.erle-schrift-1 { font-size: 112.5%; }
html.erle-schrift-2 { font-size: 125%; }
@media (max-width: 921px) {
  html.erle-schrift-1 { font-size: 102.6%; } /* 91,2 % × 1,125 */
  html.erle-schrift-2 { font-size: 114%; }   /* 91,2 % × 1,25 */
}

/* Wirkungen: hoher Kontrast */
html.erle-kontrast {
  --color-text: #0f172a;
  --color-muted: #1e293b;
  --color-muted-2: #334155;
  --color-border: #475569;
  --color-border-strong: #1e293b;
  --color-accent: #1d4ed8;
}
html.erle-kontrast body { color: #0f172a; }
html.erle-kontrast ::placeholder { color: #334155; }

/* Wirkungen: Links hervorheben */
html.erle-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px;
}

/* Wirkungen: Animationen aus */
html.erle-ruhig *,
html.erle-ruhig *::before,
html.erle-ruhig *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0s !important;
  scroll-behavior: auto !important;
}
html.erle-ruhig .reveal,
html.erle-ruhig .fade-in,
html.erle-ruhig .scale-in,
html.erle-ruhig .reveal-group > * { opacity: 1 !important; transform: none !important; }
html.erle-ruhig .has-parallax { --sy: 0px !important; }
