
/* ==========================================
   CENTRAL DE ACESSIBILIDADE GLOBAL
   PROJETO PRAÇA PARA TODOS
========================================== */

/* ==========================================
   BOTÃO LATERAL
========================================== */

.a11y-barra,
#a11y-barra {
    position: fixed;
    right: 0;
    top: 42%;
    left: auto;
    bottom: auto;
    z-index: 9998;

    display: flex;
    flex-direction: column;

    width: auto;
    height: auto;
}

.a11y-atalho,
#a11y-abrir {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;

    width: 48px;
    height: 48px;
    padding: 12px;

    overflow: hidden;
    align-self: flex-end;
    white-space: nowrap;

    border: 0;
    border-radius: 10px 0 0 10px;

    background-color: #3A1F5D;
    color: #FFFFFF;

    font: 600 13px Montserrat, sans-serif;
    cursor: pointer;

    transition:
        width 0.2s ease,
        background-color 0.2s ease;
}

.a11y-atalho:hover,
.a11y-atalho:focus-visible,
#a11y-abrir:hover,
#a11y-abrir:focus-visible {
    width: 190px;
    background-color: #6A3FB2;
}

.a11y-atalho svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.a11y-atalho:focus-visible,
.a11y-painel button:focus-visible,
.a11y-painel input:focus-visible {
    outline: 3px solid #3A1F5D;
    outline-offset: 2px;
}

/* No cabeçalho escuro, o contorno claro mantém contraste de 4,78:1. */
.a11y-painel .a11y-fechar:focus-visible {
    outline-color: #A78BD9;
}

.a11y-atalho:focus-visible {
    box-shadow: 0 0 0 2px #FFFFFF;
}

/* ==========================================
   FUNDO ESCURO DO MODAL
========================================== */

.a11y-fundo {
    position: fixed;
    inset: 0;
    z-index: 9999;

    background-color: rgb(0 0 0 / 55%);
}

.a11y-fundo[hidden],
.a11y-painel[hidden] {
    display: none !important;
}

/* ==========================================
   PAINEL DE RECURSOS ASSISTIVOS
========================================== */

.a11y-painel,
#a11y-painel {
    position: fixed;
    z-index: 10000;

    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;

    transform: translate(-50%, -50%);

    width: min(94vw, 660px);
    max-height: 90dvh;

    overflow-y: auto;

    border-radius: 18px;
    background-color: #FFFFFF;
    color: #1E1B2E;

    box-shadow: 0 20px 60px rgb(0 0 0 / 25%);

    font-family: Montserrat, sans-serif;
    line-height: 1.5;
}

/* ==========================================
   CABEÇALHO DO PAINEL
========================================== */

.a11y-topo {
    position: sticky;
    top: 0;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    padding: 20px 24px;

    background-color: #3A1F5D;
    color: #FFFFFF;
}

.a11y-topo h2 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1.3rem;
}

.a11y-fechar {
    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;
    flex-shrink: 0;

    border: 1px solid rgb(255 255 255 / 40%);
    border-radius: 10px;

    background-color: transparent;
    color: #FFFFFF;

    cursor: pointer;
}

.a11y-fechar:hover {
    background-color: rgb(255 255 255 / 15%);
}

.a11y-fechar svg {
    width: 22px;
    height: 22px;
}

/* ==========================================
   CONTEÚDO DO PAINEL
========================================== */

.a11y-conteudo {
    padding: 24px;
}

.a11y-grupo {
    margin-bottom: 24px;
}

.a11y-grupo h3 {
    margin: 0 0 12px;
    color: #3A1F5D;
    font-size: 1rem;
}

/* ==========================================
   GRADE DE FERRAMENTAS
========================================== */

.a11y-grade {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.a11y-opcao {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 105px;
    padding: 12px;

    border: 2px solid #E8DDF5;
    border-radius: 12px;

    background-color: #F0EEFB;
    color: #3A1F5D;

    font: 600 12px Montserrat, sans-serif;
    text-align: center;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.a11y-opcao:hover {
    border-color: #6A3FB2;
    background-color: #E8DDF5;
}

.a11y-opcao[aria-pressed="true"] {
    border-color: #6A3FB2;
    background-color: #E0D1FA;
}

.a11y-opcao svg {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
}

/* ==========================================
   LEITOR DE TEXTO
========================================== */

.a11y-grupo-leitor {
    border-top: 1px solid #E8DDF5;
    padding-top: 22px;
}

.a11y-leitor-descricao {
    margin: 0 0 16px;
    color: #514B60;
    font-size: 13px;
    line-height: 1.6;
}

.a11y-leitor-controles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.a11y-leitor-botao {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 88px;
    padding: 12px 8px;

    border: 2px solid #E8DDF5;
    border-radius: 12px;

    background-color: #F0EEFB;
    color: #3A1F5D;

    font: 600 12px Montserrat, sans-serif;
    text-align: center;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.a11y-leitor-botao svg {
    width: 23px;
    height: 23px;
    flex-shrink: 0;
}

.a11y-leitor-botao:hover:not(:disabled) {
    background-color: #E8DDF5;
    border-color: #6A3FB2;
}

.a11y-leitor-botao:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ==========================================
   VELOCIDADE DA LEITURA
========================================== */

.a11y-leitor-velocidade {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin-bottom: 10px;

    color: #3A1F5D;
    font: 600 13px Montserrat, sans-serif;
}

#a11y-velocidade {
    display: block;
    width: 100%;
    margin: 0 0 14px;

    accent-color: #6A3FB2;
    cursor: pointer;
}

/* Em computadores, reproduz a trilha preenchida e o botão redondo do celular. */
@media (hover: hover) and (pointer: fine) {
    #a11y-velocidade {
        --a11y-velocidade-cor: #6A3FB2;
        --a11y-velocidade-trilha: #EDEBF0;
        --a11y-velocidade-borda: #76717F;
        --a11y-velocidade-fundo: linear-gradient(
            to right,
            var(--a11y-velocidade-cor) var(--a11y-velocidade-progresso),
            var(--a11y-velocidade-trilha) var(--a11y-velocidade-progresso)
        );

        appearance: none;
        height: 24px;
        padding: 0;
        background: transparent;
    }

    #a11y-velocidade::-webkit-slider-runnable-track {
        height: 8px;
        border: 1px solid var(--a11y-velocidade-borda);
        border-radius: 999px;
        background: var(--a11y-velocidade-fundo);
    }

    #a11y-velocidade::-webkit-slider-thumb {
        appearance: none;
        width: 18px;
        height: 18px;
        margin-top: -6px;
        border: 0;
        border-radius: 50%;
        background-color: var(--a11y-velocidade-cor);
    }

    #a11y-velocidade::-moz-range-track {
        box-sizing: border-box;
        height: 8px;
        border: 1px solid var(--a11y-velocidade-borda);
        border-radius: 999px;
        background: var(--a11y-velocidade-fundo);
    }

    #a11y-velocidade::-moz-range-thumb {
        width: 18px;
        height: 18px;
        border: 0;
        border-radius: 50%;
        background-color: var(--a11y-velocidade-cor);
    }
}

@media (hover: hover) and (pointer: fine) and (forced-colors: active) {
    #a11y-velocidade {
        --a11y-velocidade-cor: Highlight;
        --a11y-velocidade-trilha: Canvas;
        --a11y-velocidade-borda: CanvasText;
        forced-color-adjust: none;
    }

    #a11y-velocidade:focus-visible {
        outline-color: Highlight;
    }
}

/* ==========================================
   STATUS DO LEITOR
========================================== */

.a11y-leitor-status {
    margin: 0;
    padding: 10px 12px;

    border-radius: 8px;
    background-color: #F0EEFB;

    color: #514B60;
    font: 500 12px Montserrat, sans-serif;
    line-height: 1.5;
}

/* ==========================================
   RESTAURAR CONFIGURAÇÕES
========================================== */

.a11y-restaurar {
    width: 100%;
    padding: 13px;

    border: 0;
    border-radius: 10px;

    background-color: #3A1F5D;
    color: #FFFFFF;

    font: 600 14px Montserrat, sans-serif;

    cursor: pointer;

    transition: background-color 0.2s ease;
}

.a11y-restaurar:hover {
    background-color: #6A3FB2;
}

/* ==========================================
   ALTO CONTRASTE
========================================== */

html.a11y-contraste {
    --contraste-fundo: #000000;
    --contraste-texto: #FFFFFF;
    --contraste-link: #FFFF00;
    --contraste-borda: #FFFFFF;
    --contraste-foco: #00FFFF;
}

/* Fundo principal */

html.a11y-contraste body {
    background-color: var(--contraste-fundo) !important;
    color: var(--contraste-texto) !important;
}

/* Áreas estruturais */

html.a11y-contraste body :is(
    header,
    main,
    footer,
    nav,
    section,
    article,
    aside
):not(.a11y-painel):not(.a11y-barra) {
    background-color: var(--contraste-fundo) !important;
    background-image: none !important;
    color: var(--contraste-texto) !important;
    border-color: var(--contraste-borda) !important;
}

/* Elementos de conteúdo */

html.a11y-contraste body :is(
    div,
    figure,
    figcaption,
    blockquote,
    details,
    summary
):not(.a11y-painel)
 :not(.a11y-barra)
 :not(.a11y-fundo)
 :not(.a11y-cursor-destaque)
 :not([vw])
 :not([id^="vlibras"]) {
    background-color: transparent;
    border-color: var(--contraste-borda);
}

/* Textos do site */

html.a11y-contraste body :is(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    li,
    span,
    strong,
    small,
    label,
    blockquote
):not(.a11y-painel *) {
    color: var(--contraste-texto) !important;
    text-shadow: none !important;
}

/* Links */

html.a11y-contraste body a {
    color: var(--contraste-link) !important;
    text-decoration: underline !important;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

html.a11y-contraste body a:hover {
    color: #00FFFF !important;
}

/* Botões do site */

html.a11y-contraste body button:not(
    .a11y-atalho,
    .a11y-opcao,
    .a11y-fechar,
    .a11y-restaurar,
    .a11y-leitor-botao
) {
    background-color: #000000 !important;
    background-image: none !important;
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF !important;
}

/* Formulários */

html.a11y-contraste body :is(
    input,
    textarea,
    select
):not(#a11y-velocidade) {
    background-color: #000000 !important;
    color: #FFFFFF !important;
    border: 2px solid #FFFFFF !important;
}

html.a11y-contraste body input::placeholder,
html.a11y-contraste body textarea::placeholder {
    color: #CCCCCC !important;
    opacity: 1;
}

/* Foco de teclado */

html.a11y-contraste body :is(
    a,
    button,
    input,
    select,
    textarea,
    summary,
    [tabindex]
):focus-visible {
    outline: 3px solid var(--contraste-foco) !important;
    outline-offset: 3px !important;
}

/* Ícones do site */

html.a11y-contraste body svg:not(
    .a11y-painel svg,
    .a11y-barra svg
) {
    color: #FFFFFF;
}

/* ==========================================
   PRESERVAR CENTRAL DE ACESSIBILIDADE
   NO MODO ALTO CONTRASTE
========================================== */

html.a11y-contraste .a11y-painel {
    background-color: #FFFFFF !important;
    color: #1E1B2E !important;
}

html.a11y-contraste .a11y-topo {
    background-color: #3A1F5D !important;
}

html.a11y-contraste .a11y-topo h2,
html.a11y-contraste .a11y-fechar {
    color: #FFFFFF !important;
}

html.a11y-contraste .a11y-grupo h3,
html.a11y-contraste .a11y-opcao,
html.a11y-contraste .a11y-opcao span {
    color: #3A1F5D !important;
}

html.a11y-contraste .a11y-opcao {
    background-color: #F0EEFB !important;
}

html.a11y-contraste .a11y-opcao[aria-pressed="true"] {
    background-color: #E0D1FA !important;
}

html.a11y-contraste .a11y-atalho,
html.a11y-contraste .a11y-restaurar {
    background-color: #3A1F5D !important;
    color: #FFFFFF !important;
}

html.a11y-contraste .a11y-restaurar {
    border: 0 !important;
}

/* Preservar leitor de texto */

html.a11y-contraste .a11y-grupo-leitor {
    border-color: #E8DDF5 !important;
}

html.a11y-contraste .a11y-leitor-botao {
    background-color: #F0EEFB !important;
    color: #3A1F5D !important;
    border-color: #E8DDF5 !important;
}

html.a11y-contraste .a11y-leitor-botao span,
html.a11y-contraste .a11y-leitor-velocidade,
html.a11y-contraste .a11y-leitor-descricao,
html.a11y-contraste .a11y-leitor-status {
    color: #3A1F5D !important;
}

html.a11y-contraste .a11y-leitor-status {
    background-color: #F0EEFB !important;
}

html.a11y-contraste .a11y-leitor-botao:disabled {
    opacity: 0.45;
}

/* ==========================================
   DESTACAR LINKS
========================================== */

html.a11y-links body a {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 4px !important;
}

/* ==========================================
   OCULTAR IMAGENS
========================================== */

html.a11y-sem-imagens body img:not(.a11y-preservar) {
    visibility: hidden !important;
}

/* ==========================================
   PAUSAR ANIMAÇÕES
========================================== */

html.a11y-sem-animacoes body *,
html.a11y-sem-animacoes body *::before,
html.a11y-sem-animacoes body *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

/* ==========================================
   CURSOR DESTACADO
========================================== */

html.a11y-cursor body {
    cursor: auto !important;
}

html.a11y-cursor body a,
html.a11y-cursor body button,
html.a11y-cursor body select {
    cursor: pointer !important;
}

.a11y-cursor-destaque {
    position: fixed;
    top: 0;
    left: 0;

    width: 38px;
    height: 38px;

    border: 3px solid #FFBF00;
    border-radius: 50%;

    background-color: rgb(255 191 0 / 12%);

    box-shadow:
        0 0 0 2px rgb(0 0 0 / 65%);

    pointer-events: none;

    z-index: 2147483647;

    transform: translate(-50%, -50%);
    visibility: hidden;
}

html.a11y-cursor .a11y-cursor-destaque {
    visibility: visible;
}

@media (hover: none), (pointer: coarse) {
    .a11y-cursor-destaque {
        display: none !important;
    }
}

/* ==========================================
   BLOQUEAR ROLAGEM COM MODAL ABERTO
========================================== */

body.a11y-modal-aberto {
    overflow: hidden;
}

/* ==========================================
   ESPAÇAMENTO ENTRE LINHAS
========================================== */

html[style*="--a11y-altura-linha"] body :is(
    p,
    li,
    blockquote
):not(.a11y-painel *) {
    line-height: var(--a11y-altura-linha) !important;
}

/* ==========================================
   PRESERVAR ESPAÇAMENTO DO PAINEL
========================================== */

.a11y-painel,
.a11y-barra {
    letter-spacing: normal;
}

/* ==========================================
   VLIBRAS - CANTO INFERIOR DIREITO
========================================== */

#vlibras-access-wrapper {
    position: fixed !important;
    inset: auto 20px 20px auto !important;
    margin: 0 !important;
    z-index: 9997 !important;
}

div[vw].enabled {
    z-index: 9996 !important;
}

/* ==========================================
   RESPONSIVIDADE
========================================== */

@media (max-width: 600px) {

    .a11y-barra {
        top: 42%;
        bottom: auto;
    }

    .a11y-painel {
        width: 94vw;
        max-height: 85dvh;
    }

    .a11y-topo,
    .a11y-conteudo {
        padding: 16px;
    }

    .a11y-grade {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .a11y-leitor-controles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .a11y-leitor-botao {
        min-height: 85px;
    }

    #vlibras-access-wrapper {
        inset: auto 12px 12px auto !important;
    }
}

/* ==========================================
   REDUÇÃO DE MOVIMENTO
========================================== */

@media (prefers-reduced-motion: reduce) {

    .a11y-atalho,
    .a11y-opcao,
    .a11y-restaurar,
    .a11y-leitor-botao {
        transition: none;
    }
}

/* ==========================================
   GARANTIA DE POSICIONAMENTO
   DA CENTRAL DE ACESSIBILIDADE
========================================== */

body > #a11y-barra {
    position: fixed !important;
    top: 42% !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 9998 !important;
}

body > .a11y-fundo {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
}

body > #a11y-painel {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;

    transform: translate(-50%, -50%) !important;
    z-index: 10000 !important;
}

body > #a11y-painel[hidden],
body > .a11y-fundo[hidden] {
    display: none !important;
}


/* ==========================================
   CONTROLE FLUTUANTE DO LEITOR
   PROJETO PRAÇA PARA TODOS
========================================== */

.a11y-leitor-flutuante {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 9995;

    width: min(340px, calc(100vw - 48px));
    padding: 16px;

    border: 1px solid #E8DDF5;
    border-radius: 16px;

    background-color: #FFFFFF;
    color: #3A1F5D;

    box-shadow: 0 8px 30px rgb(0 0 0 / 18%);

    font-family: Montserrat, sans-serif;
    letter-spacing: normal;
    line-height: 1.5;
}

.a11y-leitor-flutuante[hidden] {
    display: none !important;
}

/* Cabeçalho */

.a11y-flutuante-cabecalho {
    margin-bottom: 14px;
}

.a11y-flutuante-identificacao {
    display: flex;
    align-items: center;
    gap: 12px;
}

.a11y-flutuante-identificacao > svg {
    width: 25px;
    height: 25px;
    flex-shrink: 0;
    color: #6A3FB2;
}

.a11y-flutuante-identificacao > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.a11y-flutuante-identificacao strong {
    font-size: 14px;
    font-weight: 700;
    color: #3A1F5D;
}

.a11y-flutuante-identificacao span {
    color: #514B60;
    font-size: 12px;
}

/* Botões */

.a11y-flutuante-acoes {
    display: flex;
    gap: 10px;
}

.a11y-flutuante-acoes button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;

    min-height: 42px;
    padding: 10px 12px;

    border: 0;
    border-radius: 9px;

    background-color: #3A1F5D;
    color: #FFFFFF;

    font: 600 12px Montserrat, sans-serif;
    cursor: pointer;

    transition: background-color 0.2s ease;
}

.a11y-flutuante-acoes button:hover {
    background-color: #6A3FB2;
}

.a11y-flutuante-acoes button:focus-visible {
    outline: 3px solid #3A1F5D;
    outline-offset: 3px;
}

.a11y-flutuante-acoes button[hidden] {
    display: none !important;
}

.a11y-flutuante-acoes button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.a11y-flutuante-acoes .a11y-flutuante-parar {
    background-color: #F0EEFB;
    color: #3A1F5D;
}

.a11y-flutuante-acoes .a11y-flutuante-parar:hover {
    background-color: #E8DDF5;
}

/* Preservação no alto contraste */

html.a11y-contraste .a11y-leitor-flutuante {
    background-color: #FFFFFF !important;
    color: #3A1F5D !important;
    border-color: #E8DDF5 !important;
}

html.a11y-contraste
.a11y-leitor-flutuante
.a11y-flutuante-identificacao strong {
    color: #3A1F5D !important;
}

html.a11y-contraste
.a11y-leitor-flutuante
.a11y-flutuante-identificacao span {
    color: #514B60 !important;
}

html.a11y-contraste
.a11y-leitor-flutuante
.a11y-flutuante-acoes button {
    background-color: #3A1F5D !important;
    color: #FFFFFF !important;
    border: 0 !important;
}

html.a11y-contraste
.a11y-leitor-flutuante
.a11y-flutuante-acoes .a11y-flutuante-parar {
    background-color: #F0EEFB !important;
    color: #3A1F5D !important;
}

/* Responsividade */

@media (max-width: 600px) {
    .a11y-leitor-flutuante {
        left: 12px;
        bottom: 12px;

        width: min(320px, calc(100vw - 24px));
        padding: 14px;
    }

    .a11y-flutuante-acoes button {
        min-height: 44px;
    }
}

/* Redução de movimento */

@media (prefers-reduced-motion: reduce) {
    .a11y-flutuante-acoes button {
        transition: none;
    }
}
