/* ============================================================
   HOLANA ART — WIDGET DE ACESSIBILIDADE
   ============================================================ */

:root {
  --accessibility-primary: var(--text, #2C2018);
  --accessibility-primary-hover: var(--mauve, #B88080);
  --accessibility-icon: var(--white, #FEFCF5);
  --accessibility-focus: var(--rose-light, #CC9898);
}

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

#a11y-filters {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

#a11y-root {
  --text: #2C2018;
  --white: #FEFCF5;
  --mauve: #B88080;
  --rose-light: #CC9898;
  --beige: #D8C89C;
  --accessibility-primary: #2C2018;
  --accessibility-primary-hover: #5a3d3d;
  --accessibility-icon: #FEFCF5;
  --accessibility-focus: #CC9898;
  --a11y-bg: #fefcf5;
  --a11y-fg: #2c2018;
  --a11y-muted: #5a4634;
  --a11y-line: #d8c89c;
  --a11y-btn: #f5f1e2;
  --a11y-btn-on: #2c2018;
  --a11y-btn-on-fg: #fefcf5;
  color: var(--a11y-fg);
  font-family: var(--font-body, 'Poppins', system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0;
  word-spacing: 0;
}

.a11y-fab {
  position: fixed;
  z-index: 10050;
  left: max(1.25rem, env(safe-area-inset-left, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  width: clamp(2.875rem, 11vw, 3.35rem);
  height: clamp(2.875rem, 11vw, 3.35rem);
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accessibility-primary);
  color: var(--accessibility-icon);
  box-shadow: 0 4px 20px rgba(44, 32, 24, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.a11y-fab:hover,
.a11y-fab:active {
  background: var(--accessibility-primary-hover);
}

.a11y-fab:focus {
  outline: none;
}

.a11y-fab:focus-visible,
.a11y-panel .a11y-btn:focus-visible,
.a11y-close:focus-visible {
  outline: 3px solid var(--accessibility-focus);
  outline-offset: 3px;
}

.a11y-fab svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
}

.a11y-panel {
  position: fixed;
  z-index: 10060;
  left: max(1.25rem, env(safe-area-inset-left, 0px));
  bottom: calc(max(1.25rem, env(safe-area-inset-bottom, 0px)) + clamp(2.875rem, 11vw, 3.35rem) + 0.75rem);
  width: min(92vw, 20rem);
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--a11y-bg);
  color: var(--a11y-fg);
  border: 1px solid var(--a11y-line);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(44, 32, 24, 0.22);
  padding: 1rem 1rem 1.15rem;
}

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

.a11y-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.a11y-panel__title {
  margin: 0;
  font-family: var(--font-title, Georgia, serif);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--a11y-fg);
}

.a11y-close,
.a11y-close.a11y-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: -0.35rem -0.35rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--a11y-fg);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a11y-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.a11y-section {
  margin: 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--a11y-line);
}

.a11y-section__title {
  margin: 0 0 0.55rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--a11y-muted);
}

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.a11y-grid--4 {
  grid-template-columns: 1fr 1fr;
}

.a11y-btn {
  min-height: 44px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--a11y-line);
  border-radius: 10px;
  background: var(--a11y-btn);
  color: var(--a11y-fg);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.a11y-btn[aria-pressed="true"],
.a11y-btn[aria-checked="true"] {
  background: var(--a11y-btn-on);
  color: var(--a11y-btn-on-fg);
  border-color: var(--a11y-btn-on);
}

.a11y-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.a11y-btn--wide {
  grid-column: 1 / -1;
}

@media (pointer: coarse) {
  .a11y-btn[data-action="bigCursor"] {
    display: none;
  }
}

/* ─── Escala de texto (html) ────────────────────────────────── */

html.a11y-text-sm { font-size: 87.5%; }
html.a11y-text-md { font-size: 100%; }
html.a11y-text-lg { font-size: 112.5%; }
html.a11y-text-xl { font-size: 125%; }

/* ─── Fonte acessível ───────────────────────────────────────── */

html.a11y-font {
  --font-title: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-subtitle: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
}

html.a11y-font,
html.a11y-font body {
  font-family: 'Atkinson Hyperlegible', system-ui, sans-serif;
}

/* ─── Espaçamento ───────────────────────────────────────────── */

html.a11y-line .header,
html.a11y-line .mobile-menu,
html.a11y-line main,
html.a11y-line .footer {
  line-height: 1.85;
}

html.a11y-letter .header,
html.a11y-letter .mobile-menu,
html.a11y-letter main,
html.a11y-letter .footer {
  letter-spacing: 0.06em;
}

html.a11y-word .header,
html.a11y-word .mobile-menu,
html.a11y-word main,
html.a11y-word .footer {
  word-spacing: 0.16em;
}

/* ─── Destacar links (fora do widget) ───────────────────────── */

html.a11y-highlight body a[href] {
  text-decoration: underline !important;
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
  background-color: #ffe566;
  color: #111 !important;
  box-shadow: 0 0 0 2px #111;
}

html.a11y-highlight #a11y-root a[href] {
  background: none;
  color: inherit !important;
  box-shadow: none;
}

/* ─── Alto contraste — tokens no body, nunca filter em html/body */

html.a11y-contrast body {
  --off-white: #12100c;
  --cream: #1a1610;
  --beige: #e8d9a8;
  --white: #1a1610;
  --rose-tea: #ffc9c9;
  --rose-light: #ffb4b4;
  --mauve: #ffc0c0;
  --sage: #d4d890;
  --sage-light: #e0e4b8;
  --green-light: #c4d094;
  --floral-yellow: #f0d080;
  --terracotta: #e8b090;
  --salmon: #ffc8b0;
  --lavender: #d8d4b0;
  --lilac: #c8c4a0;
  --gray-elegant: #e8dcc8;
  --gray-mid: #c8b8a8;
  --gray-soft: #3a3228;
  --text: #fff8ee;
  --text-light: #f0e4d0;
  --gradient-hero: #12100c;
  --gradient-card: #1a1610;
  --gradient-button: linear-gradient(135deg, #fff8ee 0%, #e8d9a8 100%);
  --gradient-section: #12100c;
  --gradient-rose: #2a2018;
  --gradient-sage: #2a2018;
  --gradient-footer: #12100c;
  --gradient-overlay: linear-gradient(180deg, transparent, #12100c);
  background: #12100c;
  color: #fff8ee;
}

html.a11y-contrast .header.scrolled {
  background: rgba(18, 16, 12, 0.96);
}

/* ─── Filtros nos blocos de 1º nível — NUNCA em html/body ───── */

html.a11y-grayscale .header,
html.a11y-grayscale .mobile-menu__overlay,
html.a11y-grayscale .mobile-menu,
html.a11y-grayscale main,
html.a11y-grayscale .footer,
html.a11y-grayscale .back-to-top,
html.a11y-grayscale .whatsapp-float,
html.a11y-grayscale .page-transition,
html.a11y-grayscale .lightbox,
html.a11y-grayscale .inscricoes-modal {
  filter: grayscale(1);
}

html.a11y-cb-protanopia:not(.a11y-grayscale) .header,
html.a11y-cb-protanopia:not(.a11y-grayscale) .mobile-menu__overlay,
html.a11y-cb-protanopia:not(.a11y-grayscale) .mobile-menu,
html.a11y-cb-protanopia:not(.a11y-grayscale) main,
html.a11y-cb-protanopia:not(.a11y-grayscale) .footer,
html.a11y-cb-protanopia:not(.a11y-grayscale) .back-to-top,
html.a11y-cb-protanopia:not(.a11y-grayscale) .whatsapp-float,
html.a11y-cb-protanopia:not(.a11y-grayscale) .page-transition,
html.a11y-cb-protanopia:not(.a11y-grayscale) .lightbox,
html.a11y-cb-protanopia:not(.a11y-grayscale) .inscricoes-modal {
  filter: url("#a11y-cb-protanopia");
}

html.a11y-cb-deuteranopia:not(.a11y-grayscale) .header,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .mobile-menu__overlay,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .mobile-menu,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) main,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .footer,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .back-to-top,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .whatsapp-float,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .page-transition,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .lightbox,
html.a11y-cb-deuteranopia:not(.a11y-grayscale) .inscricoes-modal {
  filter: url("#a11y-cb-deuteranopia");
}

html.a11y-cb-tritanopia:not(.a11y-grayscale) .header,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .mobile-menu__overlay,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .mobile-menu,
html.a11y-cb-tritanopia:not(.a11y-grayscale) main,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .footer,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .back-to-top,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .whatsapp-float,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .page-transition,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .lightbox,
html.a11y-cb-tritanopia:not(.a11y-grayscale) .inscricoes-modal {
  filter: url("#a11y-cb-tritanopia");
}

/* ─── Reduzir animações (espelha o media query existente) ───── */

html.a11y-reduce-motion {
  scroll-behavior: auto;
}

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

html.a11y-reduce-motion [data-reveal] {
  opacity: 1;
  transform: none;
  filter: none;
}

/* ─── Cursor ampliado ───────────────────────────────────────── */

@media (hover: hover) and (pointer: fine) {
  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 32 32'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='2' d='M4 3v22l6.2-6.4 3.6 8.6 3.4-1.4-3.6-8.6H22z'/%3E%3C/svg%3E") 4 2, auto !important;
  }
}

/* ─── VLibras no lado oposto ao FAB ─────────────────────────── */

[vw],
[vw-access-button],
div[vw-access-button],
.access-button,
#vlibras-access-wrapper {
  left: auto !important;
  right: max(1rem, env(safe-area-inset-right, 0px)) !important;
}

@media print {
  #a11y-root {
    display: none !important;
  }
}
