/* EmotePix — estilos de acessibilidade (compartilhado entre landing, donate e app)
 * Convive com brand.css / landing.css / app.css / donate.css sem alterá-los.
 */

/* ---------- Barra de controles (legado, mantido para compat) ---------- */
.a11y-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- Widget flutuante (direita, centro vertical) ---------- */
.a11y-widget.a11y-menu {
  position: fixed;
  right: 0;
  bottom: auto;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10050;
  /* Não tem padding/margin aqui — o botão fica colado à borda direita */
}

/* O menu de acessibilidade NÃO muda de posição quando o VLibras abre — só
 * sobe o z-index para o máximo (empatando com o widget do VLibras) para
 * continuar visível/clicável por cima do painel do intérprete; o desempate
 * de quem fica por cima é feito via ordem no DOM (ver a11y.js). */
html.emotepix-vlibras-active .a11y-widget.a11y-menu {
  z-index: 2147483647;
}

.a11y-widget .a11y-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px 0 0 8px; /* arredondado só no lado esquerdo */
  border-right: none;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
  background: #1e1a2e;
  border-color: rgba(255, 255, 255, 0.2);
  color: #f4f2ff;
  font-size: 1.25rem;
}

/* Esconde o rótulo de texto — só ícone */
.a11y-widget .a11y-menu-label {
  display: none;
}

.a11y-widget .a11y-menu-toggle:hover {
  background: #2d2745;
  border-color: rgba(255, 255, 255, 0.4);
}

.a11y-widget .a11y-panel {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  bottom: auto;
  left: auto;
  min-width: 200px;
}

html.emotepix-high-contrast .a11y-widget .a11y-menu-toggle {
  background: #000 !important;
  border-color: #ffd166 !important;
  color: #fff !important;
}

html.emotepix-high-contrast .a11y-widget .a11y-menu-toggle:hover {
  background: #ffd166 !important;
  color: #000 !important;
}

/* ---------- Menu agrupado de acessibilidade ---------- */
.a11y-menu {
  position: relative;
  display: inline-flex;
}

.a11y-menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.a11y-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 200px;
  padding: 12px;
  background: #16121c;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-panel .a11y-panel-item {
  width: 100%;
  text-align: left;
}

.a11y-panel .a11y-font-group {
  justify-content: center;
}

/* Em telas estreitas, evita que o painel vaze para fora da viewport. */
@media (max-width: 480px) {
  .a11y-panel {
    right: auto;
    left: 0;
    min-width: 180px;
  }
}

html.emotepix-high-contrast .a11y-panel {
  background: #000 !important;
  border-color: #ffd166 !important;
}

/* Garante que a barra de idioma existente (lang-bar) acomode a barra de
 * acessibilidade ao lado sem quebrar em telas estreitas. */
.lang-bar {
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 12px;
}
.lang-bar-global {
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 12px;
}

.a11y-btn {
  appearance: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.a11y-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.a11y-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.a11y-btn.is-active {
  background: #ffd166;
  color: #14100a;
  border-color: #ffd166;
  font-weight: 700;
}

.a11y-font-group {
  display: inline-flex;
  gap: 4px;
}

.a11y-btn-icon {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
}

/* ---------- Tamanho de fonte (4 níveis) ----------
 * Aplicado na raiz do documento; escala o rem base para toda a página.
 * clamp/rem já usados no CSS existente reagem automaticamente, evitando
 * quebra de layout em telas pequenas.
 */
html.emotepix-font-sm {
  font-size: 87.5%; /* ~14px */
}
html.emotepix-font-md {
  font-size: 100%; /* baseline, ~16px */
}
html.emotepix-font-lg {
  font-size: 112.5%; /* ~18px */
}
html.emotepix-font-xl {
  font-size: 125%; /* ~20px */
}

/* Evita overflow horizontal quando a fonte aumenta em telas estreitas. */
html.emotepix-font-lg body,
html.emotepix-font-xl body {
  overflow-wrap: break-word;
  word-break: break-word;
}

html.emotepix-font-lg .btn-row,
html.emotepix-font-xl .btn-row,
html.emotepix-font-lg .cta-row,
html.emotepix-font-xl .cta-row {
  flex-wrap: wrap;
}

/* ---------- Alto contraste ----------
 * Modo alternativo de cores: fundo preto, texto branco, links/botões
 * em amarelo/ciano de alto contraste (WCAG AAA-friendly), bordas visíveis
 * em todos os controles interativos.
 */
html.emotepix-high-contrast {
  color-scheme: dark;
}

html.emotepix-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.emotepix-high-contrast * {
  background-color: transparent;
  text-shadow: none !important;
  box-shadow: none !important;
}

html.emotepix-high-contrast body,
html.emotepix-high-contrast section,
html.emotepix-high-contrast header,
html.emotepix-high-contrast footer,
html.emotepix-high-contrast main,
html.emotepix-high-contrast nav,
html.emotepix-high-contrast aside,
html.emotepix-high-contrast div,
html.emotepix-high-contrast article,
html.emotepix-high-contrast .card,
html.emotepix-high-contrast .panel,
html.emotepix-high-contrast .kpi,
html.emotepix-high-contrast .feature-card,
html.emotepix-high-contrast .audience-card,
html.emotepix-high-contrast .url-card,
html.emotepix-high-contrast .tip-card,
html.emotepix-high-contrast .video-card,
html.emotepix-high-contrast .sidebar,
html.emotepix-high-contrast .auth-panel {
  background: #000 !important;
  border-color: #ffd166 !important;
}

html.emotepix-high-contrast h1,
html.emotepix-high-contrast h2,
html.emotepix-high-contrast h3,
html.emotepix-high-contrast h4,
html.emotepix-high-contrast p,
html.emotepix-high-contrast span,
html.emotepix-high-contrast label,
html.emotepix-high-contrast li,
html.emotepix-high-contrast td,
html.emotepix-high-contrast th,
html.emotepix-high-contrast strong,
html.emotepix-high-contrast em,
html.emotepix-high-contrast small {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

html.emotepix-high-contrast a {
  color: #ffd166 !important;
  text-decoration: underline !important;
}

html.emotepix-high-contrast a:visited {
  color: #ffe8ad !important;
}

html.emotepix-high-contrast button,
html.emotepix-high-contrast .btn-primary,
html.emotepix-high-contrast .btn-secondary,
html.emotepix-high-contrast .btn-ghost,
html.emotepix-high-contrast .btn-sm,
html.emotepix-high-contrast .btn-preview {
  background: #000 !important;
  color: #ffd166 !important;
  border: 2px solid #ffd166 !important;
}

html.emotepix-high-contrast button:hover,
html.emotepix-high-contrast .btn-primary:hover,
html.emotepix-high-contrast .btn-secondary:hover {
  background: #ffd166 !important;
  color: #000 !important;
}

html.emotepix-high-contrast input,
html.emotepix-high-contrast select,
html.emotepix-high-contrast textarea {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #ffd166 !important;
}

html.emotepix-high-contrast img,
html.emotepix-high-contrast svg {
  filter: grayscale(1) contrast(1.3);
}

html.emotepix-high-contrast :focus-visible {
  outline: 3px solid #ffd166 !important;
  outline-offset: 2px;
}

html.emotepix-high-contrast .a11y-bar .a11y-btn {
  border-color: #ffd166 !important;
  color: #fff !important;
}

html.emotepix-high-contrast .a11y-btn.is-active {
  background: #ffd166 !important;
  color: #000 !important;
}

/* ---------- VLibras ----------
 * Só carrega e exibe quando o usuário escolhe "Libras" no menu.
 * Botão flutuante oficial fica oculto; acionamento via menu de acessibilidade.
 */
#vlibras-wrapper:not(.emotepix-vlibras-open) [vw-plugin-wrapper] {
  visibility: hidden !important;
  pointer-events: none !important;
}

div[vw] {
  z-index: 9999;
}

[vw-access-button],
div[vw] [vw-access-button],
div[vw] .vw-access-button {
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

html.emotepix-high-contrast div[vw] .vw-access-button,
html.emotepix-high-contrast div[vw] div {
  filter: none !important;
}
