/* ==========================================================================
   Acessibilidade: faixa no topo, painel lateral e os modos de leitura.
   Os modos são classes no <html> (a11y-*), ligadas pelo acessibilidade.js.
   ========================================================================== */

/* ---------- Faixa no topo ---------- */
.barra-acess {
  position: relative;
  z-index: 101;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 13px;
  letter-spacing: -0.01em;
}
.barra-acess__in { display: flex; align-items: center; gap: 20px; min-height: 36px; }
.barra-acess__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px 0 8px;
  border: 0;
  border-radius: 980px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--tinta);
  cursor: pointer;
  transition: background-color 0.2s;
}
.barra-acess__btn:hover, .barra-acess__btn[aria-expanded="true"] { background: var(--bg-3); }
.barra-acess__btn .icone { width: 17px; height: 17px; color: var(--azul); }
.barra-acess a { display: inline-flex; align-items: center; min-height: 28px; color: var(--tinta-2); }
.barra-acess a:hover { color: var(--tinta); text-decoration: underline; }
.barra-acess__atalhos { display: flex; gap: 16px; margin-left: auto; color: var(--tinta-2); }
.barra-acess kbd {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--linha);
  font: 600 12px/18px var(--fonte);
  color: var(--tinta);
}
@media (max-width: 760px) {
  .barra-acess .barra-acess__atalhos, .barra-acess .barra-acess__pular { display: none; }
}

/* ---------- Painel lateral ---------- */
.acess[hidden] { display: none; }
/* o botão do VLibras não fica por cima do painel aberto */
html.acess-aberto [vw], html.menu-aberto [vw] { display: none !important; }
.acess { position: fixed; inset: 0; z-index: 400; }
.acess__fundo {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: acess-aparece 0.3s ease both;
}
.acess__painel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--tinta);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.25);
  border-radius: 0 28px 28px 0;
  animation: acess-entra 0.45s cubic-bezier(0.28, 0.11, 0.32, 1) both;
  overflow: hidden;
}
@keyframes acess-aparece { from { opacity: 0; } }
@keyframes acess-entra { from { transform: translateX(-100%); } }

.acess__topo { display: flex; align-items: flex-start; gap: 12px; padding: 24px 22px 18px; border-bottom: 1px solid var(--linha-suave); }
.acess__topo h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.acess__topo h2 .icone { width: 26px; height: 26px; color: var(--azul); }
.acess__topo p { margin-top: 6px; font-size: 14px; line-height: 1.43; color: var(--tinta-2); }
.acess__fechar {
  flex: none;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-3);
  color: var(--tinta);
  cursor: pointer;
}
.acess__fechar .icone { width: 16px; height: 16px; }

.acess__rolagem { flex: 1; overflow-y: auto; padding: 8px 18px 24px; overscroll-behavior: contain; }
.acess__secao { margin-top: 22px; }
.acess__secao > h3 { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--tinta-2); }
.acess__secao > h3 .icone { width: 16px; height: 16px; }

/* grupos no estilo "Ajustes" do iPhone */
.acess__grupo { border-radius: 18px; background: var(--bg-2); overflow: hidden; }
.acess__grupo + .acess__grupo { margin-top: 12px; }
.acess__linha {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  font-size: 16px;
  text-align: left;
  color: var(--tinta);
  cursor: pointer;
}
.acess__linha + .acess__linha { box-shadow: inset 0 1px 0 var(--linha-suave); }
.acess__linha > .icone { width: 20px; height: 20px; color: var(--tinta-2); flex: none; }
.acess__linha span { flex: 1; }
.acess__linha:focus-visible { outline: 2px solid var(--azul); outline-offset: -2px; border-radius: 12px; }

/* chave liga/desliga */
.chave {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 28px;
  background: #d1d1d6;
  transition: background-color 0.25s;
}
.chave::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.28, 0.11, 0.32, 1);
}
[aria-checked="true"] > .chave { background: var(--azul); }
[aria-checked="true"] > .chave::after { transform: translateX(18px); }

.acess__bloco { padding: 16px; }
.acess__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 16px; }
.acess__valor { min-width: 52px; padding: 3px 8px; border-radius: 8px; background: var(--bg); text-align: center; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.acess__regua { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.acess__regua input[type="range"] { flex: 1; accent-color: var(--azul); height: 28px; }
.acess__mini {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--linha-suave);
  font-size: 20px;
  line-height: 1;
  color: var(--tinta);
  cursor: pointer;
}
.acess__mini:disabled { opacity: 0.4; cursor: default; }

.acess__leitor { display: flex; flex-wrap: wrap; gap: 8px; }
.acess__leitor .btn { min-height: 38px; padding: 0 14px; font-size: 15px; }
.acess__leitor .btn .icone { width: 15px; height: 15px; }
.acess__aviso { margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--tinta-2); }

.acess__libras { display: flex; gap: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.45; color: var(--tinta-2); }
.acess__libras .icone { flex: none; width: 22px; height: 22px; color: var(--azul); margin-top: 1px; }

.acess__rodape { padding: 14px 18px 18px; border-top: 1px solid var(--linha-suave); }
.acess__rodape .btn { width: 100%; min-height: 44px; }

/* ---------- Mini controle do leitor (aparece com o painel fechado) ---------- */
.leitor-mini {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  border-radius: 980px;
  background: rgba(29, 29, 31, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 14px;
  transform: translateX(-50%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.leitor-mini[hidden] { display: none; }
.leitor-mini button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}
.leitor-mini button .icone { width: 14px; height: 14px; }
.lendo { background: rgba(255, 214, 10, 0.32) !important; box-shadow: 0 0 0 6px rgba(255, 214, 10, 0.32); border-radius: 6px; }

/* ---------- Guia de leitura ---------- */
.guia-leitura {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 350;
  height: 52px;
  pointer-events: none;
  background: rgba(255, 214, 10, 0.14);
  border-top: 2px solid #f5b800;
  border-bottom: 2px solid #f5b800;
  transform: translateY(-200px);
}
.guia-leitura[hidden] { display: none; }

/* ==========================================================================
   Modos
   ========================================================================== */

/* Texto maior: sem junção de palavras para nada vazar (o site.js refaz ao voltar a 100%) */
html.a11y-texto .nowrap { white-space: normal; }

/* Alto contraste */
html.a11y-contraste {
  --bg: #000;
  --bg-2: #0d0d0d;
  --bg-3: #1c1c1c;
  --tinta: #fff;
  --tinta-2: #f2f2f2;
  --tinta-3: #d6d6d6;
  --linha: #9a9a9a;
  --linha-suave: #5c5c5c;
  --azul: #ffd60a;
  --azul-link: #ffd60a;
}
html.a11y-contraste body { background: #000; color: #fff; }
html.a11y-contraste .topo { background: #000; border-bottom-color: #fff; }
html.a11y-contraste .topo__marca img,
html.a11y-contraste .rodape__topo img { background: #fff; padding: 3px 6px; border-radius: 6px; }
html.a11y-contraste .barra-acess { background: #000; border-bottom-color: #fff; }
html.a11y-contraste :is(.btn--azul, .btn--roxo) { background: #ffd60a; color: #000; }
html.a11y-contraste .btn--contorno { color: #ffd60a; border-color: #ffd60a; }
html.a11y-contraste .btn--whats { outline: 2px solid #fff; }
html.a11y-contraste .vidro-azul { background: #000; box-shadow: inset 0 0 0 2px #fff; }
html.a11y-contraste .vidro-azul__orbes { display: none; }
html.a11y-contraste .num { background: #000; border: 2px solid #fff; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.a11y-contraste .num::before { display: none; }
html.a11y-contraste .num p { color: #fff; }
html.a11y-contraste .num__barra i { background: #ffd60a; }
html.a11y-contraste .bloco__grande { background: none; color: #fff; }
html.a11y-contraste :is(.nota, .bloco, .leis, .doc, .mes, .destaque, .pessoa, .vereador, .cadastro, .chamada, .cartao, .hero-box__info, .vazio, .bio__nota, .bio__lista) { border: 2px solid #fff; }
html.a11y-contraste .filtro[aria-pressed="true"] { background: #ffd60a; color: #000; }
html.a11y-contraste .redes a:hover { background: #ffd60a; color: #000; }
html.a11y-contraste .aviso { background: #000; box-shadow: 0 0 0 2px #fff; }
html.a11y-contraste .chave { background: #555; }
html.a11y-contraste :focus-visible { outline-color: #ffd60a; }

/* Escala de cinza (o painel fica de fora) */
html.a11y-cinza :is(.barra-acess, .topo, main, .rodape) { filter: grayscale(1); }

/* Destacar links */
html.a11y-links a:not(.btn):not(.bloco):not(.lei):not(.doc):not(.mes):not(.post):not(.destaque):not(.topo__marca) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px;
  background: #fff3a3;
  color: #000 !important;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #fff3a3;
}
html.a11y-links :is(.btn, a.bloco, a.lei, a.doc, a.mes, a.post, a.destaque) { outline: 3px solid #f5b800 !important; outline-offset: 3px; }

/* Reduzir movimentos */
html.a11y-movimento *,
html.a11y-movimento *::before,
html.a11y-movimento *::after { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
html.a11y-movimento .js [data-revela],
html.a11y-movimento [data-revela] { opacity: 1 !important; transform: none !important; }
html.a11y-movimento .mca-palco { height: auto; }
html.a11y-movimento .mca-fixo { position: relative; top: 0; height: auto; gap: 32px; }
html.a11y-movimento .mca-legendas p { opacity: 1; transform: none; }
html.a11y-movimento .mca-legendas p:not(:first-child) { display: none; }
html.a11y-movimento .mca-cta { opacity: 1; transform: none; }

/* Mais espaçamento (WCAG 1.4.12) */
html.a11y-espaco :is(p, li, h1, h2, h3, h4, a, span, label, summary, time, button, strong) { letter-spacing: 0.06em !important; word-spacing: 0.16em !important; }
html.a11y-espaco :is(p, li) { line-height: 1.9 !important; }
html.a11y-espaco :is(h1, h2, h3, h4, .display, .titulo) { line-height: 1.3 !important; }
html.a11y-espaco .nowrap { white-space: normal; }

/* Fonte legível */
html.a11y-fonte body,
html.a11y-fonte body :is(p, li, h1, h2, h3, h4, a, span, label, summary, time, button, strong, input, small, b, em, kbd) {
  font-family: "Atkinson Hyperlegible", Verdana, Tahoma, sans-serif !important;
}
