/* ===============================
   Widget de Acessibilidade (ALEMA)
   =============================== */

/* Posição: canto direito, logo abaixo do header (offset via --acc-top) */
.acc-container{
  position: fixed;
  right: 16px;
  top: calc(var(--acc-top, 0px) + 8px);
  z-index: 99999;
  display: inline-flex;
  align-items: center;
}

/* Botão amarelo */
.acc-button{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: #ffc107;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .2s ease;
}
.acc-button:hover{ box-shadow: 0 4px 10px rgba(0,0,0,.25); transform: translateY(-1px); background: #e0a800;  }
.acc-button:focus{ outline: 3px solid #222; outline-offset: 2px; }
.acc-icon{ width:32px; height:32px; fill:#FFF; }

/* Painel que abre para a ESQUERDA do botão (desktop) */
.acc-menu{
  position: absolute;
  top: 0;
  right: calc(44px + 6px);
  min-width: 240px;
  background: #fff;
  border: 2px solid #ffb300;
  border-radius:6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 12px 0;
}

.acc-menu-header{ font-weight:700; font-size:16px; padding:6px 16px 10px; }
.acc-list{ list-style:none; margin:0; padding:0 8px 4px; }
.acc-list li{ margin:0; }
.acc-item,.acc-link{
  display:block; width:100%; text-align:left; background:transparent; border:0; font:inherit;
  padding:10px 14px; border-radius:4px; cursor:pointer; text-decoration:none; color:#111;
}
.acc-item:hover,.acc-link:hover{ background:#f5f5f5; }

/* Visually hidden */
.acc-sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

/* ===============================
   Contrastes
   =============================== */

/* Contraste normal: aumenta o contraste geral */
html.acc-contrast * {
  filter: contrast(120%);
}

/* Contraste negativo: fundo preto, texto amarelo */
html.acc-negative-contrast,
html.acc-negative-contrast body {
  background-color: #000 !important;
  color: #ff0 !important;
}

/* Aplica cores herdadas e bordas amarelas para todos os elementos */
html.acc-negative-contrast * {
  background-color: transparent !important;
  color: inherit !important;
  border-color: #ff0 !important;
}

/* Links */
html.acc-negative-contrast a,
html.acc-negative-contrast a:visited {
  color: #ff0 !important;
  text-decoration: underline !important;
}

/* Imagens invertidas para manter legibilidade */
html.acc-negative-contrast img {
  filter: invert(1) hue-rotate(180deg) !important;
}

/* Menu */
html.acc-negative-contrast .acc-menu {
  background-color: #000 !important;
  border-color: #ff0 !important;
}

/* Botão principal */
html.acc-negative-contrast .acc-button {
  background-color: #000 !important;
  border-color: #ff0 !important;
}

/* Ícone */
html.acc-negative-contrast .acc-icon {
  fill: #ff0 !important;
}

/* Hover de itens e links */
html.acc-negative-contrast .acc-item:hover,
html.acc-negative-contrast .acc-link:hover {
  background-color: #222 !important;
}

html.acc-negative-contrast .section--maisgalerias, html.acc-negative-contrast .section--maistv {
    background: #000 !important;
}

/* NÃO alterar o VLibras em nenhum modo */
html.acc-negative-contrast [vw],
html.acc-negative-contrast [vw] *,
html.acc-contrast [vw],
html.acc-contrast [vw] * {
  background-color: revert !important;
  color: revert !important;
  border-color: revert !important;
  filter: none !important;
}

/* ===============================
   Responsivo (mobile-first)
   =============================== */
@media (max-width: 768px){
  .acc-container{ right: 12px; }

  .acc-menu{
    position: absolute;
    top: calc(44px + 12px);
    right: 0;
    left: auto;
    min-width: 220px;
    max-width: min(340px, 92vw);
    max-height: calc(100vh - (var(--acc-top, 0px) + 56px));
    max-height: calc(100dvh - (var(--acc-top, 0px) + 56px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
    border-radius: 8px;
    padding-bottom: 8px;
  }

  .acc-item, .acc-link{ padding: 14px 16px; }
  .acc-menu-header{ font-size: 15px; }
}

@media (max-width: 380px){
  .acc-menu{ max-width: 92vw; }
}

/* Barra de rolagem mais discreta */
.acc-menu::-webkit-scrollbar{ width: 8px; }
.acc-menu::-webkit-scrollbar-thumb{ background: #ffb300; border-radius: 8px; }
.acc-menu::-webkit-scrollbar-track{ background: transparent; }

/* ===============================
   VLibras
   =============================== */
/* Não aplique overrides dentro do VLibras (evita janela branca) */
html.acc-negative-contrast [vw],
html.acc-negative-contrast [vw] *,
html.acc-contrast [vw],
html.acc-contrast [vw] * {
  all: revert !important;   /* mais robusto que só background/color */
}

/* Deixe o botão invisível, mas clicável via JS (NÃO usar display:none/clip) */
[vw] { z-index: 99990; }     /* abaixo do seu 99999 */

[vw-access-button]{
  position: fixed !important;
  right: -100vw !important;  /* fora da tela */
  bottom: 20px !important;
  width: 48px !important;
  height: 48px !important;
  opacity: 0 !important;     /* invisível */
  pointer-events: auto !important; /* mantém click() funcionando */
}

[vw] [vw-access-button] .vp-pop-up, [vw] [vw-access-button] .vp-access-button {
	display: none !important;
}