/* ============ ISRAELI ACCESSIBILITY (תקן 5568 / WCAG 2.1 AA) ============ */

:root { --a11y-font-scale: 1; }

/* Skip to content */
.skip-link {
  position: fixed;
  top: -100px;
  right: 16px;
  z-index: 10000;
  background: #ff9933;
  color: #0a0c10;
  padding: 12px 20px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Universal visible focus */
*:focus-visible {
  outline: 3px solid #ff9933 !important;
  outline-offset: 2px !important;
  border-radius: 3px;
}

/* Font scale */
body { font-size: calc(16px * var(--a11y-font-scale)); }

/* Readable font */
html.a11y-readable, html.a11y-readable * {
  font-family: "Arial", "Tahoma", sans-serif !important;
  letter-spacing: 0.02em;
}

/* Highlight links */
html.a11y-links a {
  background: #ffff00 !important;
  color: #000 !important;
  outline: 2px solid #000 !important;
  text-decoration: underline !important;
}

/* Underline links only */
html.a11y-underline a { text-decoration: underline !important; }

/* Highlight headings */
html.a11y-headings h1,
html.a11y-headings h2,
html.a11y-headings h3,
html.a11y-headings h4 {
  outline: 2px dashed #ff9933 !important;
  outline-offset: 4px !important;
  background: rgba(255, 153, 51, 0.08);
}

/* High contrast */
html.a11y-contrast-high body { background: #000 !important; color: #fff !important; }
html.a11y-contrast-high * {
  background-color: transparent !important;
  color: #fff !important;
  border-color: #fff !important;
}
html.a11y-contrast-high a, html.a11y-contrast-high a * { color: #ffff00 !important; }
html.a11y-contrast-high button, html.a11y-contrast-high input, html.a11y-contrast-high textarea {
  background: #000 !important; color: #fff !important; border: 1px solid #fff !important;
}

/* Inverted */
html.a11y-contrast-invert { filter: invert(1) hue-rotate(180deg); }
html.a11y-contrast-invert img, html.a11y-contrast-invert video, html.a11y-contrast-invert svg image { filter: invert(1) hue-rotate(180deg); }

/* Monochrome */
html.a11y-contrast-mono { filter: grayscale(1); }

/* Big cursor */
html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'><path d='M3 2l7 18 2-7 7-2z' fill='%23ff9933' stroke='%23000' stroke-width='1.5'/></svg>") 0 0, auto !important;
}

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

/* Respect prefers-reduced-motion globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ FAB ============ */
.a11y-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1d4ed8;
  color: white;
  border: 2px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.5);
  cursor: pointer;
  z-index: 9998;
  transition: transform 0.2s;
}
.a11y-fab:hover, .a11y-fab:focus-visible { transform: scale(1.05); }

/* ============ PANEL ============ */
.a11y-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  animation: a11yFade 0.2s ease;
}
@keyframes a11yFade { from { opacity: 0; } to { opacity: 1; } }

.a11y-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 380px;
  max-width: 92vw;
  height: 100vh;
  background: #fff;
  color: #111;
  z-index: 9999;
  box-shadow: -8px 0 32px rgba(0,0,0,0.3);
  transition: right 0.3s cubic-bezier(.2,.7,.2,1);
  display: flex;
  flex-direction: column;
  font-family: "Assistant", sans-serif;
  direction: rtl;
}
.a11y-panel.is-open { right: 0; }

.a11y-head {
  background: #1d4ed8;
  color: white;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.a11y-title { font-size: 20px; font-weight: 700; }
.a11y-sub { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.a11y-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.a11y-close:hover { background: rgba(255,255,255,0.25); }

.a11y-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 15px;
}

.a11y-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid #e5e7eb;
}
.a11y-row-label {
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
}
.a11y-row-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.a11y-row-controls button {
  background: #f3f4f6;
  border: 1.5px solid #d1d5db;
  color: #111;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.a11y-row-controls button:hover { background: #e5e7eb; }
.a11y-row-controls button.is-on {
  background: #1d4ed8;
  color: white;
  border-color: #1d4ed8;
}
.a11y-readout {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
  color: #1d4ed8;
}

.a11y-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.a11y-reset, .a11y-stmt-btn {
  background: white;
  border: 2px solid #1d4ed8;
  color: #1d4ed8;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.a11y-reset:hover, .a11y-stmt-btn:hover { background: #eff6ff; }

.a11y-note {
  font-size: 12px;
  color: #4b5563;
  background: #f9fafb;
  padding: 12px;
  border-radius: 6px;
  line-height: 1.6;
}
.a11y-note a { color: #1d4ed8; font-weight: 600; }

/* ============ STATEMENT MODAL ============ */
.a11y-stmt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: a11yFade 0.2s ease;
}
.a11y-stmt {
  background: white;
  color: #111;
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 8px;
  padding: 40px;
  position: relative;
  font-family: "Assistant", sans-serif;
  direction: rtl;
  line-height: 1.7;
}
.a11y-stmt h2 {
  margin: 0 0 8px;
  font-size: 28px;
  color: #1d4ed8;
}
.a11y-stmt h3 {
  margin: 24px 0 8px;
  font-size: 18px;
  color: #1f2937;
}
.a11y-stmt p { margin: 0 0 12px; color: #374151; }
.a11y-stmt-lead { font-size: 16px; color: #1f2937 !important; margin-bottom: 20px !important; }
.a11y-stmt ul { padding-right: 20px; margin: 0 0 12px; }
.a11y-stmt li { margin-bottom: 6px; color: #374151; }
.a11y-stmt a { color: #1d4ed8; }
.a11y-contact-list li strong { color: #111; min-width: 130px; display: inline-block; }
.a11y-stmt-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #f3f4f6;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}
.a11y-stmt-foot {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
  text-align: left;
}
.a11y-stmt-foot button {
  background: #1d4ed8;
  color: white;
  border: none;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
}

/* Footer link */
.footer-a11y-link {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
  padding: 0;
}
.footer-a11y-link:hover { color: #ff9933; }

@media (max-width: 600px) {
  .a11y-fab { bottom: 90px; right: 16px; width: 50px; height: 50px; }
  .a11y-stmt { padding: 28px 20px; }
}
