/* ============================================================
   Mães do Amor — Acessibilidade (painel + modos)
   ============================================================ */

.a11y-root {
  position: relative;
  z-index: 400;
}

.a11y-toggle {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 410;
  width: var(--float-size, 48px);
  height: var(--float-size, 48px);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md), 0 0 0 3px rgba(107, 53, 163, 0.22);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform var(--duration-fast) var(--ease-default),
              background var(--duration-fast) var(--ease-default),
              box-shadow var(--duration-fast) var(--ease-default);
}

.a11y-toggle:hover,
.a11y-toggle[aria-expanded="true"] {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}

.a11y-toggle:focus-visible {
  outline: 3px solid #F0A500;
  outline-offset: 3px;
}

.a11y-toggle svg {
  width: 26px;
  height: 26px;
  display: block;
}

.a11y-backdrop {
  position: fixed;
  inset: 0;
  z-index: 405;
  background: rgba(22, 16, 34, 0.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-default),
              visibility var(--duration-normal) var(--ease-default);
}

.a11y-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.a11y-panel {
  position: fixed;
  z-index: 420;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + var(--float-size, 48px) + 12px);
  width: min(392px, calc(100vw - 24px));
  max-height: min(78dvh, 680px);
  overflow: auto;
  background: var(--bg-white);
  color: var(--text-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-light);
  transform: translateY(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out),
              transform var(--duration-normal) var(--ease-out),
              visibility var(--duration-normal) var(--ease-out);
}

.a11y-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.a11y-panel-head {
  position: sticky;
  top: 0;
  z-index: 1;
  isolation: isolate;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  background:
    linear-gradient(180deg, #6B35A3 0%, #4A1C7A 100%);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.a11y-panel-head::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--gradient-pride);
}

.a11y-panel-kicker {
  margin: 0 0 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #F0E6FF;
}

.a11y-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1.15;
  color: #fff;
  letter-spacing: -0.02em;
}

.a11y-panel-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.a11y-panel-close:hover,
.a11y-panel-close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

.a11y-panel-close:focus-visible {
  outline: 3px solid #F0A500;
  outline-offset: 2px;
}

.a11y-panel-body {
  padding: 16px 16px 20px;
  display: grid;
  gap: 14px;
}

.a11y-group {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-light);
}

.a11y-group-title {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
}

.a11y-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.a11y-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(107, 53, 163, 0.22);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.a11y-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.a11y-btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.a11y-btn[aria-pressed="true"],
.a11y-btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.a11y-btn--grow { flex: 1 1 auto; }

.a11y-btn--reset {
  width: 100%;
  background: transparent;
  border-color: var(--color-secondary);
  color: var(--color-secondary-dark);
}

.a11y-btn--reset:hover {
  background: var(--color-secondary);
  color: #fff;
}

.a11y-status {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--text-medium);
  line-height: 1.45;
}

.a11y-status[data-tone="warn"] {
  color: #8A3416;
  font-weight: 600;
}

.a11y-hint {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: var(--text-medium);
  line-height: 1.45;
}

/* ── Modos aplicados ao site ── */
html.a11y-contrast {
  --text-dark: #000;
  --text-medium: #161616;
  --text-light: #242424;
  --bg-white: #fff;
  --bg-light: #fff;
  --color-primary: #4A1C7A;
  --color-primary-dark: #2D0F4F;
  --text-white-dim: #fff;
  --border-light: #111;
}

html.a11y-contrast body {
  background: #fff;
  color: #000;
}

html.a11y-contrast a[href] {
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.a11y-contrast .footer,
html.a11y-contrast .page-hero,
html.a11y-contrast .section--dark,
html.a11y-contrast .cta-section {
  background: #000 !important;
}

html.a11y-contrast .footer-link,
html.a11y-contrast .footer-desc,
html.a11y-contrast .footer-copy,
html.a11y-contrast .footer-heading,
html.a11y-contrast .footer-dev-link,
html.a11y-contrast .hero-subtitle,
html.a11y-contrast .page-hero-subtitle,
html.a11y-contrast .section-title--white,
html.a11y-contrast .cta-title,
html.a11y-contrast .cta-subtitle {
  color: #fff !important;
}

html.a11y-contrast .btn-pride,
html.a11y-contrast .btn-primary,
html.a11y-contrast .nav-cta {
  outline: 2px solid #000;
  outline-offset: 2px;
}

html.a11y-gray .navbar-main,
html.a11y-gray main,
html.a11y-gray .footer,
html.a11y-gray .whatsapp-float,
html.a11y-gray .back-to-top:not(.a11y-toggle),
html.a11y-gray .cookie-banner,
html.a11y-gray .progress-bar-top {
  filter: grayscale(1);
}

html.a11y-gray .donate-amount-btn.selected,
html.a11y-contrast .donate-amount-btn.selected {
  outline: 3px solid #111;
  outline-offset: 2px;
  font-weight: 800;
}

html.a11y-links a[href]:not(.a11y-toggle):not(.skip-link):not(.a11y-panel a) {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  box-shadow: 0 0 0 2px var(--color-primary);
  border-radius: 2px;
}

html.a11y-links button:not(.a11y-root button),
html.a11y-links [role="button"]:not(.a11y-root [role="button"]),
html.a11y-links input[type="submit"],
html.a11y-links .nav-cta {
  outline: 2px dashed var(--color-secondary);
  outline-offset: 3px;
}

html.a11y-space-1 {
  letter-spacing: 0.04em;
  word-spacing: 0.14em;
}

html.a11y-space-1 p,
html.a11y-space-1 li,
html.a11y-space-1 .section-subtitle,
html.a11y-space-1 .hero-subtitle,
html.a11y-space-1 .contact-label {
  line-height: 1.85;
}

html.a11y-space-2 {
  letter-spacing: 0.08em;
  word-spacing: 0.24em;
}

html.a11y-space-2 p,
html.a11y-space-2 li,
html.a11y-space-2 .section-subtitle,
html.a11y-space-2 .hero-subtitle,
html.a11y-space-2 .contact-label {
  line-height: 2.05;
}

html.a11y-readable,
html.a11y-readable body,
html.a11y-readable h1,
html.a11y-readable h2,
html.a11y-readable h3,
html.a11y-readable h4,
html.a11y-readable button,
html.a11y-readable input,
html.a11y-readable textarea,
html.a11y-readable select,
html.a11y-readable a {
  font-family: Verdana, Arial, Helvetica, sans-serif !important;
}

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;
  scroll-behavior: auto !important;
}

html.a11y-reduce-motion .hero-rays::before,
html.a11y-reduce-motion .hero-rays::after {
  animation: none !important;
}

html.a11y-font-lg,
html.a11y-font-xl {
  overflow-wrap: anywhere;
}

html.a11y-font-lg .pix-key,
html.a11y-font-xl .pix-key,
html.a11y-space-1 .pix-key,
html.a11y-space-2 .pix-key {
  overflow-wrap: normal !important;
  white-space: nowrap !important;
  letter-spacing: 0 !important;
}

html.a11y-font-lg .hero-title,
html.a11y-font-xl .hero-title,
html.a11y-font-lg .page-hero-title,
html.a11y-font-xl .page-hero-title {
  line-height: 1.15;
}

@media (max-width: 599px) {
  .a11y-panel {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: calc(max(12px, env(safe-area-inset-bottom, 0px)) + var(--float-size, 44px) + 10px);
    max-height: min(74dvh, 640px);
  }
}
