/* ============================================================
   accessibility.css — נגישות: ת"י 5568 / WCAG 2.1 AA
   ============================================================ */

/* ============================== Skip Link ============================== */
.skip-link {
  position: fixed;
  top: -120%;
  right: 50%;
  transform: translateX(50%);
  z-index: 10000;
  padding: 12px 28px;
  background: var(--accent);
  color: var(--dark);
  font-weight: 700;
  font-size: 15px;
  border-radius: 0 0 10px 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: top 0.15s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--dark);
  outline-offset: 2px;
}

/* ============================== Focus Ring ============================== */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
/* רקע כהה — טבעת focus צהובה */
.hero :focus-visible,
.footer :focus-visible,
.cta-band :focus-visible {
  outline-color: var(--accent);
  outline-offset: 4px;
}
/* הסרת outline ברירת מחדל — רק :focus-visible מציג */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================== כפתור צף (FAB) ============================== */
.a11y-fab {
  position: fixed;
  bottom: 40px;
  left: 24px;
  z-index: 8000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--dark);
  color: #fff;
  border: 2px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.a11y-fab:hover,
.a11y-fab--open {
  background: var(--accent);
  color: var(--dark);
  border-color: var(--accent);
}
.a11y-fab:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

/* ============================== פאנל הגדרות ============================== */
.a11y-panel {
  position: fixed;
  bottom: 104px;
  left: 24px;
  z-index: 8001;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 272px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.07);
  overflow: hidden;
  direction: rtl;
}

.a11y-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bone);
}
.a11y-panel-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
}

/* כפתור סגירה (X) */
.a11y-icon-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.a11y-icon-btn:hover { background: var(--line); color: var(--ink); }
.a11y-icon-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 50%; }

/* חלקים */
.a11y-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.a11y-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 10px;
}

/* גודל טקסט */
.a11y-size-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.a11y-size-btn {
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: var(--bone);
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.a11y-size-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--dark);
}
.a11y-size-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.a11y-size-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.a11y-size-label {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

/* Toggle שורה */
.a11y-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--ink-soft);
  text-align: right;
  direction: rtl;
  transition: color 0.15s;
}
.a11y-toggle:hover { color: var(--ink); }
.a11y-toggle--on { color: var(--ink); font-weight: 600; }
.a11y-toggle:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Toggle Track */
.a11y-toggle-track {
  flex-shrink: 0;
  width: 36px; height: 20px;
  border-radius: 10px;
  background: var(--line);
  position: relative;
  transition: background 0.2s;
}
.a11y-toggle--on .a11y-toggle-track { background: var(--ink); }

/* Toggle Thumb — RTL: מתחיל מצד ימין */
.a11y-toggle-thumb {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: right 0.2s;
}
/* כשהמצב פעיל — thumb עובר לצד שמאל */
.a11y-toggle--on .a11y-toggle-thumb { right: 18px; }

/* פס תחתון */
.a11y-panel-foot {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bone);
}
.a11y-reset-btn,
.a11y-stmt-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1.5px solid var(--line);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.a11y-reset-btn {
  background: #fff;
  color: var(--muted);
}
.a11y-reset-btn:hover { background: var(--line); color: var(--ink); }
.a11y-stmt-btn {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.a11y-stmt-btn:hover { background: var(--ink-soft); }
.a11y-reset-btn:focus-visible,
.a11y-stmt-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ============================== Overlay + Modal ============================== */
.a11y-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.a11y-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  direction: rtl;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.a11y-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.a11y-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.a11y-modal-body {
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
}
.a11y-modal-body h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0 6px;
  color: var(--ink);
}
.a11y-modal-body h3:first-child { margin-top: 0; }
.a11y-modal-body p { margin: 0 0 10px; }
.a11y-modal-body ul { margin: 0 0 10px; padding-right: 20px; }
.a11y-modal-body li { margin-bottom: 5px; }
.a11y-modal-body a { color: var(--ink); font-weight: 600; text-decoration: underline; }
.a11y-modal-body abbr, .a11y-modal-body code { font-size: 13px; }
.a11y-modal-meta {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-2);
}

/* ============================== Body Modifiers ============================== */

/* ניגודיות גבוהה */
body.a11y-contrast { filter: contrast(1.6) brightness(1.05); }

/* גווני אפור */
body.a11y-grayscale { filter: grayscale(100%); }

/* שניהם ביחד */
body.a11y-contrast.a11y-grayscale { filter: grayscale(100%) contrast(1.6); }

/* הדגשת קישורים */
body.a11y-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px !important;
}

/* עצור אנימציות */
body.a11y-no-anim *,
body.a11y-no-anim *::before,
body.a11y-no-anim *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ============================== Mobile ============================== */
@media (max-width: 720px) {
  .a11y-fab {
    bottom: 90px;
    left: 12px;
    width: 46px;
    height: 46px;
  }
  .a11y-panel {
    bottom: 148px;
    left: 8px;
    width: calc(100vw - 16px);
    max-width: 300px;
  }
  .a11y-overlay { padding: 12px; }
}
