/* ============================================================
   Barrierefreiheits-Layer – dr-moreano.de
   Wird NACH dem Theme-Stylesheet geladen (siehe Plugin-PHP).
   Ziel: WCAG 2.1 AA – 1.4.3, 1.4.11, 2.4.7, 2.4.11, 2.5.8, 2.3.3
   ============================================================ */

:root {
  --a11y-focus-inner: #12263f; /* dunkler Ring  */
  --a11y-focus-outer: #ffd447; /* heller Ring   */
  --a11y-scrim-from: rgba(10, 22, 35, 0.72);
  --a11y-scrim-to: rgba(10, 22, 35, 0.25);
}

/* ------------------------------------------------------------
   1) Sichtbarer Tastaturfokus (WCAG 2.4.7 / 2.4.11)
   Doppelring: funktioniert auf hellem UND dunklem Untergrund.
   ------------------------------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible {
  outline: 3px solid var(--a11y-focus-inner) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 6px var(--a11y-focus-outer) !important;
  border-radius: 2px;
}

/* Fallback für Browser ohne :focus-visible */
@supports not selector(:focus-visible) {
  a:focus,
  button:focus,
  input:focus,
  select:focus,
  textarea:focus,
  [tabindex]:not([tabindex="-1"]):focus {
    outline: 3px solid var(--a11y-focus-inner) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px var(--a11y-focus-outer) !important;
  }
}

/* Theme-Resets neutralisieren, die den Fokus killen.
   Ausgenommen: Container mit tabindex="-1". Die bekommen den Fokus nur
   programmatisch (Sprungziel des Skip-Links) und sollen keinen Rahmen
   um die halbe Seite ziehen - Snippet #1486 setzt dort bewusst
   outline:none, das wird hier nicht ueberstimmt. */
*:focus-visible:not([tabindex="-1"]) {
  outline-style: solid !important;
}

/* ------------------------------------------------------------
   2) Skip-Link (2.4.1)
   Das Styling liegt bewusst NICHT hier, sondern im WPCode-Snippet
   #1486 "Kontrast & Zielgroessen". Zwei Regelsaetze fuer dasselbe
   Element mit unterschiedlicher Optik waren nur Verwirrung.
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   3) Kontrast im Hero-Slider (WCAG 1.4.3)
   Scrim hinter dem Text – unabhängig vom Motiv >= 4.5:1.
   .dmz-scrim wird vom Skript auf den Slide-Container gesetzt.
   ------------------------------------------------------------ */
.dmz-scrim {
  position: relative;
}

.dmz-scrim::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    var(--a11y-scrim-from) 0%,
    var(--a11y-scrim-from) 45%,
    var(--a11y-scrim-to) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Textebene über den Scrim heben.
   Wichtig: absolut positionierte Slider-Ebenen (.slideshowifier,
   .kenburns-slide) NICHT anfassen – position:relative würde dort das
   Layout zerlegen. Die kümmert sich die Regel weiter unten. */
.dmz-scrim
  > *:not(img):not(picture):not(video):not(.slideshowifier):not(.kenburns-slide):not(.dmz-slider-controls) {
  position: relative;
  z-index: 2;
}

/* Theme "chitra": Text liegt in .kenburns-controls-wrapper, das
   sichtbare Bild in .slideshowifier (z-index: -2) dahinter.
   Der Scrim sitzt auf #kenburns-slideshow, die Textebene muss darüber. */
.kenburns-controls-wrapper {
  position: relative;
  z-index: 2;
}

/* Falls der Slider-Text in einer eigenen Box liegt: harte Variante */
.dmz-textbox {
  background: rgba(10, 22, 35, 0.78);
  padding: 1.25rem 1.5rem;
  border-radius: 6px;
  display: inline-block;
  max-width: 46rem;
}

.dmz-scrim h1,
.dmz-scrim h2,
.dmz-scrim p,
.dmz-textbox,
.dmz-textbox * {
  color: #fff;
}

/* text-shadow ist KEIN Kontrastersatz, aber hilft bei Detailkanten */
.dmz-scrim h1,
.dmz-scrim h2 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* ------------------------------------------------------------
   4) Slider-Steuerung (2.2.2 Pause, Stop, Hide)
   ------------------------------------------------------------ */
.dmz-slider-controls {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: flex;
  gap: 0.5rem;
}

.dmz-btn {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1;
  color: #fff;
  background: #12263f;
  border: 2px solid #fff;
  border-radius: 4px;
  cursor: pointer;
}

.dmz-btn:hover {
  background: #1d3a5f;
}

.dmz-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex: none;
}

/* ------------------------------------------------------------
   5) Utilities
   ------------------------------------------------------------ */
.dmz-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Mindest-Zielgröße für Touch/Maus (2.5.8).
   Die Slider-Buttons sind hier bewusst NICHT gelistet – sie haben über
   .dmz-btn bereits 44px, und diese Regel wäre spezifischer und würde
   sie wieder auf 24px zusammenstauchen. */
.dmz-menu-toggle,
.social-icons a,
.footer a[href^="tel:"] {
  min-width: 24px;
  min-height: 24px;
}

/* ------------------------------------------------------------
   6) Bewegung reduzieren (2.3.3 / prefers-reduced-motion)
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
