/* ===========================================================
   TheCodeAtlas – A11y Suite (Premium)
   UNIVERSAL ENGINE – VARIANTE A (CSS)
=========================================================== */

/* --- Toggle Button --- */
#a11y-widget-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999999;
    width: 50px;
    height: 50px;
    border-radius: 999px;
    border: none;
    background: #2563eb;
    color: #f9fafb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.6);
    transition: transform .15s ease, box-shadow .15s ease;
}

#a11y-widget-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.8);
}

/* --- Panel --- */
#a11y-widget-panel {
    position: fixed;
    right: 18px;
    bottom: 80px;
    z-index: 999998;
    width: 300px;
    max-width: calc(100% - 30px);
    background: #020617;
    color: #e5e7eb;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, .5);
    padding: 14px 14px 10px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.9);
    display: none;
}

#a11y-widget-panel.open {
    display: block;
}

/* --- Header --- */
#a11y-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#a11y-header h3 {
    font-size: 15px;
    margin: 0;
}

#a11y-close {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
}

#a11y-close:hover {
    color: #f9fafb;
}

/* --- Sektionen --- */
.a11y-section {
    border-top: 1px solid rgba(55, 65, 81, 0.9);
    padding-top: 8px;
    margin-top: 8px;
}

.a11y-section:first-of-type {
    border-top: none;
    margin-top: 2px;
    padding-top: 2px;
}

.a11y-title {
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 6px;
}

.a11y-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 6px;
}

.a11y-row span {
    font-size: 13px;
}

/* --- Buttons --- */
#a11y-widget-panel button {
    font-family: inherit;
}

.a11y-section button,
#a11y-reset {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: #020617;
    color: #e5e7eb;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.a11y-section button:hover,
#a11y-reset:hover {
    background: #1f2937;
    border-color: rgba(148, 163, 184, 1);
}

.a11y-section button.active {
    background: #22c55e;
    border-color: #22c55e;
    color: #022c22;
}

/* Reset-Button */
#a11y-reset {
    width: 100%;
    margin-top: 8px;
}

/* Branding */
.a11y-brand {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
}

.a11y-brand a {
    color: #60a5fa;
    text-decoration: none;
}

.a11y-brand a:hover {
    text-decoration: underline;
}

/* --- Responsiv --- */
@media (max-width: 576px) {
    #a11y-widget-toggle {
        right: 12px;
        bottom: 12px;
    }
    #a11y-widget-panel {
        right: 10px;
        bottom: 70px;
        width: calc(100% - 20px);
    }
}

/* ===========================================================
   WIRKUNG AUF DIE SEITE – über <html data-a11y-*="">
=========================================================== */

/* Schriftgröße */
html[data-a11y-font="large"] body {
    font-size: 1.10em !important;
}

html[data-a11y-font="xlarge"] body {
    font-size: 1.25em !important;
}

/* Zeilenabstand */
html[data-a11y-line="large"] body {
    line-height: 1.7 !important;
}

html[data-a11y-line="xlarge"] body {
    line-height: 2 !important;
}

/* Hoher Kontrast */
html[data-a11y-contrast="high"] body {
    background-color: #000000 !important;
    color: #ffffff !important;
}

html[data-a11y-contrast="high"] a {
    color: #22c55e !important;
    text-decoration: underline;
}

/* Dark Mode */
html[data-a11y-theme="dark"] body {
    background-color: #020617 !important;
    color: #e5e7eb !important;
}

html[data-a11y-theme="dark"] a {
    color: #93c5fd !important;
}

/* Links hervorheben */
html[data-a11y-links="highlight"] a {
    outline: 2px dashed #f97316 !important;
    outline-offset: 2px !important;
}

/* Dyslexie-Font */
html[data-a11y-dyslexic="on"] body {
    font-family: "OpenDyslexic", Arial, system-ui, sans-serif !important;
}

/* Animationen deaktivieren */
html[data-a11y-anim="off"] * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* ===========================================================
   HIGH-POWER-MODUS (Kompatibilitätsmodus)
   – setzt die obigen Regeln "härter" durch
=========================================================== */

/* Zeilenabstand hart durchsetzen */
html.tca-hpm[data-a11y-line="large"] body,
html.tca-hpm[data-a11y-line="large"] body *:not(#a11y-widget-panel):not(#a11y-widget-panel *):not(#a11y-widget-toggle) {
    line-height: 1.7 !important;
}

html.tca-hpm[data-a11y-line="xlarge"] body,
html.tca-hpm[data-a11y-line="xlarge"] body *:not(#a11y-widget-panel):not(#a11y-widget-panel *):not(#a11y-widget-toggle) {
    line-height: 2 !important;
}

/* Kontrast hart */
html.tca-hpm[data-a11y-contrast="high"] body,
html.tca-hpm[data-a11y-contrast="high"] body *:not(#a11y-widget-panel):not(#a11y-widget-panel *):not(#a11y-widget-toggle) {
    background-color: #000000 !important;
    color: #ffffff !important;
}

/* Dark Mode hart */
html.tca-hpm[data-a11y-theme="dark"] body,
html.tca-hpm[data-a11y-theme="dark"] body *:not(#a11y-widget-panel):not(#a11y-widget-panel *):not(#a11y-widget-toggle) {
    background-color: #020617 !important;
    color: #e5e7eb !important;
}

/* Dyslexie hart */
html.tca-hpm[data-a11y-dyslexic="on"] body,
html.tca-hpm[data-a11y-dyslexic="on"] body *:not(#a11y-widget-panel):not(#a11y-widget-panel *):not(#a11y-widget-toggle) {
    font-family: "OpenDyslexic", Arial, system-ui, sans-serif !important;
}
