/* ==========================================================================
   Accessibility widget — self-contained, matches the feature list published
   in privacy.html's Accessibility Statement. Preferences persist locally
   only (localStorage), never sent anywhere, matching that statement.
   ========================================================================== */

.a11y-widget { position: fixed; left: 18px; bottom: 18px; z-index: 500; font-family: var(--font); }

.a11y-toggle {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  color: var(--surface-text);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.22);
  transition: transform 0.25s ease;
}
.a11y-toggle:hover { transform: scale(1.06); }
.a11y-toggle svg { width: 26px; height: 26px; }

.a11y-panel {
  position: absolute;
  left: 0; bottom: 64px;
  width: min(320px, calc(100vw - 36px));
  max-height: min(74vh, 620px);
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--text);
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  padding: 18px;
}
.a11y-panel[hidden] { display: none; }

.a11y-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600;
  color: var(--label);
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.a11y-panel-head button { background: none; border: none; color: inherit; font-size: 20px; line-height: 1; padding: 0 4px; }

.a11y-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 13px; font-weight: 500; }
.a11y-btns { display: flex; gap: 6px; }
.a11y-btns button {
  width: 32px; height: 32px;
  border: 1px solid var(--text);
  background: none; color: var(--text);
  font-size: 12px; font-weight: 700;
}
.a11y-btns button:hover { background: var(--surface); color: var(--surface-text); border-color: var(--surface); }

.a11y-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  border: none; border-bottom: 1px solid var(--line);
  background: none; color: var(--text);
  padding: 10px 0;
  font-size: 13px; font-weight: 400; text-align: start;
}
.a11y-toggle-row .a11y-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--text); flex-shrink: 0; }
.a11y-toggle-row[aria-pressed="true"] { color: var(--accent); font-weight: 600; }
.a11y-toggle-row[aria-pressed="true"] .a11y-dot { background: var(--accent); border-color: var(--accent); }

.a11y-reset {
  margin-top: 14px;
  width: 100%;
  background: var(--surface); color: var(--surface-text);
  border: none; padding: 11px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.a11y-reset:hover { background: var(--accent); }

/* ---------- effects the toggles apply, site-wide ---------- */

html.a11y-high-contrast, html.a11y-high-contrast body {
  background: #000 !important; color: #fff !important;
}
html.a11y-high-contrast * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
html.a11y-high-contrast a, html.a11y-high-contrast button { text-decoration: underline !important; }
html.a11y-high-contrast img { filter: grayscale(1) contrast(1.2); }
html.a11y-high-contrast .frame img, html.a11y-high-contrast .photo-frame img, html.a11y-high-contrast .marquee-track img { filter: grayscale(1) contrast(1.4) !important; opacity: 1 !important; }

html.a11y-monochrome { filter: grayscale(1); }

html.a11y-highlight-links a { outline: 2px solid var(--accent) !important; outline-offset: 2px; background: rgba(237,36,127,0.12) !important; text-decoration: underline !important; }

html.a11y-highlight-headings h1, html.a11y-highlight-headings h2, html.a11y-highlight-headings h3,
html.a11y-highlight-headings .section-label, html.a11y-highlight-headings .hero h1,
html.a11y-highlight-headings .philosophy-quote, html.a11y-highlight-headings .service-name {
  outline: 2px dashed var(--accent) !important; outline-offset: 4px; background: rgba(133,197,105,0.12) !important;
}

html.a11y-dyslexia, html.a11y-dyslexia * {
  font-family: Verdana, Arial, 'Segoe UI', sans-serif !important;
  letter-spacing: 0.04em !important;
  line-height: 1.85 !important;
}

html.a11y-reading-mode body::before { display: none !important; }
html.a11y-reading-mode .frame { background: none !important; }
html.a11y-reading-mode * { opacity: 1 !important; }
html.a11y-reading-mode p, html.a11y-reading-mode li { max-width: 62ch; }

html.a11y-stop-animations *, html.a11y-stop-animations *::before, html.a11y-stop-animations *::after {
  animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important; scroll-behavior: auto !important;
}
html.a11y-stop-animations .reveal { opacity: 1 !important; transform: none !important; }

.a11y-reading-guide-bar {
  position: fixed; left: 0; right: 0; height: 34px;
  background: rgba(237,36,127,0.16);
  border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent);
  pointer-events: none; z-index: 400; display: none;
}
html.a11y-reading-guide .a11y-reading-guide-bar { display: block; }

@media (max-width: 480px) {
  .a11y-widget { left: 12px; bottom: 12px; }
  .a11y-toggle { width: 46px; height: 46px; }
}
