/**
 * @file
 * FGV Acessibilidade - Styles for the accessibility panel.
 */

/* FGV brand font (Google Sans Flex) */
@import url("https://fonts.googleapis.com/css2?family=Google+Sans+Flex:opsz,wght@6..144,1..1000&display=swap");

/* Font size scaling. Applied to <html> via the CSS variable controlled by the
   module's JS (--fgv-font-size-scale). Kept here (not injected as a <style>
   element) so the module does not mutate the DOM during attach, which would
   make the core active-link.js re-evaluate and drop the is-active class. */
html {
  font-size: calc(100% * var(--fgv-font-size-scale, 1));
}

/* =========================================================
 * Floating toggle button
 * ========================================================= */
.fgv-acessibilidade-toggle {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9998;
  background: #003a79;
  color: #fff;
  border: none;
  border-radius: 8px 0 0 8px;
  padding: 8px 8px 8px 12px;
  cursor: pointer;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    right 0.35s ease,
    left 0.35s ease,
    top 0.2s ease,
    background 0.2s ease;
  line-height: 1;
  cursor: grab;
  touch-action: none;
}

.fgv-acessibilidade-toggle:hover,
.fgv-acessibilidade-toggle:focus {
  background: #003a79;
  outline: 2px solid #ffcc00;
  outline-offset: 2px;
}

/* Durante o arrasto: segue o ponteiro sem transição/animação, com destaque visual. */
.fgv-acessibilidade-toggle.fgv-dragging {
  cursor: grabbing;
  transition: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  z-index: 10000;
}

.fgv-acessibilidade-toggle svg {
  display: block;
  width: 40px;
  height: 40px;
}

/* =========================================================
 * Slide panel
 * ========================================================= */
.fgv-acessibilidade-panel {
  position: fixed;
  top: 0;
  right: -340px;
  width: 320px;
  height: 100vh;
  z-index: 9999;
  background: #fff;
  color: #333;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  transition:
    right 0.35s ease,
    left 0.35s ease,
    visibility 0.35s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Hidden panel must not be focusable/clickable. */
  visibility: hidden;
  font-family:
    "Google Sans Flex",
    "Google Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.fgv-acessibilidade-panel[aria-hidden="false"] {
  right: 0;
  visibility: visible;
}

/* Panel open state: shift toggle button via sibling selector */
.fgv-acessibilidade-panel[aria-hidden="false"] ~ .fgv-acessibilidade-toggle {
  right: 320px;
}

/* =========================================================
 * Left side placement
 * ========================================================= *
 * Aplicado quando o usuário arrasta o botão para a metade
 * esquerda da tela (ou usa Alt+Seta esquerda). Espelha
 * posição, arredondamento e sombra do botão e do painel. */
#fgv-acessibilidade-wrapper.fgv-side-left .fgv-acessibilidade-toggle {
  right: auto;
  left: 0;
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.25);
}

#fgv-acessibilidade-wrapper.fgv-side-left .fgv-acessibilidade-panel {
  right: auto;
  left: -340px;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

#fgv-acessibilidade-wrapper.fgv-side-left .fgv-acessibilidade-panel[aria-hidden="false"] {
  left: 0;
}

#fgv-acessibilidade-wrapper.fgv-side-left
  .fgv-acessibilidade-panel[aria-hidden="false"]
  ~ .fgv-acessibilidade-toggle {
  left: 320px;
  right: auto;
}

/* =========================================================
 * Panel header
 * ========================================================= */
.fgv-acessibilidade-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #e0e0e0;
  background: #f5f5f5;
}

.fgv-acessibilidade-panel-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #003a79;
}

.fgv-acessibilidade-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.2s;
}

.fgv-acessibilidade-close:hover,
.fgv-acessibilidade-close:focus {
  background: #e0e0e0;
  color: #333;
  outline: 2px solid #ffcc00;
}

/* =========================================================
 * Panel body
 * ========================================================= */
.fgv-acessibilidade-panel-body {
  padding: 16px;
  flex: 1;
}

.fgv-acessibilidade-group {
  margin-bottom: 16px;
}

.fgv-acessibilidade-group h4 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fgv-acessibilidade-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ccc;
  color: #fff;
  cursor: help;
  flex-shrink: 0;
  transition: background 0.2s;
}

.fgv-acessibilidade-tooltip:hover,
.fgv-acessibilidade-tooltip:focus {
  background: #003a79;
}

.fgv-acessibilidade-tooltip svg {
  display: block;
  width: 12px;
  height: 12px;
}

.fgv-acessibilidade-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fgv-acessibilidade-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: #f0f4f8;
  color: #333;
  border: 1px solid #d0d8e0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
  text-align: left;
}

.fgv-acessibilidade-btn:hover {
  background: #003a79;
  color: #fff;
  border-color: #003a79;
}

.fgv-acessibilidade-btn:focus {
  outline: 2px solid #ffcc00;
  outline-offset: 2px;
}

.fgv-acessibilidade-btn svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}

.fgv-acessibilidade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #003a79;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.fgv-acessibilidade-btn:hover .fgv-acessibilidade-badge {
  background: #fff;
  color: #003a79;
}

/* =========================================================
 * Compact 2-column grid of toggles
 * ========================================================= */
.fgv-acessibilidade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.fgv-acessibilidade-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: #f0f4f8;
  color: #333;
  border: 1px solid #d0d8e0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.fgv-acessibilidade-tile svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.fgv-acessibilidade-tile-label {
  line-height: 1.2;
}

.fgv-acessibilidade-tile:hover {
  background: #003a79;
  color: #fff;
  border-color: #003a79;
}

.fgv-acessibilidade-tile:focus {
  outline: 2px solid #ffcc00;
  outline-offset: 2px;
}

.fgv-acessibilidade-tile:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fgv-acessibilidade-tile:disabled:hover {
  background: #f0f4f8;
  color: #333;
  border-color: #d0d8e0;
}

/* =========================================================
 * Font size indicator
 * ========================================================= */
.fgv-acessibilidade-indicator {
  margin-top: 8px;
  font-size: 12px;
  color: #888;
  text-align: center;
}

/* =========================================================
 * Active state for toggle buttons
 * ========================================================= */
.fgv-acessibilidade-btn-toggle.active,
.fgv-acessibilidade-btn-contraste.active,
.fgv-acessibilidade-tile.active {
  background: #003a79;
  color: #fff;
  border-color: #003a79;
}

.fgv-acessibilidade-btn-toggle.active .fgv-acessibilidade-btn-text::after,
.fgv-acessibilidade-btn-contraste.active .fgv-acessibilidade-btn-text::after,
.fgv-acessibilidade-tile.active .fgv-acessibilidade-tile-label::after {
  content: " ✓";
  font-weight: 700;
}

.fgv-acessibilidade-btn-resetall {
  justify-content: center;
  background: #e8e8e8;
  border-color: #ccc;
  font-weight: 600;
  margin-top: 4px;
}

.fgv-acessibilidade-btn-resetall:hover {
  background: #c00;
  color: #fff;
  border-color: #c00;
}

/* =========================================================
 * Legal info section
 * ========================================================= */
.fgv-acessibilidade-legal {
  padding-top: 16px;
  border-top: 1px solid #e0e0e0;
  margin-top: 24px;
}

.fgv-acessibilidade-legal-text {
  font-size: 11px;
  color: #999;
  line-height: 1.5;
  margin: 0;
}

.fgv-acessibilidade-legal-text strong {
  color: #777;
}

/* =========================================================
 * HIGH CONTRAST MODE
 * =========================================================
 * Usa a classe .highcontrast no <html>, com o padrão
 * *:not(.highcontrastRemove) para evitar aplicar estilos
 * a elementos que precisam manter suas cores originais
 * (ex.: VLibras, toolbar de admin).
 * ========================================================= */

/* ---- Root variables ---- */
.highcontrast {
  --hc-bg: #000000;
  --hc-text: #ffffff;
  --hc-link: #ffff00;
  --hc-heading: #ffff00;
  --hc-border: #ffffff;
  --hc-focus: #00ffff;
}

/* ---- Base ---- */
.highcontrast,
.highcontrast body {
  background-color: var(--hc-bg) !important;
  color: var(--hc-text) !important;
}

/* ---- Universal selector com exceções ----
 * :where() zera a especificidade das exceções de tipo, mantendo o universal
 * com especificidade baixa (apenas .highcontrast) para que regras específicas
 * (links, headings, botões) possam sobrescrevê-lo normalmente. */
.highcontrast
  *:where(
    :not(svg, path, circle, rect, line, polyline, polygon, .highcontrastRemove)
  ) {
  background-color: var(--hc-bg) !important;
  color: var(--hc-text) !important;
  border-color: var(--hc-border) !important;
}

/* ---- Elementos estruturais ---- */
.highcontrast nav:not(.highcontrastRemove),
.highcontrast div:not(.highcontrastRemove),
.highcontrast section:not(.highcontrastRemove),
.highcontrast article:not(.highcontrastRemove),
.highcontrast aside:not(.highcontrastRemove),
.highcontrast header:not(.highcontrastRemove),
.highcontrast footer:not(.highcontrastRemove),
.highcontrast main:not(.highcontrastRemove) {
  background-color: var(--hc-bg) !important;
}

/* ---- Tipografia ---- */
.highcontrast h1:not(.highcontrastRemove),
.highcontrast h2:not(.highcontrastRemove),
.highcontrast h3:not(.highcontrastRemove),
.highcontrast h4:not(.highcontrastRemove),
.highcontrast h5:not(.highcontrastRemove),
.highcontrast h6:not(.highcontrastRemove) {
  background-color: transparent !important;
  color: var(--hc-heading) !important;
  font-weight: bold !important;
}

.highcontrast p:not(.highcontrastRemove),
.highcontrast span:not(.highcontrastRemove),
.highcontrast li:not(.highcontrastRemove),
.highcontrast td:not(.highcontrastRemove),
.highcontrast th:not(.highcontrastRemove),
.highcontrast label:not(.highcontrastRemove),
.highcontrast legend:not(.highcontrastRemove) {
  color: var(--hc-text) !important;
}

/* ---- Links ----
 * Especificidade elevada (html .highcontrast) para vencer a regra universal
 * de mesmo nível, garantindo links na cor --hc-link (amarelo). */
.highcontrast html a:not(.highcontrastRemove),
html.highcontrast a:not(.highcontrastRemove) {
  background-color: transparent !important;
  color: var(--hc-link) !important;
  text-decoration: underline !important;
  outline: 1px dotted var(--hc-link) !important;
  outline-offset: 2px;
}

.highcontrast html a:not(.highcontrastRemove):hover,
.highcontrast html a:not(.highcontrastRemove):focus,
html.highcontrast a:not(.highcontrastRemove):hover,
html.highcontrast a:not(.highcontrastRemove):focus {
  background-color: var(--hc-link) !important;
  color: var(--hc-bg) !important;
  outline: 2px solid var(--hc-link) !important;
}

.highcontrast html a:not(.highcontrastRemove):visited,
html.highcontrast a:not(.highcontrastRemove):visited {
  color: #ff00ff !important;
  outline-color: #ff00ff !important;
}

/* ---- Botões ---- */
.highcontrast button:not(.highcontrastRemove),
.highcontrast input[type="button"]:not(.highcontrastRemove),
.highcontrast input[type="submit"]:not(.highcontrastRemove),
.highcontrast input[type="reset"]:not(.highcontrastRemove),
.highcontrast .button:not(.highcontrastRemove) {
  background-color: var(--hc-bg) !important;
  color: var(--hc-link) !important;
  border: 2px solid var(--hc-link) !important;
  outline: 1px dotted var(--hc-link) !important;
  outline-offset: 2px;
}

.highcontrast button:not(.highcontrastRemove):hover,
.highcontrast button:not(.highcontrastRemove):focus {
  background-color: var(--hc-link) !important;
  color: var(--hc-bg) !important;
  outline: 3px solid var(--hc-focus) !important;
}

.highcontrast button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- Formulários ---- */
.highcontrast
  input:not([type="button"]):not([type="submit"]):not([type="reset"]):not(
    .highcontrastRemove
  ),
.highcontrast textarea:not(.highcontrastRemove),
.highcontrast select:not(.highcontrastRemove) {
  background-color: var(--hc-bg) !important;
  color: var(--hc-text) !important;
  border: 2px solid var(--hc-border) !important;
}

.highcontrast input:focus,
.highcontrast textarea:focus,
.highcontrast select:focus {
  outline: 3px solid var(--hc-focus) !important;
  outline-offset: 2px;
}

.highcontrast ::placeholder {
  color: var(--hc-text) !important;
  opacity: 0.7;
}

/* ---- Tabelas ---- */
.highcontrast table:not(.highcontrastRemove) {
  border-collapse: collapse;
  border: 2px solid var(--hc-border) !important;
}

.highcontrast th:not(.highcontrastRemove),
.highcontrast td:not(.highcontrastRemove) {
  border: 1px solid var(--hc-border) !important;
  padding: 8px;
}

.highcontrast th:not(.highcontrastRemove) {
  background-color: var(--hc-bg) !important;
  color: var(--hc-heading) !important;
  font-weight: bold !important;
}

/* ---- Imagens ---- */
.highcontrast img:not(.highcontrastRemove) {
  border: 2px solid var(--hc-border) !important;
  filter: contrast(1.2) brightness(1.1);
}

/* SVGs decorativos: inverte para ficarem visíveis no fundo escuro. */
.highcontrast svg:not(.highcontrastRemove) {
  filter: invert(1) hue-rotate(180deg);
}

/* Logos com filtro de cor do tema: anula o filter aplicado pelo tema para que
 * a logo não vire um bloco branco. Sem o filter do tema no alto contraste, a
 * logo mantém suas cores/original, garantindo contraste. Alta especificidade
 * (html.highcontrast) para vencer seletores do tema como
 * header[role=menu] .region-nav-branding img. */
html.highcontrast header .region-nav-branding img,
html.highcontrast img.nav-branding,
html.highcontrast .site-logo img,
html.highcontrast .navbar-brand img,
html.highcontrast header[role="menu"] .region-nav-branding img,
html.highcontrast a.navbar-brand img {
  filter: none !important;
}

/* Ícones ligados a links ou botões (inclui o próprio widget) não são
 * invertidos: herdam a cor de alto contraste do link/botão, garantindo que
 * permaneçam visíveis no fundo escuro (ícones brancos viravam pretos). */
.highcontrast a svg:not(.highcontrastRemove),
.highcontrast button svg:not(.highcontrastRemove) {
  filter: invert(0) hue-rotate(0deg) !important;
}

/* Ícones do próprio widget: usam currentColor e já herdam a cor do
 * botão/título. */
.highcontrast .fgv-acessibilidade-panel svg,
.highcontrast .fgv-acessibilidade-toggle svg {
  filter: invert(0) hue-rotate(0deg) !important;
}

/* ---- Focus ---- */
.highcontrast *:focus {
  outline: 3px solid var(--hc-focus) !important;
  outline-offset: 2px !important;
}

/* ---- Sombras ---- */
.highcontrast * {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* ---- Background images ----
 * Imagens de fundo decorativas (banners, cabeçalhos com foto etc.) NÃO são
 * removidas por padrão — o texto sobreposto a elas já recebe cor forçada
 * pelas regras de tipografia/links acima (ex.: links ficam amarelos),
 * garantindo legibilidade independente da foto por trás. Apenas backgrounds
 * explicitamente marcados como decorativos e problemáticos são ocultados,
 * adicionando a classe .highcontrastRemove ao elemento. */
.highcontrast [style*="background-image"].highcontrastRemove,
.highcontrast .has-background-image.highcontrastRemove {
  background-image: none !important;
}

/* ---- Widget de Acessibilidade ---- */
.highcontrast .fgv-acessibilidade-panel {
  background: var(--hc-bg) !important;
  border-left: 3px solid var(--hc-border) !important;
}

.highcontrast .fgv-acessibilidade-panel-header {
  background: #111 !important;
  border-bottom: 1px solid var(--hc-border) !important;
}

.highcontrast .fgv-acessibilidade-panel-header h3 {
  color: var(--hc-heading) !important;
}

.highcontrast .fgv-acessibilidade-btn,
.highcontrast .fgv-acessibilidade-tile {
  background: #111 !important;
  color: var(--hc-text) !important;
  border: 1px solid var(--hc-border) !important;
}

.highcontrast .fgv-acessibilidade-btn:hover,
.highcontrast .fgv-acessibilidade-tile:hover {
  background: #333 !important;
  border-color: var(--hc-link) !important;
}

.highcontrast .fgv-acessibilidade-tile.active {
  background: var(--hc-link) !important;
  color: var(--hc-bg) !important;
  border-color: var(--hc-link) !important;
}

.highcontrast .fgv-acessibilidade-btn-resetall {
  background: #222 !important;
  border-color: #c00 !important;
  color: #c00 !important;
}

.highcontrast .fgv-acessibilidade-btn-resetall:hover {
  background: #c00 !important;
  color: #000 !important;
}

.highcontrast .fgv-acessibilidade-close {
  color: var(--hc-text) !important;
}

.highcontrast .fgv-acessibilidade-tooltip {
  background: #444 !important;
  color: #fff !important;
}

.highcontrast .fgv-acessibilidade-tooltip:hover,
.highcontrast .fgv-acessibilidade-tooltip:focus {
  background: var(--hc-link) !important;
  color: var(--hc-bg) !important;
}

.highcontrast .fgv-acessibilidade-indicator {
  color: #ccc !important;
}

.highcontrast .fgv-acessibilidade-legal {
  border-top-color: var(--hc-border) !important;
}

.highcontrast .fgv-acessibilidade-legal-text,
.highcontrast .fgv-acessibilidade-legal-text strong {
  color: #ccc !important;
}

.highcontrast .fgv-acessibilidade-badge {
  background: var(--hc-text) !important;
  color: var(--hc-bg) !important;
}

.highcontrast .fgv-acessibilidade-btn:hover .fgv-acessibilidade-badge {
  background: var(--hc-link) !important;
  color: var(--hc-bg) !important;
}

.highcontrast .fgv-acessibilidade-toggle {
  background: var(--hc-bg) !important;
  color: var(--hc-text) !important;
  border: 2px solid var(--hc-border) !important;
  border-right: none !important;
}

.highcontrast #fgv-acessibilidade-wrapper.fgv-side-left .fgv-acessibilidade-toggle {
  border-right: 2px solid var(--hc-border) !important;
  border-left: none !important;
}

.highcontrast .fgv-acessibilidade-toggle:hover {
  background: #333 !important;
}

/* Overlay transparente em modo alto contraste (evita tela preta ao abrir painel) */
.highcontrast .fgv-acessibilidade-overlay {
  background: transparent !important;
}

/* VLibras container - começa oculto, exibido via JS ao clicar em "Abrir VLibras" */
#fgv-vlibras-container {
  display: none;
}

/* VLibras 7.5.0 injeta seu próprio botão flutuante direto no <body>
   (#vlibras-access-wrapper); ocultamos porque este módulo já tem seu
   próprio botão de acionamento dentro do painel de acessibilidade. */
#vlibras-access-wrapper {
  display: none !important;
}

.highcontrast div[vw] * {
  background-color: initial !important;
  color: initial !important;
}

/* ---- Toolbar de admin (não aplicar alto contraste) ----
 * A exclusão é feita via JS/PHP adicionando a classe .highcontrastRemove
 * à #toolbar-administration e a todos os seus descendentes, de modo que as
 * regras de alto contraste (que usam :not(.highcontrastRemove)) não as
 * atinjam e o tema mantenha suas cores originais.
 */

/* ---- Print ---- */
@media print {
  .highcontrast {
    background-color: white !important;
    color: black !important;
  }
  .highcontrast * {
    background-color: white !important;
    color: black !important;
  }
}

/* =========================================================
 * Espaçamento de Texto (WCAG 1.4.12)
 * ========================================================= */
/* Seletor amplo (e não uma lista fixa de tags) de propósito: cada site da
 * FGV estrutura banners, títulos e blocos de forma diferente (h1-h6, span,
 * div, links de carrossel etc.), então uma lista fixa sempre deixa buracos
 * — como aconteceu com o banner da home e títulos internos. Ícones/SVGs são
 * excluídos por não terem texto a espaçar. */
.fgv-spacing *:where(:not(svg, path, circle, rect, line, polyline, polygon, .highcontrastRemove)) {
  line-height: 1.5 !important;
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

/* =========================================================
 * Pausar Animações (WCAG 2.2.2)
 * ========================================================= */
.fgv-paused *,
.fgv-paused *::before,
.fgv-paused *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

/* =========================================================
 * Guia de Leitura (eMAG)
 * ========================================================= */
.fgv-guia-leitura {
  display: none;
  position: fixed;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 0, 0, 0.6);
  z-index: 99999;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(255, 0, 0, 0.3);
}

/* =========================================================
 * Overlay backdrop
 * ========================================================= */
.fgv-acessibilidade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.fgv-acessibilidade-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* =========================================================
 * Underline links (WCAG 1.4.1 - Use of Color / eMAG)
 * ========================================================= */
.fgv-underline-links a:not(.highcontrastRemove) {
  text-decoration: underline !important;
}

/* =========================================================
 * Grayscale
 * ========================================================= */
html.fgv-grayscale {
  filter: grayscale(1);
}

/* =========================================================
 * Big cursor
 * ========================================================= */
html.fgv-big-cursor,
html.fgv-big-cursor * {
  cursor:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path d="M3 2l7 19 2.3-7.7L20 11z" fill="black" stroke="white" stroke-width="1.5" stroke-linejoin="round"/></svg>')
      2 2,
    auto !important;
}

html.fgv-big-cursor a:not(.highcontrastRemove),
html.fgv-big-cursor button:not(.highcontrastRemove),
html.fgv-big-cursor [role="button"]:not(.highcontrastRemove),
html.fgv-big-cursor input:not(.highcontrastRemove),
html.fgv-big-cursor select:not(.highcontrastRemove),
html.fgv-big-cursor textarea:not(.highcontrastRemove) {
  cursor:
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path d="M9 2v13.5a2 2 0 0 0 4 0V8a1.5 1.5 0 0 1 3 0v6" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/><path d="M9 2v13.5a2 2 0 0 0 4 0V8a1.5 1.5 0 0 1 3 0v6" fill="none" stroke="white" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"/></svg>')
      12 4,
    pointer !important;
}

/* =========================================================
 * Dyslexia-friendly font
 * ========================================================= */
/* Ícones do tema (fontello/FontAwesome, ex.: .icon-down-open, .fa-times) usam
 * fontes próprias para renderizar glifos — são excluídos para não virarem
 * caracteres/quadrados errados. SVGs (usados nos ícones deste próprio painel)
 * também são excluídos, já que não renderizam texto. */
html.fgv-dyslexia-font,
html.fgv-dyslexia-font *:not([class*="icon"]):not([class*="fa-"]):not(svg) {
  font-family: Verdana, Tahoma, Arial, sans-serif !important;
  letter-spacing: 0.03em !important;
  word-spacing: 0.08em !important;
  line-height: 1.6 !important;
}

/* =========================================================
 * Responsive
 * ========================================================= */
@media (max-width: 480px) {
  .fgv-acessibilidade-panel {
    width: 280px;
    right: -300px;
    visibility: hidden;
  }

  .fgv-acessibilidade-panel[aria-hidden="false"] {
    right: 0;
    visibility: visible;
  }

  .fgv-acessibilidade-panel[aria-hidden="false"] ~ .fgv-acessibilidade-toggle {
    right: 280px;
  }

  #fgv-acessibilidade-wrapper.fgv-side-left .fgv-acessibilidade-panel {
    left: -280px;
  }

  #fgv-acessibilidade-wrapper.fgv-side-left .fgv-acessibilidade-panel[aria-hidden="false"] {
    left: 0;
  }

  #fgv-acessibilidade-wrapper.fgv-side-left
    .fgv-acessibilidade-panel[aria-hidden="false"]
    ~ .fgv-acessibilidade-toggle {
    left: 280px;
  }
}
