/* public/css/accessibility.css
   - uses theme-tokens.css only
   - no fixed colors
*/

/* -------- Base a11y vars (mapped to theme tokens) -------- */
:root{
    --font-scale: 1;
}

/* ----------------------- TEXT SCALING ----------------- */
html{ font-size: 16px; }

body{
    font-size: calc(16px * var(--font-scale)) !important;
}

h1{ font-size: 2.4em !important; line-height: 1.15; }
h2{ font-size: 1.85em !important; line-height: 1.2; }
h3{ font-size: 1.35em !important; line-height: 1.25; }

p, li, a, span, label, small,
button, input, select, textarea{
    font-size: inherit !important;
}

button, input, select, textarea{
    line-height: 1.2;
}

/* ------------------ Reduce motion ------------------ */
html[data-motion="reduced"] *{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* ------------------ More spacing --------------------- */
html[data-spacing="wide"]{
    letter-spacing: 0.02em;
    word-spacing: 0.06em;
}
html[data-spacing="wide"] body{
    line-height: 1.8;
}

/* ---------------- Highlight links ------------------- */
html[data-links="highlight"] a{
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
}

/* ---------------- Strong focus --------------------- */
html[data-focus="strong"] :focus-visible{
    outline: 3px solid var(--a11y-accent) !important;
    outline-offset: 3px !important;
    border-radius: 10px;
}

/* ---------------- Widget FAB --------------------- */
.a11y-fab{
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 2147483647;

    width: 54px;
    height: 54px;
    border-radius: calc(var(--radius-sm) + 4px);

    border: 1px solid var(--a11y-border);
    background: var(--a11y-fab-bg);
    color: var(--on-primary);

    font-weight: 900;
    font-size: 18px;
    cursor: pointer;

    display: grid;
    place-items: center;
    padding: 0;

    box-shadow: 0 18px 45px var(--a11y-fab-shadow);
}

.a11y-fab img{
    width: 28px;
    height: 28px;
    object-fit: contain;
    pointer-events: none;
}

/* ---------------- Widget Panel --------------------- */
.a11y-panel{
    position: fixed;
    left: 16px;
    bottom: 82px;
    z-index: 2147483647;

    width: min(360px, calc(100vw - 32px));
    border-radius: var(--radius);
    border: 1px solid var(--a11y-border);

    background: color-mix(in srgb, var(--a11y-panel) 92%, transparent);
    color: var(--a11y-text);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    padding: 14px;
    display: none;
}

.a11y-panel.is-open{ display: block; }

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

.a11y-panel__title{
    margin: 0;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.01em;
    color: var(--a11y-text);
}

.a11y-close{
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--a11y-border);
    background: var(--a11y-soft);
    cursor: pointer;
    font-weight: 900;
    color: inherit;
}

.a11y-close:hover{
    filter: brightness(1.05);
    background-color: white;
}

.a11y-section{
    border-top: 1px solid var(--a11y-border);
    padding-top: 12px;
    margin-top: 12px;
}

.a11y-label{
    display: block;
    font-size: 12px;
    font-weight: 900;
    color: var(--a11y-muted);
    margin-bottom: 8px;
}

.a11y-row{
    display: flex;
    gap: 10px;
    align-items: center;
}

.a11y-range{ flex: 1; }

.a11y-number{
    width: 92px;
    padding: 10px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--a11y-border);
    background: color-mix(in srgb, var(--a11y-soft) 45%, transparent);
    color: inherit;
    font-weight: 900;
    outline: none;
}

.a11y-number:focus{
    border-color: var(--a11y-accent);
    box-shadow: var(--ring);
}

.a11y-grid{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.a11y-btn{
    height: 42px;
    border-radius: var(--radius);
    border: 1px solid var(--a11y-border);
    background: var(--a11y-soft);
    color: inherit;
    cursor: pointer;
    font-weight: 900;
}

.a11y-btn:hover{
    filter: brightness(1.05);
}

.a11y-btn.is-on{
    background: linear-gradient(135deg, var(--a11y-accent), var(--primary-strong));
    border-color: color-mix(in srgb, var(--a11y-accent) 35%, var(--a11y-border));
    color: var(--on-primary);
}

.a11y-small{
    margin-top: 10px;
    font-size: 12px;
    color: var(--a11y-muted);
    font-weight: 800;
    line-height: 1.5;
}

/* -------- High contrast: remove decorative effects via tokens (no hard #000) -------- */
html[data-contrast="high"] .a11y-panel{
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    background: var(--bg);
}

/* --- High contrast: make panel border + selected state use theme tokens --- */
html[data-contrast="high"] .a11y-panel{
    border-color: var(--border);
}

html[data-contrast="high"] .a11y-btn.is-on{
    background: var(--primary);     /* gelb */
    border-color: var(--border);    /* gelb */
    color: var(--on-primary);       /* schwarz (bei dir im high: --on-primary:#000) */
}
html[data-contrast="high"] .a11y-close,
html[data-contrast="high"] .a11y-btn,
html[data-contrast="high"] .a11y-number{
    border-color: var(--border);
}
