/* ============================================================
   Barrierefreiheits-Tool – GM Immobilien Holding GmbH
   ============================================================ */

/* Schwebender Öffnen-Button */
#a11y-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy, #002B54);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 6px 24px rgba(0, 43, 84, .28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#a11y-fab svg { width: 30px; height: 30px; }
#a11y-fab:hover { background: var(--navy-deep, #001C38); }
#a11y-fab:focus-visible { outline: 3px solid var(--focus, #0A5BD1); outline-offset: 3px; }

/* Panel – geschlossen über [hidden] (aus Tab-Reihenfolge UND Accessibility-Baum) */
#a11y-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 9989;
  width: min(330px, calc(100vw - 40px));
  max-height: calc(100dvh - 108px);
  background: #fff;
  border: 1px solid var(--line, #D6DCE3);
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0, 43, 84, .22);
  font-family: 'Inter', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink, #1F262E);
}
#a11y-panel[hidden] { display: none; }

.a11y-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--navy, #002B54);
  color: #fff;
  flex: none;
}
.a11y-header h2 {
  margin: 0;
  color: #fff;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.a11y-close {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.a11y-close:hover { background: rgba(255,255,255,.28); }
.a11y-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.a11y-close svg { width: 14px; height: 14px; }

.a11y-body { overflow-y: auto; flex: 1 1 auto; padding: 6px 0 10px; }

.a11y-section-title {
  margin: 0;
  padding: 12px 16px 4px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate, #4F5D6E);
}

.a11y-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 16px;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  color: var(--ink, #1F262E);
  text-align: left;
}
.a11y-btn:hover { background: var(--paper, #F3F5F8); }
.a11y-btn:focus-visible { outline: 3px solid var(--focus, #0A5BD1); outline-offset: -3px; }
.a11y-btn.a11y-active { background: #E4EAF2; color: var(--navy, #002B54); font-weight: 600; }
.a11y-btn:disabled { opacity: .5; cursor: not-allowed; }
.a11y-btn-icon {
  width: 28px; height: 28px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper, #F3F5F8);
  border-radius: 3px;
  color: var(--navy, #002B54);
}
.a11y-btn.a11y-active .a11y-btn-icon { background: var(--navy, #002B54); color: #fff; }
.a11y-btn-icon svg { width: 16px; height: 16px; }

.a11y-size-row { display: flex; align-items: center; gap: 8px; padding: 5px 16px; }
.a11y-size-btn {
  width: 40px; height: 40px; flex: none;
  background: var(--paper, #F3F5F8);
  border: 1px solid var(--line-strong, #6E7C8D);
  border-radius: 3px;
  cursor: pointer;
  font: inherit; font-weight: 600; font-size: .95rem;
  color: var(--navy, #002B54);
}
.a11y-size-btn:hover { background: var(--navy, #002B54); color: #fff; border-color: var(--navy, #002B54); }
.a11y-size-btn:focus-visible { outline: 3px solid var(--focus, #0A5BD1); outline-offset: 2px; }
.a11y-size-label { flex: 1; font-size: .9rem; }
.a11y-size-val { min-width: 44px; text-align: right; font-size: .85rem; font-weight: 600; color: var(--navy, #002B54); font-variant-numeric: tabular-nums; }

.a11y-divider { height: 1px; background: var(--line, #D6DCE3); margin: 6px 16px; }

.a11y-reset {
  display: block;
  width: calc(100% - 32px);
  margin: 8px 16px 6px;
  padding: 10px;
  background: none;
  border: 1.5px solid var(--navy, #002B54);
  border-radius: 3px;
  cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--navy, #002B54);
}
.a11y-reset:hover { background: var(--navy, #002B54); color: #fff; }
.a11y-reset:focus-visible { outline: 3px solid var(--focus, #0A5BD1); outline-offset: 2px; }

.a11y-link {
  display: block;
  text-align: center;
  padding: 6px 16px 8px;
  font-size: .85rem;
  color: var(--navy, #002B54);
}

/* ── Overlays ── */
#a11y-readingline {
  position: fixed; left: 0; right: 0; height: 3px;
  background: #C62828;
  z-index: 9980; pointer-events: none; display: none;
}
html.a11y-readingline-on #a11y-readingline { display: block; }

#a11y-mask-top, #a11y-mask-bottom {
  position: fixed; left: 0; right: 0;
  background: rgba(0, 0, 0, .65);
  z-index: 9979; pointer-events: none; display: none;
}
#a11y-mask-top { top: 0; }
#a11y-mask-bottom { bottom: 0; }
html.a11y-mask-on #a11y-mask-top, html.a11y-mask-on #a11y-mask-bottom { display: block; }

/* ── Modi (Klassen auf <html>) ── */
html.a11y-cursor-on, html.a11y-cursor-on * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 32 32'%3E%3Cpath d='M8 2 L8 26 L13 21 L17 29 L20 28 L16 20 L23 20 Z' fill='black' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E") 0 0, auto !important;
}

/* Animationen stoppen – erfasst Transitions, Keyframes UND Smooth-Scroll;
   Videos werden zusätzlich per JS pausiert (motion.js) */
html.a11y-no-anim *, html.a11y-no-anim *::before, html.a11y-no-anim *::after {
  animation-play-state: paused !important;
  transition-duration: 0s !important;
}
html.a11y-no-anim { scroll-behavior: auto !important; }

/* Heller Kontrast: reines Schwarz auf Weiß */
html.a11y-contrast-light body,
html.a11y-contrast-light body :not(svg):not(path) {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}
html.a11y-contrast-light .a11y-btn-icon svg,
html.a11y-contrast-light .a11y-header svg { color: #000 !important; }

/* Hoher Kontrast: Gelb auf Schwarz */
html.a11y-contrast-high body,
html.a11y-contrast-high body :not(svg):not(path) {
  background-color: #000 !important;
  color: #ff0 !important;
  border-color: #ff0 !important;
}
html.a11y-contrast-high a { color: #0ff !important; }
html.a11y-contrast-high :focus-visible { outline-color: #fff !important; }

/* Graustufen: Filter auf dem Root-Element – das Root-Element erzeugt laut
   Filter-Effects-Spec KEINEN Containing Block, fixed-Elemente (FAB, Panel)
   bleiben daher am Viewport und erreichbar. NIE auf body legen. */
html.a11y-mono { filter: grayscale(1); }

html.a11y-no-images img, html.a11y-no-images video, html.a11y-no-images picture { opacity: 0 !important; }

html.a11y-highlight-links a {
  text-decoration: underline !important;
  background: #ffe600 !important;
  color: #000 !important;
  padding: 0 2px;
}

html.a11y-readable-font, html.a11y-readable-font * { font-family: Arial, Verdana, sans-serif !important; }
html.a11y-bold-text * { font-weight: 700 !important; }
html.a11y-letter-spacing * { letter-spacing: .12em !important; }
html.a11y-word-spacing * { word-spacing: .18em !important; }
html.a11y-text-left * { text-align: left !important; }
