/* ═══════════════════════════════════════════════════════
   PASEK DOSTĘPNOŚCI v2 — floating button + slide panel
   public/assets/css/accessibility.css
═══════════════════════════════════════════════════════ */

/* ── Skip links ── */
.a11y-skip-link {
    position: fixed;
    top: -100px;
    left: 12px;
    background: #2563eb;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 0 0 10px 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    z-index: 10001;
    transition: top 0.15s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.a11y-skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: 2px; }

/* ═══ PŁYWAJĄCY PRZYCISK ═══ */
#a11y-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: 3px solid rgba(255,255,255,.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37,99,235,.5);
    transition: transform .2s, box-shadow .2s, background .2s;
}
#a11y-fab:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(37,99,235,.6); }
#a11y-fab:focus-visible { outline: 3px solid #93c5fd; outline-offset: 4px; }
#a11y-fab[aria-expanded="true"] { background: #1e293b; transform: rotate(90deg); }
#a11y-fab svg { pointer-events: none; flex-shrink: 0; }

/* Tooltip */
#a11y-fab::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    bottom: 50%;
    transform: translateY(50%);
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    font-family: system-ui, sans-serif;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
#a11y-fab:hover::after,
#a11y-fab:focus-visible::after { opacity: 1; }

/* ═══ PANEL ═══ */
#a11y-panel {
    position: fixed;
    bottom: 88px;
    left: 24px;
    z-index: 9997;
    width: 300px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,.45);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: #e2e8f0;
    transform: translateY(16px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
    transform-origin: bottom left;
}
#a11y-panel.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}
#a11y-panel::-webkit-scrollbar { width: 4px; }
#a11y-panel::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Nagłówek */
.ap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid #334155;
}
.ap-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 7px;
}
.ap-close {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: background .1s, color .1s;
}
.ap-close:hover { background: #334155; color: #fff; }
.ap-close:focus-visible { outline: 2px solid #60a5fa; border-radius: 4px; }

/* Sekcje */
.ap-section {
    padding: 10px 14px;
    border-bottom: 1px solid #263346;
}
.ap-section:last-child { border-bottom: none; padding-bottom: 14px; }
.ap-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #475569;
    margin-bottom: 8px;
}

/* Siatka przycisków */
.ap-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.ap-grid-2 { grid-template-columns: repeat(2,1fr); }

/* Przyciski opcji */
.ap-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #263346;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    min-height: 56px;
    text-align: center;
    line-height: 1.3;
}
.ap-btn:hover { background: #334155; border-color: #475569; color: #e2e8f0; }
.ap-btn:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.ap-btn.active,
.ap-btn[aria-pressed="true"] { background: #2563eb; border-color: #3b82f6; color: #fff; }
.ap-btn-icon { font-size: 19px; line-height: 1; pointer-events: none; }
.ap-btn-lbl { pointer-events: none; }

/* Suwak rozmiaru */
.ap-slider-row { display: flex; align-items: center; gap: 10px; }
.ap-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: #334155;
    cursor: pointer;
}
.ap-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #2563eb;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
    cursor: pointer;
}
.ap-slider:focus-visible { outline: 2px solid #60a5fa; border-radius: 2px; }
.ap-slider-val { font-size: 12px; font-weight: 700; color: #60a5fa; min-width: 36px; text-align: right; }

/* Reset */
.ap-reset {
    width: 100%;
    padding: 9px;
    border: 1px dashed #334155;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all .15s;
}
.ap-reset:hover { border-color: #ef4444; color: #f87171; background: rgba(239,68,68,.08); }

/* ═══ TRYBY — klasy na <html> ═══ */

/* Rozmiar tekstu */
html[data-a11y-font="1"] body { font-size: 112% !important; }
html[data-a11y-font="2"] body { font-size: 125% !important; }
html[data-a11y-font="3"] body { font-size: 145% !important; }

/* Odstępy (WCAG 1.4.12) */
html.a11y-spacing *:not(#a11y-panel):not(#a11y-panel *):not(#a11y-fab) {
    letter-spacing: .12em !important;
    word-spacing: .16em !important;
    line-height: 1.8 !important;
}

/* Kontrast ciemny */
html.a11y-contrast-dark body { background: #000 !important; color: #fff !important; }
html.a11y-contrast-dark *:not(#a11y-panel):not(#a11y-panel *):not(#a11y-fab):not(#a11y-fab *) {
    background-color: #000 !important; color: #fff !important; border-color: #fff !important;
}
html.a11y-contrast-dark a { color: #ffff00 !important; text-decoration: underline !important; }
html.a11y-contrast-dark img { filter: contrast(1.2) brightness(0.9); }

/* Kontrast jasny */
html.a11y-contrast-light *:not(#a11y-panel):not(#a11y-panel *):not(#a11y-fab):not(#a11y-fab *) {
    background-color: #fff !important; color: #000 !important; border-color: #000 !important;
}
html.a11y-contrast-light a { color: #0000cc !important; text-decoration: underline !important; }

/* Odwrócone kolory */
html.a11y-invert body { filter: invert(1) hue-rotate(180deg); }
html.a11y-invert img, html.a11y-invert video { filter: invert(1) hue-rotate(180deg); }

/* Skala szarości */
html.a11y-grayscale body { filter: grayscale(100%); }

/* Bez animacji (WCAG 2.3.3) */
html.a11y-no-motion *:not(#a11y-panel):not(#a11y-panel *)::before,
html.a11y-no-motion *:not(#a11y-panel):not(#a11y-panel *)::after,
html.a11y-no-motion *:not(#a11y-panel):not(#a11y-panel *) {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
}

/* Podkreślenie linków */
html.a11y-underline-links a { text-decoration: underline !important; text-underline-offset: 3px !important; }

/* Tryb czytelny — dysleksja */
html.a11y-readable *:not(#a11y-panel):not(#a11y-panel *) {
    font-family: 'Comic Sans MS', 'Verdana', sans-serif !important;
    letter-spacing: .05em !important; word-spacing: .1em !important;
}
html.a11y-readable p, html.a11y-readable li { line-height: 2 !important; }

/* Widoczny fokus */
html.a11y-focus-visible *:focus { outline: 3px solid #2563eb !important; outline-offset: 3px !important; }

/* Duży kursor */
html.a11y-big-cursor, html.a11y-big-cursor * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='2' d='M8 2L8 26L14 20L19 30L22 29L17 19L25 19Z'/%3E%3C/svg%3E") 0 0, auto !important;
}

/* Dark mode front */
html.a11y-dark body { background: #0f172a !important; color: #e2e8f0 !important; }
html.a11y-dark a { color: #60a5fa !important; }
html.a11y-dark .card, html.a11y-dark header, html.a11y-dark footer, html.a11y-dark nav {
    background: #1e293b !important; border-color: #334155 !important; color: #e2e8f0 !important;
}

/* Responsywność panelu na małych ekranach */
@media (max-width: 360px) {
    #a11y-panel { width: calc(100vw - 48px); }
}
