/* =========================================================
   Accessibility widget – אביר פרויקטים
   Self-contained. Authored in px so user text-scaling does
   not distort the widget UI itself.
   Page-wide adjustments are scoped to #a11y-content so the
   widget chrome is never affected by its own settings.
   ========================================================= */

/* ---------- Toggle button ---------- */
.a11y-fab {
  position: fixed;
  inset-block-end: 22px;
  inset-inline-end: 22px; /* opposite side from the WhatsApp button */
  z-index: 1600;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #1d4ed8; /* recognised "accessibility blue" */
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0;
}

.a11y-fab:hover {
  transform: scale(1.07);
}

.a11y-fab:focus-visible {
  outline: 3px solid #ffd400;
  outline-offset: 3px;
}

.a11y-fab svg {
  width: 34px;
  height: 34px;
}

/* ---------- Panel ---------- */
.a11y-panel {
  position: fixed;
  inset-block-end: 92px;
  inset-inline-end: 22px;
  z-index: 1601;
  width: min(360px, calc(100vw - 32px));
  max-height: min(78vh, 640px);
  background: #ffffff;
  color: #21252b;
  border: 1px solid #d7d2c8;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(20, 23, 27, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Heebo", "Segoe UI", system-ui, sans-serif;
  transform-origin: bottom left;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.a11y-panel.is-open {
  opacity: 1;
  transform: none;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .a11y-fab,
  .a11y-panel {
    transition: none;
  }
}

.a11y-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  background: #21252b;
  color: #fff;
}

.a11y-panel__head h2 {
  font-size: 17px;
  font-weight: 800;
  margin: 0;
  color: #fff;
}

.a11y-close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.a11y-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.a11y-close:focus-visible,
.a11y-tool:focus-visible,
.a11y-step:focus-visible,
.a11y-reset:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.a11y-panel__body {
  padding: 16px 18px 8px;
  overflow-y: auto;
}

.a11y-group {
  margin-bottom: 16px;
}

.a11y-group__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a6f78;
  margin: 0 0 8px;
}

/* Font stepper */
.a11y-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.a11y-step {
  flex: 1;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid #d7d2c8;
  background: #f5f3ef;
  color: #21252b;
  cursor: pointer;
}

.a11y-step:hover {
  border-color: #1d4ed8;
}

.a11y-step[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.a11y-step__val {
  min-width: 58px;
  text-align: center;
  font-weight: 800;
  font-size: 14px;
}

/* Tool grid */
.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.a11y-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1.5px solid #d7d2c8;
  background: #f5f3ef;
  color: #21252b;
  cursor: pointer;
  min-height: 78px;
  justify-content: center;
}

.a11y-tool:hover {
  border-color: #1d4ed8;
}

.a11y-tool svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.a11y-tool[aria-pressed="true"] {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.a11y-panel__foot {
  padding: 12px 18px 16px;
  border-top: 1px solid #e2ddd3;
}

.a11y-reset {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  border-radius: 10px;
  border: 1.5px solid #c0392b;
  background: #fff;
  color: #c0392b;
  cursor: pointer;
}

.a11y-reset:hover {
  background: #c0392b;
  color: #fff;
}

.a11y-note {
  font-size: 11px;
  color: #6a6f78;
  text-align: center;
  margin: 10px 0 0;
}

.a11y-note a {
  color: #1d4ed8;
}

/* =========================================================
   Page-wide adjustments (scoped to #a11y-content)
   ========================================================= */

/* Text scaling is applied via inline font-size % on <html>. */

/* Readable font */
html.a11y-readable #a11y-content,
html.a11y-readable #a11y-content *:not(svg):not(path) {
  font-family: Arial, "Heebo", "Segoe UI", sans-serif !important;
  letter-spacing: 0.01em;
}

/* Highlight links */
html.a11y-links #a11y-content a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  outline: 2px solid #1d4ed8 !important;
  outline-offset: 2px;
  background: #fff8d6 !important;
  color: #11349e !important;
  border-radius: 3px;
}

/* Highlight headings */
html.a11y-headings #a11y-content :is(h1, h2, h3, h4) {
  outline: 2px dashed #1d4ed8 !important;
  outline-offset: 4px;
  background: rgba(29, 78, 216, 0.06);
}

/* Increased line spacing */
html.a11y-line #a11y-content :is(p, li, a, span, blockquote, label, h1, h2, h3, h4, td) {
  line-height: 2.1 !important;
}

/* Increased letter spacing */
html.a11y-letter #a11y-content :is(p, li, a, span, blockquote, label, h1, h2, h3, h4) {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

/* Big cursor (global is 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 48 48'%3E%3Cpath d='M8 4 8 40 18 30 24 44 30 41 24 28 38 28 Z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E"),
    auto !important;
}

/* Stop animations */
html.a11y-stop #a11y-content *,
html.a11y-stop #a11y-content *::before,
html.a11y-stop #a11y-content *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* High contrast – override design tokens within the content wrapper */
html.a11y-hc #a11y-content {
  --stone: #000;
  --stone-2: #000;
  --white: #000;
  --charcoal: #fff;
  --charcoal-deep: #000;
  --charcoal-soft: #fff;
  --text: #fff;
  --text-muted: #fff;
  --text-on-dark: #fff;
  --text-on-dark-muted: #fff;
  --border: #fff;
  --gold: #ffd400;
  --gold-light: #ffd400;
  --gold-dark: #ffd400;
  --gold-text: #ffd400;
  background: #000 !important;
  color: #fff !important;
}

html.a11y-hc #a11y-content *:not(svg):not(path):not(img) {
  background-color: transparent !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html.a11y-hc #a11y-content a {
  color: #ffd400 !important;
  text-decoration: underline !important;
}

html.a11y-hc #a11y-content .btn {
  border: 2px solid #ffd400 !important;
  color: #ffd400 !important;
  background: #000 !important;
}

html.a11y-hc #a11y-content .hero::after,
html.a11y-hc #a11y-content .hero__media {
  display: none !important;
}
