/* ============================================================
   Zaya Thai Pantry — Accessibility Tools Widget
   WCAG 2.1 / 2.2 AA helper styles
   ============================================================ */

.a11y-widget-root {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  font-family: Arial, Verdana, sans-serif;
  font-size: 16px !important;
  pointer-events: none;
}

/*
  Site type uses px / clamp() / vw, so html font-size alone does not scale copy.
  Zoom the page (widget lives on <html>, so it stays the same size).
*/
html.a11y-text-scaled body {
  zoom: var(--a11y-text-scale, 1);
}

@supports not (zoom: 1) {
  html.a11y-text-scaled body {
    transform: scale(var(--a11y-text-scale, 1));
    transform-origin: top left;
    width: calc(100% / var(--a11y-text-scale, 1));
  }
}

.a11y-widget-trigger {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
  position: relative;
  z-index: 3;
}

.a11y-widget-trigger:hover,
.a11y-widget-trigger:focus-visible {
  background: #B4372A;
  outline: 3px solid #C9A44C;
  outline-offset: 2px;
}

.a11y-widget-trigger .fa-wheelchair {
  font-size: 24px;
  line-height: 1;
}

.a11y-widget-panel {
  pointer-events: auto;
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  width: min(320px, calc(100vw - 40px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d8d0c4;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(11, 15, 13, 0.22);
  padding: 0;
  z-index: 3;
}

.a11y-widget-panel.is-open {
  display: block;
}

.a11y-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #ede5d8;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.a11y-widget-title {
  font-size: 17px;
  font-weight: 700;
  color: #0B0F0D;
  margin: 0;
}

.a11y-widget-close {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #6b5e4e;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a11y-widget-close:hover,
.a11y-widget-close:focus-visible {
  background: #f5f0ea;
  outline: 2px solid #C9A44C;
}

.a11y-widget-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.a11y-widget-item {
  margin: 0;
}

.a11y-widget-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #16211B;
  text-align: left;
  transition: background 0.15s;
}

.a11y-widget-action:hover,
.a11y-widget-action:focus-visible {
  background: #f5f0ea;
  outline: none;
  box-shadow: inset 3px 0 0 #B4372A;
}

.a11y-widget-action[aria-pressed="true"] {
  background: #F2E6CF;
  font-weight: 600;
}

.a11y-widget-action svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  fill: #0B0F0D;
}

.a11y-widget-action--reset {
  color: #B4372A;
  border-top: 1px solid #ede5d8;
  margin-top: 4px;
}

.a11y-widget-status {
  padding: 8px 16px 12px;
  font-size: 12px;
  color: #6b5e4e;
  border-top: 1px solid #ede5d8;
}

.a11y-widget-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

.a11y-widget-overlay.is-visible {
  display: block;
}

.a11y-reading-guide {
  display: none;
  position: fixed;
  left: 0;
  width: 100%;
  height: 4px;
  background: #B4372A;
  box-shadow: 0 0 0 1px #0B0F0D, 0 2px 8px rgba(180, 55, 42, 0.5);
  z-index: 9997;
  pointer-events: none;
  transform: translateY(-50%);
}

.a11y-reading-guide.is-active {
  display: block;
}

html.a11y-readable-font,
html.a11y-readable-font body {
  font-family: Arial, Verdana, "Atkinson Hyperlegible", sans-serif !important;
}

html.a11y-readable-font h1,
html.a11y-readable-font h2,
html.a11y-readable-font h3,
html.a11y-readable-font h4,
html.a11y-readable-font .hero-title,
html.a11y-readable-font .hero-sub,
html.a11y-readable-font .dish h4,
html.a11y-readable-font .card h3 {
  font-family: Arial, Verdana, "Atkinson Hyperlegible", sans-serif !important;
}

html.a11y-underline-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

html.a11y-highlight-links a {
  background-color: #F2E6CF !important;
  color: #0B0F0D !important;
  padding: 0 2px;
  border-radius: 2px;
  box-decoration-break: clone;
}

html.a11y-highlight-headings h1,
html.a11y-highlight-headings h2,
html.a11y-highlight-headings h3,
html.a11y-highlight-headings h4,
html.a11y-highlight-headings h5,
html.a11y-highlight-headings h6 {
  background-color: #fffbe8 !important;
  color: #0B0F0D !important;
  padding: 0.15em 0.35em;
  border-left: 4px solid #B4372A;
  border-radius: 2px;
}

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

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

html.a11y-high-contrast .nav,
html.a11y-high-contrast .nav-top,
html.a11y-high-contrast .hero,
html.a11y-high-contrast .band,
html.a11y-high-contrast .dish,
html.a11y-high-contrast .card,
html.a11y-high-contrast .rev,
html.a11y-high-contrast .res > div,
html.a11y-high-contrast .drawer,
html.a11y-high-contrast .mbar,
html.a11y-high-contrast .foot,
html.a11y-high-contrast #pre {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4,
html.a11y-high-contrast .hero-title,
html.a11y-high-contrast .hero-sub {
  color: #fff !important;
}

html.a11y-high-contrast p,
html.a11y-high-contrast .hero-sub,
html.a11y-high-contrast .dish p,
html.a11y-high-contrast .card p {
  color: #e0e0e0 !important;
}

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

html.a11y-high-contrast .btn {
  background: #ffff00 !important;
  color: #000 !important;
  border: 2px solid #fff !important;
}

html.a11y-high-contrast .btn--ghost,
html.a11y-high-contrast .btn--cater {
  background: #000 !important;
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}

html.a11y-dark-mode body {
  background: #0B0F0D !important;
  color: #F4EEDF !important;
}

html.a11y-dark-mode .nav,
html.a11y-dark-mode .nav.solid {
  background: #101713 !important;
}

html.a11y-dark-mode .hero,
html.a11y-dark-mode .foot {
  background: #0B0F0D !important;
}

html.a11y-dark-mode .band,
html.a11y-dark-mode .drawer {
  background: #0B0F0D !important;
}

html.a11y-dark-mode .dish,
html.a11y-dark-mode .card,
html.a11y-dark-mode .res > div {
  background: #16211B !important;
  border-color: #3a4a3e !important;
  color: #F4EEDF !important;
}

html.a11y-dark-mode h1,
html.a11y-dark-mode h2,
html.a11y-dark-mode h3,
html.a11y-dark-mode h4,
html.a11y-dark-mode .hero-title {
  color: #fff !important;
}

html.a11y-dark-mode p,
html.a11y-dark-mode .dish p,
html.a11y-dark-mode .card p {
  color: #c8bfb5 !important;
}

html.a11y-enhanced-focus :focus-visible {
  outline: 3px solid #C9A44C !important;
  outline-offset: 3px !important;
}

@media (max-width: 900px) {
  .a11y-widget-root {
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 16px;
  }
}

@media (max-width: 480px) {
  .a11y-widget-root {
    left: 12px;
  }

  .a11y-widget-trigger {
    width: 48px;
    height: 48px;
  }

  .a11y-widget-panel {
    width: calc(100vw - 32px);
    max-height: 65vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a11y-widget-trigger,
  .a11y-widget-action {
    transition: none;
  }
}
