/* =====================================================
   ACESSIBILIDADE — Baixe o Santo
   WCAG 2.1 AA · ARIA · Web Speech API
   ===================================================== */

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #C9A84C;
  color: #1a0a2e;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Raleway', sans-serif;
  z-index: 999999;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ── Screen reader only ── */
.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;
}

/* ── Focus visível — acessível e bonito ── */
:focus-visible {
  outline: 2px solid #C9A84C !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #C9A84C !important;
  outline-offset: 3px !important;
}

/* ── Barra de acessibilidade flutuante ── */
#barra-acess {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.barra-acess-btn {
  background: rgba(26,10,46,0.95);
  border: 1px solid rgba(201,168,76,0.4);
  border-right: none;
  color: rgba(255,255,255,0.85);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Raleway', sans-serif;
  border-radius: 8px 0 0 8px;
  position: relative;
}
.barra-acess-btn:hover,
.barra-acess-btn:focus-visible {
  background: rgba(201,168,76,0.15);
  border-color: rgba(201,168,76,0.7);
  color: #C9A84C;
}
.barra-acess-btn.ativo {
  background: rgba(201,168,76,0.2);
  border-color: #C9A84C;
  color: #C9A84C;
}
.barra-acess-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  right: 46px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(26,10,46,0.97);
  border: 1px solid rgba(201,168,76,0.3);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  pointer-events: none;
}

/* ── Alto contraste ── */
body.alto-contraste {
  filter: contrast(1.5) brightness(1.1);
}
body.alto-contraste * {
  text-shadow: none !important;
}

/* ── Fonte aumentada ── */
body.fonte-grande { font-size: 18px !important; }
body.fonte-grande p,
body.fonte-grande li,
body.fonte-grande label,
body.fonte-grande input,
body.fonte-grande textarea,
body.fonte-grande select { font-size: 18px !important; }

/* ── Leitura em andamento — destaque ── */
.lendo-agora {
  outline: 2px dashed #C9A84C !important;
  outline-offset: 4px;
  border-radius: 4px;
}

/* ── Anúncio para screen readers (aria-live) ── */
#leitor-anuncio {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Movimento reduzido ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Mobile: barra menor ── */
@media (max-width: 600px) {
  #barra-acess {
    top: auto;
    bottom: 80px;
    transform: none;
  }
  .barra-acess-btn { width: 36px; height: 36px; font-size: 14px; }
}
