/* =========================================================
   Acessibilidade (todas as páginas do blog)
   - painel "Acessibilidade" (botão fixo no canto inferior esquerdo)
   - tamanho do texto, alto contraste, links destacados, animações pausadas
   As preferências ficam no navegador (localStorage "a11y") e são aplicadas
   no <html> por js/preferencias.js, no <head>, antes de desenhar a página.
   Cores do escritório: grafite e dourado.
   ========================================================= */

/* ---------- tamanho do texto: conteúdo, topo do blog e rodapé ampliados por inteiro ---------- */
html.a11y-t1 :is(main, .ap-hero, .blog-nav, .rodape) { zoom: 1.125; }
html.a11y-t2 :is(main, .ap-hero, .blog-nav, .rodape) { zoom: 1.25; }
html.a11y-t3 :is(main, .ap-hero, .blog-nav, .rodape) { zoom: 1.375; }
html.a11y-t4 :is(main, .ap-hero, .blog-nav, .rodape) { zoom: 1.5; }

/* ---------- botão e painel ---------- */
.a11y-btn {
  position: fixed; left: 20px; bottom: 20px; z-index: 1200;
  display: grid; place-items: center; width: 52px; height: 52px;
  border: 2px solid var(--laranja, #FCB961); border-radius: 0;
  background: var(--grafite, #292929); color: var(--laranja, #FCB961);
  cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.a11y-btn svg { width: 30px; height: 30px; }
.a11y-btn:hover { background: #000; }
.a11y-btn:focus-visible { outline: 3px solid #202020; outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }

.a11y-painel {
  position: fixed; left: 20px; bottom: 84px; z-index: 1201;
  width: min(360px, calc(100vw - 40px));
  max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto;
  padding: 20px 20px 16px;
  border-top: 4px solid var(--laranja, #FCB961);
  background: #1c1c1c; color: #fff;
  font-family: 'Montserrat', system-ui, sans-serif; font-size: 1rem; line-height: 1.4;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.a11y-painel[hidden] { display: none; }
.a11y-painel h2 { margin: 0 0 4px; font: 700 1.375rem/1.25 "Source Serif 4", Georgia, serif; color: #fff; }
.a11y-painel > p { margin: 0 0 14px; font-size: 0.9375rem; color: #d6d6d6; }
.a11y-grupo { margin: 0 0 14px; padding: 0; border: 0; }
.a11y-grupo legend { margin-bottom: 8px; padding: 0; font-weight: 700; font-size: 1rem; color: #fff; }
.a11y-tamanho { display: flex; align-items: center; gap: 8px; }
.a11y-tamanho output { min-width: 64px; text-align: center; font-weight: 700; font-size: 1.0625rem; }
.a11y-painel button {
  min-height: 48px; border: 2px solid #6f6f6f; border-radius: 0;
  background: #262626; color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.a11y-painel button:hover { border-color: var(--laranja, #FCB961); }
.a11y-painel button:focus-visible { outline: 3px solid var(--laranja, #FCB961); outline-offset: 2px; }
.a11y-painel button:disabled { opacity: .45; cursor: not-allowed; }
.a11y-tamanho button { min-width: 56px; font-size: 1.125rem; }
.a11y-opcoes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.a11y-opcoes button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; }
.a11y-opcoes button::after { content: 'Desligado'; flex-shrink: 0; padding: 2px 10px; background: #3a3a3a; font-size: 0.8125rem; font-weight: 700; }
.a11y-opcoes button[aria-pressed="true"] { border-color: var(--laranja, #FCB961); }
.a11y-opcoes button[aria-pressed="true"]::after { content: 'Ligado'; background: var(--laranja, #FCB961); color: #000; }
.a11y-rodape { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.a11y-rodape button { flex: 1 1 140px; padding: 8px 12px; }
.a11y-dica { margin: 12px 0 0; font-size: 0.875rem; color: #cfcfcf; }
.a11y-dica a { color: var(--laranja, #FCB961); }

/* No celular e no tablet a barra de atalhos do site fica no pé da tela: o botão sobe. */
@media (max-width: 1239px) {
  .a11y-btn { left: 16px; bottom: 80px; width: 48px; height: 48px; }
  .a11y-painel { left: 12px; right: 12px; bottom: 136px; width: auto; max-height: calc(100dvh - 160px); }
}
@media (max-width: 599px) {
  .a11y-btn { bottom: 88px; }
  .a11y-painel { bottom: 144px; }
}

/* ---------- destacar links ---------- */
html.a11y-links a:not(.a11y-btn):not(.whatsapp-float):not(.topo__logo) { text-decoration: underline !important; text-underline-offset: 3px; text-decoration-thickness: 2px; }

/* ---------- pausar animações ---------- */
html.a11y-pausa *, html.a11y-pausa *::before, html.a11y-pausa *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important; scroll-behavior: auto !important;
}

/* ---------- alto contraste: fundo preto, texto branco, links amarelos ---------- */
html.a11y-contraste { color-scheme: dark; }
html.a11y-contraste body,
html.a11y-contraste body :where(header, nav, main, section, article, aside, footer, div, p, span, li, ul, ol, dl, dt, dd, h1, h2, h3, h4, h5, h6, small, strong, b, em, address, label, legend, fieldset, form, figure, figcaption, blockquote, table, th, td, button, input, select, textarea, time, mark, details, summary) {
  background-color: #000 !important; background-image: none !important;
  color: #fff !important; -webkit-text-fill-color: #fff !important;
  text-shadow: none !important; box-shadow: none !important; border-color: #fff !important;
}
html.a11y-contraste body a, html.a11y-contraste body a * { color: #ffeb3b !important; -webkit-text-fill-color: #ffeb3b !important; background-image: none !important; }
html.a11y-contraste body a:not(.whatsapp-float):not(.topo__logo) { text-decoration: underline !important; }
html.a11y-contraste :focus-visible { outline: 3px solid #ffeb3b !important; }
html.a11y-contraste .ap-hero__fundo, html.a11y-contraste .ap-faixa__fundo { display: none !important; }
html.a11y-contraste .a11y-btn { background: #000 !important; border-color: #ffeb3b !important; }
html.a11y-contraste .a11y-opcoes button[aria-pressed="true"]::after { background: #ffeb3b !important; color: #000 !important; -webkit-text-fill-color: #000 !important; }

/* aviso "(abre em nova aba)" só para leitor de tela */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
