/* ==========================================================================
   Barrierefreiheits-Menue der Festivalseiten (Footer/Sub.html, Abschnitt
   A11yMenu; JavaScript/Frontend/A11yMenu.js) und was die Wahl bewirkt:
   data-dd-a11y-contrast|font|links|motion|text am <html>.
   Knopf und Dialog in derselben Form wie Nach-oben-Knopf und Meta-Leiste
   (festival.css): dunkle Scheibe, Markenkante, weisse Schrift.
   ========================================================================== */

.dd-a11y-fab {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 1030;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 2px solid var(--fest-primary, #175da9);
    border-radius: 50%;
    background-color: color-mix(in srgb, var(--fest-dunkel, #14181f) 92%, transparent);
    color: #fff;
    font-size: 1.6rem;
    box-shadow: var(--fest-schatten, 0 8px 24px -12px rgba(20, 24, 31, 0.4));
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.dd-a11y-fab:hover,
.dd-a11y-fab:focus-visible {
    background-color: var(--fest-primary, #175da9);
    color: var(--fest-on-primary, #fff);
}

/* "Fest im Footer": Knopf mit Text - festival.css macht alle Knoepfe im
   Fuss zu 44-px-Kreisen. */
footer .dd-a11y-footer-btn {
    width: auto;
    padding: 0 1rem !important;
    white-space: nowrap;
}

/* Mobil steht die Meta-Leiste unten fest - der Knopf darueber. */
@media (max-width: 767.98px) {
    body:has(.side-meta) .dd-a11y-fab {
        bottom: 84px;
    }
}

/* Dialog: Seitenleiste links, auf dem Handy ganze Breite. */
.dd-a11y {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(24rem, 100vw);
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 1.25rem;
    overflow-y: auto;
    border: 0;
    border-right: 3px solid var(--fest-primary, #175da9);
    background: var(--fest-dunkel, #14181f);
    color: #fff;
    font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
    font-size: 1rem;
}

.dd-a11y::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.dd-a11y__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.dd-a11y .dd-a11y__title {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.dd-a11y__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    background: transparent;
    color: #fff;
}

.dd-a11y__options {
    display: grid;
    gap: 0.6rem;
}

.dd-a11y__switch,
.dd-a11y__reset {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 52px;
    padding: 0.6rem 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--fest-radius-s, 8px);
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: left;
}

.dd-a11y__switch > .bi,
.dd-a11y__label > .bi {
    font-size: 1.3rem;
}

/* Schalter: rechts ein Feld, das an/aus zeigt - nicht nur die Farbe. */
.dd-a11y__switch::after {
    content: "aus";
    margin-left: auto;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
}

html[lang^="en"] .dd-a11y__switch::after {
    content: "off";
}

.dd-a11y__switch[aria-checked="true"] {
    border-color: #fff;
    background: #fff;
    color: #14181f;
}

.dd-a11y__switch[aria-checked="true"]::after {
    content: "an";
    background: #14181f;
    color: #fff;
}

html[lang^="en"] .dd-a11y__switch[aria-checked="true"]::after {
    content: "on";
}

.dd-a11y__size {
    padding: 0.6rem 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--fest-radius-s, 8px);
}

.dd-a11y__label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.dd-a11y__sizes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
}

.dd-a11y__sizebtn {
    min-height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--fest-radius-s, 8px);
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
}

.dd-a11y__sizebtn[aria-pressed="true"] {
    border-color: #fff;
    background: #fff;
    color: #14181f;
    font-weight: 700;
}

.dd-a11y__reset {
    justify-content: center;
    margin-top: 1rem;
}

.dd-a11y__links {
    margin: 1.25rem 0 0;
    padding: 1rem 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    list-style: none;
}

.dd-a11y__links li + li {
    margin-top: 0.5rem;
}

.dd-a11y__links a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.dd-a11y button:focus-visible,
.dd-a11y a:focus-visible,
.dd-a11y-fab:focus-visible {
    outline: 3px solid #ffd43b;
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Was die Wahl bewirkt
   -------------------------------------------------------------------------- */

/* Textgroesse: Bootstrap und festival.css rechnen in rem. */
html[data-dd-a11y-text="115"] { font-size: 115%; }
html[data-dd-a11y-text="130"] { font-size: 130%; }
html[data-dd-a11y-text="150"] { font-size: 150%; }

/* Lesefreundlich: Leseschrift auch fuer die Plakatzeilen, mehr Luft. */
html[data-dd-a11y-font="readable"] {
    --fest-font-display: "Atkinson Hyperlegible", system-ui, sans-serif;
}

html[data-dd-a11y-font="readable"] body {
    line-height: 1.75;
    letter-spacing: 0.03em;
    word-spacing: 0.12em;
}

html[data-dd-a11y-font="readable"] :is(h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4) {
    font-family: "Atkinson Hyperlegible", system-ui, sans-serif !important;
    letter-spacing: 0.01em !important;
    text-transform: none !important;
    line-height: 1.3 !important;
}

html[data-dd-a11y-font="readable"] p {
    max-width: 70ch;
}

/* Links unterstreichen - ausser Knoepfe. */
html[data-dd-a11y-links="underline"] a:not(.btn):not(.dd-a11y-fab) {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 0.2em;
}

/* Bewegung aus: keine Animationen, Ueberblendungen, Gleiten - und was
   scrollCue erst beim Hineinscrollen einblendet, steht gleich da. */
html[data-dd-a11y-motion="reduce"] {
    scroll-behavior: auto !important;
}

html[data-dd-a11y-motion="reduce"] *,
html[data-dd-a11y-motion="reduce"] *::before,
html[data-dd-a11y-motion="reduce"] *::after {
    animation: none !important;
    transition: none !important;
}

html[data-dd-a11y-motion="reduce"] [data-cue],
html[data-dd-a11y-motion="reduce"] [data-cues] > * {
    opacity: 1 !important;
    transform: none !important;
}

/* Hoher Kontrast: schwarz, weiss, gelbe Links. Hintergrundbilder fallen
   weg, Fotos und Logos bleiben. body:not(#dd-a11y-x) hebt die
   Spezifitaet um eine ID - festival.css faerbt Menuepunkte mit langen
   Selektoren und !important, die sonst gewinnen. */
html[data-dd-a11y-contrast="high"] body:not(#dd-a11y-x),
html[data-dd-a11y-contrast="high"] body:not(#dd-a11y-x) *:not(img):not(video):not(svg):not(svg *):not(picture):not(.dd-a11y):not(.dd-a11y *):not(.dd-a11y-fab):not(.dd-a11y-fab *) {
    background-color: #000 !important;
    background-image: none !important;
    color: #fff !important;
    border-color: #fff !important;
    text-shadow: none !important;
    box-shadow: none !important;
}

html[data-dd-a11y-contrast="high"] body:not(#dd-a11y-x) a:not(.dd-a11y *):not(.dd-a11y-fab),
html[data-dd-a11y-contrast="high"] body:not(#dd-a11y-x) a:not(.dd-a11y *):not(.dd-a11y-fab) * {
    color: #ffd43b !important;
}

html[data-dd-a11y-contrast="high"] body:not(#dd-a11y-x) :is(.btn, button, input, select, textarea):not(.dd-a11y *):not(.dd-a11y-fab) {
    border: 2px solid #ffd43b !important;
}

html[data-dd-a11y-contrast="high"] .dd-a11y-fab {
    border-color: #ffd43b;
    background: #000;
    color: #ffd43b;
}

html[data-dd-a11y-contrast="high"] body :focus-visible {
    outline: 3px solid #ffd43b !important;
    outline-offset: 2px;
}
