/* ============================================================================
   נגישות - accessibility widget + accessibility modes
   ----------------------------------------------------------------------------
   Loaded by index.html, plan.html and accessibility.html. It owns two things:

   1. The floating toolbar (button + panel) that a11y.js injects into <body>.
   2. The user-selectable accessibility MODES, all driven by classes that
      a11y.js puts on <html>: a11y-contrast, a11y-links, a11y-noanim,
      a11y-font. Keeping them here - in one file, after the page's own
      stylesheet - is what lets them override site.css / plan.css without
      touching either.

   This file is the LAST stylesheet on every page. Do not reorder it: the
   mode overrides below rely on being able to win on cascade order, which is
   also why they can stay mostly free of !important.
   ========================================================================= */

/* ---------- shared helper: text for screen readers only ---------- */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- the launcher button ----------
   Sits on the side OPPOSITE the WhatsApp button (which is inset-inline-start),
   so the two never overlap in RTL or in LTR. 52px square on desktop and 48px
   on phones, both comfortably over the 44px minimum touch target. */
.a11y-fab {
  position: fixed; bottom: 1.6rem; inset-inline-end: 1.6rem; z-index: 90;
  width: 52px; height: 52px; min-width: 44px; min-height: 44px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35);
  background: #1c3a8f; color: #fff;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s, background 0.25s;
}
.a11y-fab:hover { background: #234ab5; transform: scale(1.06); }
.a11y-fab svg { display: block; width: 28px; height: 28px; }

/* ---------- the panel ----------
   position: fixed and sized with min(), so on a phone it becomes a nearly
   full-width sheet ABOVE the button rather than a box that hangs off the
   screen edge. max-height + overflow keeps it scrollable on short screens,
   which is what stops it covering the page content it is meant to help with. */
.a11y-panel {
  position: fixed; z-index: 91;
  bottom: calc(1.6rem + 62px); inset-inline-end: 1.6rem;
  width: min(320px, calc(100vw - 2rem));
  max-height: min(70vh, 560px); overflow-y: auto;
  background: #14100d; color: #f5efe6;
  border: 1px solid rgba(201, 163, 92, 0.45); border-radius: 14px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  font-family: 'Assistant', system-ui, sans-serif; font-size: 0.95rem; line-height: 1.5;
}
.a11y-panel[hidden] { display: none !important; }
.a11y-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  margin-bottom: 0.8rem; padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(201, 163, 92, 0.25);
}
.a11y-panel-head h2 {
  font-family: 'Frank Ruhl Libre', Georgia, serif;
  font-size: 1.1rem; font-weight: 700; margin: 0;
}
.a11y-close {
  background: none; border: 1px solid rgba(201, 163, 92, 0.35); color: #f5efe6;
  border-radius: 8px; min-width: 44px; min-height: 44px; cursor: pointer;
  font-size: 1.1rem; line-height: 1;
}
.a11y-close:hover { border-color: #c9a35c; color: #e8cf9b; }

.a11y-group { margin-bottom: 0.55rem; }
.a11y-group-label { font-size: 0.8rem; color: #cbbfad; margin-bottom: 0.3rem; }
.a11y-row { display: flex; align-items: center; gap: 0.5rem; }
/* Every control is a real <button>, so it is keyboard reachable and operable
   with no extra scripting, and every one of them clears 44px. */
.a11y-panel button.a11y-opt {
  display: flex; align-items: center; gap: 0.55rem;
  width: 100%; min-height: 44px;
  background: #1a1510; border: 1px solid rgba(201, 163, 92, 0.28);
  border-radius: 10px; padding: 0.5rem 0.75rem;
  color: #f5efe6; font-family: inherit; font-size: 0.92rem; text-align: start;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.a11y-panel button.a11y-opt:hover { border-color: #c9a35c; background: #221b14; }
.a11y-panel button.a11y-opt[aria-pressed="true"] {
  background: #c9a35c; border-color: #c9a35c; color: #1a1206; font-weight: 600;
}
.a11y-opt-ico { flex: none; width: 1.35em; text-align: center; }
.a11y-fs {
  display: flex; align-items: stretch; gap: 0.4rem;
}
.a11y-fs button.a11y-opt { justify-content: center; }
.a11y-fs-value {
  flex: none; display: grid; place-items: center; min-width: 4.2em; min-height: 44px;
  border: 1px solid rgba(201, 163, 92, 0.28); border-radius: 10px;
  font-variant-numeric: tabular-nums; font-size: 0.9rem; color: #e8cf9b;
}
.a11y-reset { margin-top: 0.6rem; }
.a11y-panel .a11y-statement-link {
  display: block; margin-top: 0.8rem; font-size: 0.85rem;
  color: #e8cf9b; text-decoration: underline;
}

/* Focus must always be visible, on both surfaces. */
.a11y-fab:focus-visible,
.a11y-panel :focus-visible {
  outline: 3px solid #ffd166; outline-offset: 2px; border-radius: 8px;
}

@media (max-width: 760px) {
  .a11y-fab { width: 48px; height: 48px; bottom: 1rem; inset-inline-end: 1rem; }
  .a11y-fab svg { width: 26px; height: 26px; }
  .a11y-panel {
    inset-inline: 0.75rem; width: auto;
    bottom: calc(1rem + 56px); max-height: 62vh;
  }
}

/* ============================================================================
   MODE: font size
   The scale is applied by a11y.js as a font-size on <html>, so every rem in
   site.css / plan.css follows it. plan.css pins the body to 15.5px, which
   would ignore that, so it is switched back to rem while scaling is active.
   ========================================================================= */
html[data-a11y-fs] body { font-size: 1rem; }

/* ============================================================================
   MODE: high contrast
   Near-black background, pure-white text, yellow for links and accents -
   all well past 7:1. Decorative gradients, washes, watermarks and the hero
   media are dropped, because unpredictable imagery behind text is exactly
   what a contrast mode exists to remove.
   ========================================================================= */
html.a11y-contrast body,
html.a11y-contrast {
  background: #000 !important;
  background-image: none !important;
  color: #fff !important;
}
html.a11y-contrast * {
  background-image: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  color: #fff !important;
}
html.a11y-contrast a,
html.a11y-contrast .a11y-statement-link { color: #ffe873 !important; text-decoration: underline !important; }
html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3,
html.a11y-contrast h4, html.a11y-contrast .hero-title,
html.a11y-contrast .kpi-value, html.a11y-contrast .section-kicker,
html.a11y-contrast .hero-kicker {
  color: #ffe873 !important;
  /* the hero title paints its text through a gradient clip; undo that or it
     stays transparent and the headline disappears in contrast mode */
  -webkit-text-fill-color: #ffe873;
  background: none !important;
}
html.a11y-contrast button,
html.a11y-contrast .btn,
html.a11y-contrast .pbtn,
html.a11y-contrast input,
html.a11y-contrast select,
html.a11y-contrast textarea {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}
html.a11y-contrast button:hover,
html.a11y-contrast .btn:hover,
html.a11y-contrast .pbtn:hover { background: #ffe873 !important; color: #000 !important; }
html.a11y-contrast button:hover *,
html.a11y-contrast .btn:hover *,
html.a11y-contrast .pbtn:hover * { color: #000 !important; }
html.a11y-contrast section,
html.a11y-contrast .pcard, html.a11y-contrast .kpi, html.a11y-contrast .vcard,
html.a11y-contrast .lead-form, html.a11y-contrast .login-card,
html.a11y-contrast .phead, html.a11y-contrast #site-header,
html.a11y-contrast .a11y-panel {
  background: #000 !important;
  border-color: #fff !important;
}
/* the hero media and every purely decorative layer */
html.a11y-contrast .hero-bg,
html.a11y-contrast .hero-bg-fill,
html.a11y-contrast .hero-video,
html.a11y-contrast .hero-glow,
html.a11y-contrast #particles,
html.a11y-contrast .hero::after,
html.a11y-contrast .portal::before,
html.a11y-contrast .marquee { display: none !important; }
html.a11y-contrast :focus-visible { outline: 3px solid #ffe873 !important; outline-offset: 2px; }
/* the skip link and the gold chips are dark-on-gold by design, which inverts
   badly once every colour is forced - given their own treatment */
html.a11y-contrast .skip-link,
html.a11y-contrast .toast,
html.a11y-contrast .announce-banner,
html.a11y-contrast .chip {
  background: #000 !important; color: #ffe873 !important; border: 2px solid #ffe873 !important;
}
/* the launcher has to stay findable against pure black */
html.a11y-contrast .a11y-fab { background: #000 !important; border: 2px solid #ffe873 !important; }
html.a11y-contrast .a11y-fab svg { color: #ffe873 !important; }
html.a11y-contrast .a11y-panel button.a11y-opt[aria-pressed="true"] {
  background: #ffe873 !important; color: #000 !important; border-color: #ffe873 !important;
}

/* ============================================================================
   MODE: underline links
   ========================================================================= */
html.a11y-links a { text-decoration: underline !important; text-underline-offset: 0.18em; }
html.a11y-links a:focus-visible { text-decoration-thickness: 2px; }

/* ============================================================================
   MODE: stop animations
   Mirrors what the prefers-reduced-motion blocks already do, for visitors who
   want it switched on per-site rather than system-wide. a11y.js additionally
   pauses the hero video and the testimonial rotation, which CSS cannot.
   ========================================================================= */
html.a11y-noanim *,
html.a11y-noanim *::before,
html.a11y-noanim *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html.a11y-noanim { scroll-behavior: auto !important; }
html.a11y-noanim #particles,
html.a11y-noanim .scroll-cue span { display: none !important; }
html.a11y-noanim .marquee-track { transform: none !important; }
/* animations that start from opacity:0 would otherwise stay invisible forever */
html.a11y-noanim .reveal,
html.a11y-noanim .reveal-item,
html.a11y-noanim .reveal-hero { opacity: 1 !important; transform: none !important; }
html.a11y-noanim .section-title .st-mask { clip-path: none !important; transform: none !important; }

/* ============================================================================
   MODE: readable font
   Locally available, widely installed sans-serif faces only - no webfont, no
   CDN. Arial/Helvetica carry full Hebrew coverage on every mainstream OS.
   ========================================================================= */
html.a11y-font,
html.a11y-font body,
html.a11y-font button,
html.a11y-font input,
html.a11y-font select,
html.a11y-font textarea,
html.a11y-font h1, html.a11y-font h2, html.a11y-font h3, html.a11y-font h4,
html.a11y-font .hero-title, html.a11y-font .section-title,
html.a11y-font .brand-name, html.a11y-font .footer-brand,
html.a11y-font .tstm-text, html.a11y-font .kpi-value,
html.a11y-font .phead-title, html.a11y-font .clgroup-title {
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif !important;
  letter-spacing: normal !important;
}
html.a11y-font { font-weight: 400; }
html.a11y-font body { font-weight: 400; }
