.filtros_svg {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

:root[data-daltonismo] { filter: url(#filtro-daltonismo); }

.a11y {
    position: relative;
}

.a11y_painel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--bg-card);
    color: var(--texto);
    border: 1px solid var(--borda);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
    font-family: 'Inter', sans-serif;
    z-index: 200;
}

.a11y_painel[hidden] {
    display: none;
}

.a11y_titulo {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.a11y_secao {
    margin-bottom: 1.1rem;
}

.a11y_grupo {
    border: none;
    padding: 0;
    min-width: 0;
}

.a11y_rotulo {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--texto-suave);
    margin-bottom: 0.6rem;
    padding: 0;
}

.a11y_fonte {
    display: flex;
    align-items: center;
    gap: 8px;
}

.a11y_btn {
    flex: 1;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--texto);
    background: var(--bg-input);
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: 9px 0;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.a11y_btn--mais {
    font-size: 1.1rem;
}

.a11y_btn:hover:not(:disabled) {
    border-color: var(--laranja);
}

.a11y_btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.a11y_fonte_valor {
    min-width: 3.5rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.a11y_opcao {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.a11y_opcao:hover {
    background: var(--hover-bg);
}

.a11y_opcao:has(input:checked) {
    border-color: var(--laranja);
    background: rgba(232,96,28,0.08);
}

.a11y_opcao input {
    margin-top: 3px;
    accent-color: var(--laranja);
    flex-shrink: 0;
}

.a11y_opcao_texto {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.a11y_opcao_texto strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.a11y_opcao_texto small {
    font-size: 0.78rem;
    color: var(--texto-suave);
    line-height: 1.4;
}

.a11y_restaurar {
    width: 100%;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--texto-suave);
    background: transparent;
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: 9px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.a11y_restaurar:hover {
    color: var(--texto);
    border-color: var(--texto-suave);
}

.a11y_painel input:focus-visible,
.a11y_btn:focus-visible,
.a11y_restaurar:focus-visible {
    outline: 2px solid var(--laranja);
    outline-offset: 2px;
}

/* No modo compacto o painel ocupa a largura da tela, em vez de ficar preso ao botão */
header.compacto .a11y { position: static; }

header.compacto .a11y_painel {
    position: fixed;
    top: 76px;
    left: 1rem;
    right: 1rem;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 92px);
}

/* ---------- Leitura: fonte para dislexia ---------- */

html[data-fonte="dislexia"] body *:not([vw]):not([vw] *) {
    font-family: 'Lexend', 'Inter', sans-serif !important;
}

/* A Lexend é mais larga que a Inter: o negrito pesado dos títulos fica mais leve para não estourar as linhas. */
html[data-fonte="dislexia"] h1,
html[data-fonte="dislexia"] h2,
html[data-fonte="dislexia"] h3 {
    font-weight: 700 !important;
}

/* ---------- Leitura: espaçamento ampliado (WCAG 1.4.12) ---------- */

html[data-espaco="amplo"] body *:not([vw]):not([vw] *) {
    letter-spacing: 0.06em !important;
    word-spacing: 0.14em !important;
}

html[data-espaco="amplo"] body :is(p, li, td, th, dd, dt, label, small, legend, output, blockquote, span):not(.logo_text):not(.hero_eyebrow) {
    line-height: 1.85 !important;
}

html[data-espaco="amplo"] body :is(h1, h2, h3, h4) {
    line-height: 1.4 !important;
}

html[data-espaco="amplo"] body :is(p, li) {
    margin-bottom: 0.4em;
}

/* Marcador visual do tipo "interruptor" no painel */
.a11y_opcao--chave input { width: 18px; height: 18px; }
