/* BagrutPass "בקרוב" pages – accessibility menu (ת"י 5568). Used by index.html and accessibility.html.
   Mirrors the full site's widget: text size, two high-contrast themes, grayscale, link highlighting,
   readable font, stop animations. Settings are saved in this browser (localStorage). */

html {
  font-size: calc(100% * var(--a11y-font-scale, 1));
}

/* ---------- High contrast – dark ---------- */
html.a11y-contrast-dark {
  --bg: #000;
  --surface: #0d0d0d;
  --fg: #fff;
  --muted: #e6e6e6;
  --primary: #d8b4fe;
  --violet: #d8b4fe;
  --lavender: #e9d5ff;
  --accent: #34d399;
  --border: #e9d5ff;
}

/* ---------- High contrast – light ---------- */
html.a11y-contrast-light {
  --bg: #fff;
  --surface: #f6f3fb;
  --fg: #0b0a12;
  --muted: #3b3551;
  --primary: #6b21a8;
  --violet: #6b21a8;
  --lavender: #6b21a8;
  --accent: #065f46;
  --border: #6b21a8;
}

html.a11y-contrast-dark body::before,
html.a11y-contrast-dark body::after,
html.a11y-contrast-light body::before,
html.a11y-contrast-light body::after {
  display: none;
}

html.a11y-contrast-dark .gradient,
html.a11y-contrast-light .gradient {
  background: none;
  color: var(--lavender);
}

html.a11y-contrast-dark .notify,
html.a11y-contrast-dark .pill,
html.a11y-contrast-dark .input,
html.a11y-contrast-light .notify,
html.a11y-contrast-light .pill,
html.a11y-contrast-light .input {
  background: var(--surface);
  border-color: var(--border);
  backdrop-filter: none;
}

html.a11y-contrast-dark .btn,
html.a11y-contrast-light .btn {
  background: var(--primary);
  box-shadow: none;
}

html.a11y-contrast-dark .btn {
  color: #000;
}

html.a11y-contrast-light .btn {
  color: #fff;
}

html.a11y-contrast-light .error {
  color: #b91c1c;
}

html.a11y-contrast-light .emblem {
  filter: none;
}

/* ---------- Other modes ---------- */
html.a11y-grayscale {
  filter: grayscale(100%);
}

html.a11y-highlight-links a,
html.a11y-highlight-links button {
  text-decoration: underline !important;
  outline: 2px dashed #fde047 !important;
  outline-offset: 2px !important;
}

html.a11y-contrast-light.a11y-highlight-links a,
html.a11y-contrast-light.a11y-highlight-links button {
  outline-color: #b45309 !important;
}

html.a11y-readable-font body,
html.a11y-readable-font body * {
  font-family: Arial, 'Assistant', 'Segoe UI', Tahoma, sans-serif !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.16em !important;
  line-height: 1.7 !important;
}

html.a11y-stop-animations *,
html.a11y-stop-animations *::before,
html.a11y-stop-animations *::after {
  animation: none !important;
  transition: none !important;
}

/* ---------- The widget ---------- */
.a11y {
  position: fixed;
  bottom: 1rem;
  inset-inline-end: 1rem;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  font-family: 'Assistant', 'Rubik', system-ui, sans-serif;
}

.a11y-toggle {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 0.75rem 2rem -0.75rem rgba(147, 51, 234, 0.9);
}

html.a11y-contrast-dark .a11y-toggle {
  color: #000;
}

.a11y-toggle svg {
  width: 1.75rem;
  height: 1.75rem;
}

.a11y-panel {
  width: min(21rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  background: var(--surface);
  color: var(--fg);
  text-align: start;
  box-shadow: 0 1.5rem 3rem -1rem rgba(0, 0, 0, 0.7);
}

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

.a11y-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.a11y-head h2 {
  font-family: 'Rubik', system-ui, sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
}

.a11y-label {
  margin: 1rem 0 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.a11y-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.a11y-row output {
  flex: 1;
  text-align: center;
  font-weight: 700;
}

.a11y-btn,
.a11y-chip,
.a11y-switch,
.a11y-close {
  min-height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.a11y-btn,
.a11y-close {
  min-width: 2.75rem;
}

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

.a11y-close {
  border-color: transparent;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
}

.a11y-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.a11y-chip {
  padding: 0 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

.a11y-chip[aria-checked='true'] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

html.a11y-contrast-dark .a11y-chip[aria-checked='true'] {
  color: #000;
}

.a11y-switches {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.4rem;
}

.a11y-switch {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.85rem;
  font-size: 0.95rem;
  text-align: start;
}

.a11y-switch::after {
  content: '';
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--muted);
  border-radius: 0.3rem;
}

.a11y-switch[aria-checked='true'] {
  border-color: var(--primary);
}

.a11y-switch[aria-checked='true']::after {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 2px var(--surface);
}

.a11y-foot {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.a11y-foot a {
  color: var(--lavender);
  font-weight: 700;
}

.a11y-reset {
  padding: 0 0.85rem;
  font-size: 0.9rem;
}

.a11y-toggle:focus-visible,
.a11y-btn:focus-visible,
.a11y-chip:focus-visible,
.a11y-switch:focus-visible,
.a11y-close:focus-visible,
.a11y-foot a:focus-visible {
  outline: 3px solid var(--lavender);
  outline-offset: 2px;
}

html.a11y-contrast-dark .a11y-toggle:focus-visible,
html.a11y-contrast-dark .a11y-btn:focus-visible,
html.a11y-contrast-dark .a11y-chip:focus-visible,
html.a11y-contrast-dark .a11y-switch:focus-visible {
  outline-color: #ffe500;
}
