/* =================================================================
   Acessibilidade — botão próprio + posicionamento do VLibras
   Os dois ficam no lado direito, centralizados na vertical:
   acessibilidade em cima, VLibras embaixo.
   ================================================================= */


/* ---------- Botão flutuante ---------- */
.a11y { position: fixed; right: 0; top: calc(50% - 104px); z-index: 99999; font-family: "Montserrat", system-ui, sans-serif; }
.a11y-toggle {
  width: 52px; height: 52px; border: 0; border-radius: 2px 0 0 2px;
  background: #3a3a3a; color: #e1bd85; font-size: 28px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: -4px 6px 18px rgba(0, 0, 0, .25); transition: width .2s, background .2s;
}
.a11y-toggle:hover, .a11y-toggle[aria-expanded="true"] { width: 58px; background: #2f2f2f; }
.a11y-toggle:focus-visible, .a11y-panel button:focus-visible { outline: 3px solid #e1bd85; outline-offset: 2px; }

/* ---------- Painel ---------- */
.a11y-panel {
  position: absolute; right: 62px; top: 50%; transform: translateY(-50%);
  width: 300px; max-width: calc(100vw - 80px); max-height: 86vh; overflow-y: auto;
  background: #fff; color: #3a3a3a; border-radius: 2px; padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3); border-top: 4px solid #e1bd85;
}
.a11y-panel[hidden] { display: none; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.a11y-head h2 { font-size: 18px; margin: 0; color: #3a3a3a; font-family: inherit; font-weight: 700; display: flex; gap: 8px; align-items: center; }
.a11y-head h2 i { color: #7d5f33; }
.a11y-close { border: 0; background: #efede8; color: #3a3a3a; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }

.a11y-font { display: flex; align-items: center; justify-content: space-between; background: #f6f5f2; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.a11y-font div { display: flex; align-items: center; gap: 6px; }
.a11y-font button { width: 38px; height: 34px; border: 0; border-radius: 8px; background: #3a3a3a; color: #fff; font-weight: 700; cursor: pointer; }
.a11y-font output { min-width: 48px; text-align: center; font-weight: 700; }

.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px;
  border: 2px solid #dedad3; border-radius: 12px; background: #fff; color: #3a3a3a;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: .2s; line-height: 1.2;
}
.a11y-grid button i { font-size: 22px; color: #7d5f33; }
.a11y-grid button:hover { border-color: #e1bd85; }
.a11y-grid button[aria-pressed="true"] { background: #3a3a3a; border-color: #3a3a3a; color: #fff; }
.a11y-grid button[aria-pressed="true"] i { color: #e1bd85; }
.a11y-reset { width: 100%; margin-top: 12px; padding: 10px; border: 0; border-radius: 10px; background: #efede8; color: #3a3a3a; font-weight: 700; cursor: pointer; }
.a11y-reset:hover { background: #dedad3; }

/* ---------- VLibras: logo abaixo do botão de acessibilidade ---------- */
[vw].enabled { right: 0 !important; left: auto !important; top: calc(50% + 0px) !important; bottom: auto !important; transform: none !important; margin: 0 !important; }
[vw] [vw-access-button] { border-radius: 12px 0 0 12px !important; }
@media (max-width: 575.98px) {
  .a11y { top: auto; bottom: 170px; }
  [vw].enabled { top: auto !important; bottom: 110px !important; }
}

/* =================================================================
   Efeitos aplicados na página
   ================================================================= */

/* Alto contraste */
html.a11y-contrast body,
html.a11y-contrast body *:not([data-a11y-ignore]):not([data-a11y-ignore] *):not(img):not(video):not(iframe):not(svg):not(svg *) {
  background-color: #000 !important; background-image: none !important;
  color: #fff !important; border-color: #fff !important; text-shadow: none !important; box-shadow: none !important;
}
html.a11y-contrast body a:not([data-a11y-ignore] *):not(.a11y-x):not(.a11y-y),
html.a11y-contrast body a *:not([data-a11y-ignore] *):not(.a11y-x):not(.a11y-y) { color: #ffe600 !important; }

/* Escala de cinza */
html.a11y-gray { filter: grayscale(1); }

/* Destacar links */
html.a11y-links a:not([data-a11y-ignore] *) { text-decoration: underline !important; text-underline-offset: 3px; outline: 2px dashed #e1bd85; outline-offset: 2px; }

/* Fonte legível */
html.a11y-readable body, html.a11y-readable body *:not(i):not([class*="bi-"]) { font-family: Verdana, Tahoma, Arial, sans-serif !important; letter-spacing: .02em; }

/* Espaçamento de texto */
html.a11y-spacing body p, html.a11y-spacing body li, html.a11y-spacing body span, html.a11y-spacing body a, html.a11y-spacing body h1,
html.a11y-spacing body h2, html.a11y-spacing body h3, html.a11y-spacing body h4 { line-height: 1.9 !important; letter-spacing: .08em !important; word-spacing: .16em !important; }

/* Parar animações */
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* Cursor grande */
html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 9-7 1.5L9.5 20z' fill='%23000' stroke='%23fff' stroke-width='1.3'/%3E%3C/svg%3E") 4 2, auto !important;
}

/* Guia de leitura */
.a11y-reading-guide { display: none; position: fixed; left: 0; right: 0; height: 44px; pointer-events: none; z-index: 99980;
  background: rgba(225, 189, 133, .22); border-top: 3px solid #e1bd85; border-bottom: 3px solid #e1bd85; }
html.a11y-guide .a11y-reading-guide { display: block; }
#conteudo:focus { outline: none; }

@media (max-width: 575.98px) {
  .a11y-panel { position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; transform: none; width: auto; max-width: none; max-height: 78vh; }
}
