/**
 * a11y.css – Stylesheet für das Barrierefreiheits-Menü und A11y-Zustände.
 * Stellt modulare Komponenten bereit:
 *   .a11y-panel, .a11y-group, .a11y-option, .a11y-toggle, .a11y-stepper
 * Wird auch von cookie-consent.css mitverwendet.
 */

/* ---------- Barrierefreiheits-Panel (Slide-Over / Modal) ---------------- */
.a11y-panel{
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(420px, 100vw);
  max-width: 100%;
  background: var(--c-paper, #ffffff);
  border-right: 1px solid var(--c-line, #DCD3C0);
  box-shadow: var(--shadow-lift, 0 18px 45px -14px rgba(43, 42, 36, 0.28));
  z-index: 960;
  padding: var(--sp-6, 2rem);
  padding-bottom: max(var(--sp-6, 2rem), env(safe-area-inset-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform var(--motion-med, 320ms) var(--ease, cubic-bezier(.4,0,.2,1));
}

.a11y-panel[hidden]{
  display: none;
}

.a11y-panel__close{
  align-self: flex-end;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--c-line, #DCD3C0);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-ink, #2B2A24);
  transition: background var(--motion-fast, 160ms) var(--ease), border-color var(--motion-fast);
}

.a11y-panel__close:hover{
  background: var(--c-cream, #F8F4EC);
  border-color: var(--c-olive, #3B4430);
}

.a11y-panel h2{
  font-size: var(--fs-700, 1.5rem);
  margin-top: var(--sp-2, 0.5rem);
  margin-bottom: var(--sp-2, 0.5rem);
  color: var(--c-olive, #3B4430);
}

.a11y-panel > p{
  font-size: 0.88rem;
  color: var(--c-ink-soft, #55534A);
  margin-bottom: var(--sp-5, 1.5rem);
  line-height: 1.45;
}

/* ---------- Komponenten für Optionen & Gruppen -------------------------- */
.a11y-group{
  border-top: 1px solid var(--c-line, #DCD3C0);
  padding: var(--sp-4, 1rem) 0;
}

.a11y-group h3{
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ink-soft, #55534A);
  margin: 0 0 var(--sp-3, 0.75rem);
  font-family: var(--f-body, sans-serif);
  font-weight: 700;
}

.a11y-option{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3, 0.75rem);
  padding: var(--sp-2, 0.5rem) 0;
  font-size: 0.95rem;
}

.a11y-option span{
  color: var(--c-ink, #2B2A24);
}

/* ---------- Schalter (Switch Toggle) ------------------------------------- */
.a11y-toggle{
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--c-line, #DCD3C0);
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  outline-offset: 3px;
  transition: background var(--motion-fast, 160ms) var(--ease, cubic-bezier(.4,0,.2,1));
}

.a11y-toggle::after{
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform var(--motion-fast, 160ms) var(--ease, cubic-bezier(.4,0,.2,1));
}

.a11y-toggle[aria-checked="true"]{
  background: var(--c-olive, #3B4430);
}

.a11y-toggle[aria-checked="true"]::after{
  transform: translateX(20px);
}

.a11y-toggle:focus-visible{
  outline: 2px solid var(--c-focus, #1C57B0);
}

.a11y-toggle:disabled{
  cursor: not-allowed;
  opacity: 0.65;
}

/* ---------- Stepper für Schriftgröße ------------------------------------- */
.a11y-stepper{
  display: flex;
  align-items: center;
  gap: var(--sp-2, 0.5rem);
}

.a11y-stepper button{
  width: 32px;
  height: 32px;
  border-radius: var(--radius-s, 6px);
  border: 1.5px solid var(--c-line, #DCD3C0);
  background: var(--c-paper, #ffffff);
  color: var(--c-olive, #3B4430);
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast);
}

.a11y-stepper button:hover{
  background: var(--c-cream, #F8F4EC);
  border-color: var(--c-olive, #3B4430);
}

.a11y-stepper output{
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-olive, #3B4430);
}

/* ---------- Reset-Button ------------------------------------------------ */
.a11y-reset{
  margin-top: var(--sp-6, 2rem);
  width: 100%;
  text-align: center;
}

/* =========================================================================
   Globale Barrierefreiheits-Zustände (angewendet auf <html>)
   ========================================================================= */

/* 1. Schriftgrößen-Skalierung */
html[data-font-step="-2"]{ font-size: 87.5%; }
html[data-font-step="-1"]{ font-size: 93.75%; }
html[data-font-step="0"] { font-size: 100%; }
html[data-font-step="1"] { font-size: 106.25%; }
html[data-font-step="2"] { font-size: 112.5%; }
html[data-font-step="3"] { font-size: 120%; }
html[data-font-step="4"] { font-size: 128%; }

/* 2. Starker Kontrast */
html.a11y-contrast{
  --c-cream: #FFFFFF !important;
  --c-cream-deep: #F0F0F0 !important;
  --c-paper: #FFFFFF !important;
  --c-ink: #000000 !important;
  --c-ink-soft: #111111 !important;
  --c-olive: #000000 !important;
  --c-olive-700: #000000 !important;
  --c-sand: #000000 !important;
  --c-sand-600: #000000 !important;
  --c-line: #000000 !important;
}
html.a11y-contrast img{
  filter: contrast(115%);
}
html.a11y-contrast .btn--primary{
  background: #000000 !important;
  color: #FFFFFF !important;
  border: 2px solid #000000 !important;
}

/* 3. Graustufen */
html.a11y-grayscale{
  filter: grayscale(100%) !important;
}

/* 4. Zeichenabstand / Lesbarkeit */
html.a11y-readable *{
  letter-spacing: 0.05em !important;
  word-spacing: 0.1em !important;
  line-height: 1.8 !important;
}

/* 5. Links immer unterstreichen */
html.a11y-underline a{
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* 6. Größere Klickflächen */
html.a11y-bigtarget button,
html.a11y-bigtarget a,
html.a11y-bigtarget input,
html.a11y-bigtarget summary{
  min-height: 48px !important;
  min-width: 48px !important;
}

/* 7. Fokus stark hervorheben */
html.a11y-focus *:focus-visible{
  outline: 4px solid var(--c-focus, #1C57B0) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(28, 87, 176, 0.3) !important;
}

/* 8. Animationen deaktivieren */
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after{
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
