/*
 * Cookie-Banner, Cookie-Hinweis und Barrierefreiheits-Panel aller Marken (additional/consent.php, additional/a11y.php)
 * plus die Klassen, die a11y.js am <html> setzt. Webseite (Bootstrap 5) und Kundenbereich (Metronic),
 * hell und dunkel über data-bs-theme.
 */
:root {
    --a11y-surface: #fff;
    --a11y-ink: #1f2937;
    --a11y-line: rgba(0, 0, 0, .18);
    --a11y-fg: #000;
    --a11y-bg: #fff;
    --a11y-focus: #0b57d0;
}
[data-bs-theme="dark"] {
    --a11y-surface: #1b2230;
    --a11y-ink: #f1f5f9;
    --a11y-line: rgba(255, 255, 255, .22);
    --a11y-fg: #fff;
    --a11y-bg: #000;
    --a11y-focus: #8ab4ff;
}

/* Panels: unten links, über allem außer Dialogen */
.consent-panel { position: fixed; z-index: 1090; left: 1rem; right: 1rem; bottom: 1rem; max-width: 34rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.consent-panel:focus { outline: none; }
.consent-panel .consent-item + .consent-item, .a11y-item + .a11y-item { border-top: 1px solid rgba(127, 127, 127, .2); }
#consent-info, .a11y-panel { bottom: 4.5rem; max-width: 26rem; max-height: calc(100vh - 5.5rem); }
.a11y-sizes { display: flex; flex-wrap: wrap; gap: .4rem; }
.a11y-sizes .btn { display: inline-flex; align-items: baseline; gap: .3rem; line-height: 1.6; }
.a11y-size-0 { font-size: .85em; }
.a11y-size-1 { font-size: 1em; }
.a11y-size-2 { font-size: 1.15em; }
.a11y-size-3 { font-size: 1.3em; }
.a11y-panel .btn-close { opacity: .7; }
[data-bs-theme="dark"] .a11y-panel .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.a11y-panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* Schwebende Knöpfe */
.a11y-dock { position: fixed; z-index: 1080; left: 1rem; bottom: 1rem; display: flex; gap: .5rem; }
.a11y-fab {
    width: 2.75rem; height: 2.75rem; padding: 0; display: inline-grid; place-items: center; cursor: pointer;
    border-radius: 50%; border: 1px solid var(--a11y-line); background: var(--a11y-surface); color: var(--a11y-ink);
    box-shadow: 0 .25rem .9rem rgba(0, 0, 0, .18); transition: transform .15s ease, color .15s ease;
}
.a11y-fab:hover { transform: translateY(-2px); color: var(--page-accent, var(--bs-primary)); }
.a11y-fab:focus-visible { outline: 3px solid var(--a11y-focus); outline-offset: 2px; }
.a11y-fab[aria-expanded="true"] { color: var(--page-accent, var(--bs-primary)); border-color: currentColor; }
@media print { .a11y-dock, .consent-panel { display: none !important; } }
/* Platz unter der letzten Zeile der Fußzeile, damit die Knöpfe nichts verdecken */
body:has(> .a11y-dock) > footer:last-of-type,
body:has(> .a11y-dock) #kt_footer { padding-bottom: 4.5rem !important; }

/* Fußzeilen-Links unter den Social-Icons (page_footer_settings) */
.page-settings { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.page-settings button { padding: 0; border: 0; background: none; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: .4rem; }
.page-settings button:hover { text-decoration: underline; }

/* Größere Schrift: a11y.js vergrößert die Grundschrift am <html>; der Kundenbereich setzt body in px, daher hier rem */
html.a11y-size body { font-size: 1rem !important; }

/* Hoher Kontrast */
html.a11y-contrast {
    --page-muted: var(--a11y-fg);
    --page-line: var(--a11y-fg);
    --page-header-muted: var(--page-header-color, inherit);
    --bs-secondary-color: var(--a11y-fg);
    --bs-tertiary-color: var(--a11y-fg);
    --bs-border-color: var(--a11y-fg);
    --bs-body-color: var(--a11y-fg);
    --bs-emphasis-color: var(--a11y-fg);
    --a11y-line: var(--a11y-fg);
    --a11y-ink: var(--a11y-fg);
    --a11y-surface: var(--a11y-bg);
}
html.a11y-contrast body { color: var(--a11y-fg); }
html.a11y-contrast .text-muted,
html.a11y-contrast .text-secondary,
html.a11y-contrast .text-body-secondary,
html.a11y-contrast .text-body-tertiary,
html.a11y-contrast [class*=" text-gray-"],
html.a11y-contrast [class^="text-gray-"] { color: var(--a11y-fg) !important; opacity: 1 !important; }
/* Gedämpfte Schrift auf farbigen Flächen (Fußzeilen, Hero) nimmt die volle Farbe der Fläche */
html.a11y-contrast [class$="-soft"],
html.a11y-contrast [class*="-soft "] { color: inherit !important; opacity: 1 !important; }
html.a11y-contrast .card,
html.a11y-contrast .form-control,
html.a11y-contrast .form-select,
html.a11y-contrast .form-check-input { border-color: var(--a11y-fg) !important; }
html.a11y-contrast :focus-visible { outline: 3px solid var(--a11y-focus) !important; outline-offset: 2px !important; box-shadow: 0 0 0 5px var(--a11y-bg) !important; }

/* Bewegung reduzieren */
html.a11y-motion { scroll-behavior: auto !important; }
html.a11y-motion *,
html.a11y-motion *::before,
html.a11y-motion *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}

/* Links unterstreichen (nicht Knöpfe, Menüs und Icon-Links) */
html.a11y-links a:not(.btn):not(.nav-link):not(.navbar-brand):not(.dropdown-item):not(.menu-link):not(.page-link):not(.list-group-item):not(.page-social a) {
    text-decoration: underline !important; text-underline-offset: .2em; text-decoration-thickness: max(1px, .08em);
}
html.a11y-links .page-settings button { text-decoration: underline; }

/* Lesefreundliche Schrift: schlichte Systemschrift, mehr Abstand; Icons (i, Icon-Fonts) und Code bleiben */
html.a11y-font body,
html.a11y-font body *:not(i):not(code):not(pre):not(kbd):not(samp):not(.bi):not([class*="fa-"]) {
    font-family: Verdana, Tahoma, "DejaVu Sans", "Segoe UI", sans-serif !important;
}
html.a11y-font body { letter-spacing: .03em; word-spacing: .1em; line-height: 1.7; }
html.a11y-font p, html.a11y-font li, html.a11y-font dd { line-height: 1.8; }

/* Symbole als Maske, damit sie die Textfarbe übernehmen (ohne Icon-Font, auch im Kundenbereich) */
.a11y-icon { display: inline-block; width: 1.25em; height: 1.25em; flex: none; background: currentColor; -webkit-mask: var(--a11y-icon) center / contain no-repeat; mask: var(--a11y-icon) center / contain no-repeat; }
.a11y-fab .a11y-icon { width: 1.5rem; height: 1.5rem; }
.a11y-icon-cookie { --a11y-icon: url("cookie.svg"); }
.a11y-icon-access { --a11y-icon: url("access.svg"); }

/* Kundenbereich: neben der festen Seitenleiste (265px), nicht darüber; eingeklappt wieder am Rand */
@media (min-width: 992px) {
    body:has(#kt_aside) .a11y-dock,
    body:has(#kt_aside) .consent-panel { left: calc(265px + 1rem); }
    body[data-kt-aside-minimize="on"] .a11y-dock,
    body[data-kt-aside-minimize="on"] .consent-panel { left: 1rem; }
}
