/**
 * @file
 * Barrierefreiheit (WCAG 2.2 AA / BFSG): globale Korrekturen.
 * Wird als letzte Datei geladen und ergänzt die bestehenden Styles.
 */

/* 2.4.7 / 2.4.11: sichtbarer Fokus, auf hellem und dunklem Grund erkennbar */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 3px solid #1A1A1A !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px #FFF !important;
}

/* Kein Fokusrahmen beim Klicken mit Maus oder Finger. Bei Bedienung mit der
   Tastatur bleibt der Rahmen (:focus-visible oben) – Pflicht nach WCAG 2.4.7. */
:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* Sprungziel des Skip-Links: kein Rahmen um den ganzen Inhalt */
main#main-content:focus {
  outline: none;
}

/* 2.4.1: Skip-Link sichtbar, sobald er den Fokus bekommt */
.visually-hidden-focusable:focus,
.visually-hidden-focusable:focus-within {
  position: fixed !important;
  top: 1rem;
  left: 1rem;
  z-index: 10000;
  width: auto !important;
  height: auto !important;
  padding: 0.75rem 1.25rem !important;
  clip: auto !important;
  overflow: visible !important;
  background: #1A1A1A;
  color: #FFF !important;
  font-weight: 700;
  text-decoration: none;
}

/* 2.5.8: Zielgröße mindestens 24 x 24 px */
.nav-link,
.btn,
.page-link,
.links-inline a {
  min-height: 24px;
  min-width: 24px;
}

/* Untermenü-Schalter im Hauptmenü (siehe menu--main.html.twig) */
.submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.submenu-toggle::after {
  content: "";
  width: 0.5em;
  height: 0.5em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.submenu-toggle[aria-expanded="true"]::after {
  transform: rotate(-135deg) translateY(-2px);
}

/* 2.2.2: Pause-Schalter für automatisch abspielende Videos (siehe global.js) */
.hetz-video-toggle {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  padding: 0.5rem 0.9rem;
  border: 2px solid #FFF;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFF;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* 2.3.3: reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
  #particles-js canvas {
    display: none !important;
  }
}

/* 1.4.10: kein horizontales Scrollen durch feste Breiten bei 320 px */
@media (max-width: 400px) {
  .footer-top .footer-top-inner .region-footer-top {
    width: auto !important;
  }
}

/* Mobil: kein Doppeltipp-Zoom und keine Tipp-Verzögerung.
   Pinch-Zoom bleibt erlaubt (WCAG 1.4.4 Text vergrößern). */
html {
  touch-action: manipulation;
}

/* iOS zoomt beim Antippen von Feldern unter 16 px automatisch hinein. */
input,
select,
textarea {
  font-size: max(16px, 1rem);
}
