/* ICAN Barrierefreiheit – Widget & Effektklassen */

/* ============ Widget ============ */

/* Strukturelle Eigenschaften mit !important, damit Theme-CSS das Widget nicht zerlegt */
#icb-root {
    --icb-color: #1a56db;
    --icb-offset: 20px;
    position: fixed !important;
    top: auto !important;
    bottom: var(--icb-offset) !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 2147483000 !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    text-align: left;
}
#icb-root, #icb-root * { box-sizing: border-box !important; }
#icb-root.icb-right { right: var(--icb-offset) !important; left: auto !important; }
#icb-root.icb-left  { left: var(--icb-offset) !important; right: auto !important; }

#icb-root .icb-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--icb-color);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
#icb-root .icb-main svg { width: 32px; height: 32px; }
#icb-root .icb-main:hover { transform: scale(1.06); }
#icb-root .icb-main:focus-visible,
#icb-root button:focus-visible { outline: 3px solid #000; outline-offset: 2px; }

#icb-root .icb-panel {
    position: absolute !important;
    bottom: 68px !important;
    top: auto !important;
    width: 340px !important;
    max-width: calc(100vw - 2 * var(--icb-offset)) !important;
    max-height: min(70vh, 560px) !important;
    margin: 0 !important;
    overflow-y: auto;
    background: #fff !important;
    color: #111 !important;
    border: 1px solid #d0d0d0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
#icb-root.icb-right .icb-panel { right: 0 !important; left: auto !important; }
#icb-root.icb-left  .icb-panel { left: 0 !important; right: auto !important; }

#icb-root .icb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--icb-color);
    color: #fff;
    border-radius: 12px 12px 0 0;
}
#icb-root .icb-head strong { font-size: 16px; }
#icb-root .icb-close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

#icb-root .icb-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
    padding: 12px;
}

#icb-root .icb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    background: #f4f5f7;
    color: #111;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    text-align: center;
}
#icb-root .icb-btn svg { width: 24px; height: 24px; }
#icb-root .icb-btn:hover { background: #e6e9ef; }
#icb-root .icb-btn.icb-active {
    background: var(--icb-color);
    color: #fff;
    border-color: #000;
}

#icb-root .icb-dots { display: flex; gap: 3px; }
#icb-root .icb-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .2);
}
#icb-root .icb-btn.icb-active .icb-dots i { background: rgba(255, 255, 255, .4); }
#icb-root .icb-dots i.icb-on { background: currentColor; }

#icb-root .icb-foot { padding: 0 12px 12px; }
#icb-root .icb-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    background: #fff;
    color: #b30000;
    border: 2px solid #b30000;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: bold;
}
#icb-root .icb-reset:hover { background: #b30000; color: #fff; }
#icb-root .icb-reset svg { width: 18px; height: 18px; }

/* Lesemaske / Leselineal / Vorlese-Hinweis */
#icb-root .icb-mask {
    position: fixed;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, .6);
    pointer-events: none;
    z-index: 2147482000;
}
#icb-root .icb-mask-top { top: 0; height: 0; }
#icb-root .icb-mask-bottom { bottom: 0; top: 100vh; }

#icb-root .icb-ruler {
    position: fixed;
    left: 0;
    right: 0;
    top: -10px;
    height: 4px;
    background: #ffb300;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
    pointer-events: none;
    z-index: 2147482001;
}

#icb-root .icb-tts-hint {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2147482002;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}

/* Skip-Link: unsichtbar, bis er per Tab fokussiert wird */
.icb-skiplink {
    position: fixed;
    top: -100px;
    left: 8px;
    z-index: 2147483002;
    background: #000;
    color: #fff;
    padding: 12px 20px;
    border-radius: 0 0 8px 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: bold;
    text-decoration: underline;
    transition: top .15s ease-out;
}
.icb-skiplink:focus,
.icb-skiplink:focus-visible {
    top: 0;
    outline: 3px solid #ffe600;
    outline-offset: -3px;
    color: #fff;
}

/* ============ Effektklassen (auf <html>) ============ */

/* Hoher Kontrast: Schwarz/Gelb, Links Cyan */
html.icb-contrast-high body :not(#icb-root):not(#icb-root *) {
    background-color: #000 !important;
    background-image: none !important;
    color: #ffe600 !important;
    border-color: #ffe600 !important;
    text-shadow: none !important;
    box-shadow: none !important;
}
html.icb-contrast-high,
html.icb-contrast-high body { background: #000 !important; }
html.icb-contrast-high body a:not(#icb-root a) { color: #4dd2ff !important; text-decoration: underline !important; }
html.icb-contrast-high body img,
html.icb-contrast-high body video { opacity: 1 !important; }

/* Filter-Modi: auf dem Root-Element erlaubt (kein Containing-Block-Problem) */
html.icb-contrast-dark { filter: invert(1) hue-rotate(180deg); background: #fff; }
html.icb-contrast-dark img,
html.icb-contrast-dark video,
html.icb-contrast-dark iframe,
html.icb-contrast-dark #icb-root { filter: invert(1) hue-rotate(180deg); }

html.icb-contrast-invert { filter: invert(1); }
html.icb-contrast-invert #icb-root { filter: invert(1); }

html.icb-contrast-gray { filter: grayscale(1); }

html.icb-contrast-blue { filter: sepia(.4) saturate(1.3) brightness(1.02); }

/* Lesbare Schrift (Icon-Fonts ausgenommen) */
html.icb-font body :not(#icb-root):not(#icb-root *):not(i):not([class*="icon"]):not([class*="fa-"]):not([class*="material"]):not([class*="dashicons"]):not([class*="eicon"]):not([class*="et-pb-icon"]) {
    font-family: Arial, Helvetica, sans-serif !important;
}

/* Links hervorheben */
html.icb-links body a:not(#icb-root a) {
    text-decoration: underline !important;
    background: #ffe600 !important;
    color: #000 !important;
    outline: 2px solid #000 !important;
}

/* Textabstände */
html.icb-spacing-1 body :not(#icb-root):not(#icb-root *) {
    line-height: 1.8 !important;
    letter-spacing: .06em !important;
    word-spacing: .12em !important;
}
html.icb-spacing-2 body :not(#icb-root):not(#icb-root *) {
    line-height: 2.2 !important;
    letter-spacing: .12em !important;
    word-spacing: .3em !important;
}

/* Animationen stoppen */
html.icb-noanim *,
html.icb-noanim *::before,
html.icb-noanim *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* Großer Mauszeiger */
html.icb-cursor,
html.icb-cursor body,
html.icb-cursor body * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24"><path d="M6 3l12 9.3-5.2.8 3 5.6-2.6 1.4-3-5.7L6 18V3z" fill="black" stroke="white" stroke-width="1.2"/></svg>') 6 3, auto !important;
}

/* Bilder ausblenden */
html.icb-noimg body img:not(#icb-root img),
html.icb-noimg body picture,
html.icb-noimg body video,
html.icb-noimg body svg:not(#icb-root svg) {
    visibility: hidden !important;
}
html.icb-noimg body :not(#icb-root):not(#icb-root *) {
    background-image: none !important;
}
