/* ============================================================
   a11y.css — סרגל נגישות עצמאי (CSP-safe, same-origin)
   - כל האפקטים מופעלים ע"י מחלקות על <html> (a11y-*), שנשמרות
     ב-localStorage. ברירת מחדל = ללא מחלקות = האתר הרגיל, ללא
     שום שינוי למשתמש שלא ביקש נגישות.
   - ה-UI עצמו (#a11y-bar) מוחרג מכל אפקטי המצב.
   ============================================================ */

/* ---- הערת נגישות עליונה (קטנה, בראש כל דף) ---- */
.a11y-topbar {
  background: linear-gradient(135deg, #46331E, #574025);
  color: #fff; font-family: 'Heebo', sans-serif; direction: rtl;
  font-size: 0.84rem; line-height: 1.4; text-align: center;
  padding: 7px 44px 7px 16px; position: relative; z-index: 50;
}
.a11y-topbar .ic { font-size: 1rem; margin-inline-end: 4px; }
.a11y-topbar .a11y-topbar-close {
  position: absolute; inset-block-start: 50%; transform: translateY(-50%);
  inset-inline-end: 10px; background: rgba(255,255,255,0.18); border: none;
  color: #fff; cursor: pointer; width: 24px; height: 24px; border-radius: 6px;
  font-size: 0.9rem; line-height: 1;
}
.a11y-topbar .a11y-topbar-close:hover { background: rgba(255,255,255,0.34); }

/* ---- שיפור מבני קבוע (בלתי-נראה למשתמש עכבר) ---- */
.a11y-skip {
  position: absolute; right: 8px; top: -60px;
  background: #46331E; color: #fff; padding: 10px 18px;
  border-radius: 0 0 8px 8px; z-index: 100000;
  font-family: 'Heebo', sans-serif; font-weight: 700; text-decoration: none;
  transition: top 0.2s;
}
.a11y-skip:focus { top: 0; outline: 3px solid #ff0; }

:focus-visible {
  outline: 3px solid #6B4F2F !important;
  outline-offset: 2px;
}

/* ============================================================
   כפתור צף + פאנל
   ============================================================ */
/* 30/08/2026: הכפתור הזה נשאר כחול בכוונה — אורן ביקש במפורש "לחצן
   הנגישות עם הכיסא גלגלים הכחול... למטה בצד שמאל". כחול הוא צבע
   המוסכמה המזוהה של נגישות, וזהו חריג מכוון מפלטת החום-שמנת. סורק
   הצבעים (huescan) מחריג את #a11y-toggle — אל "תתקנו" אותו לחום. */
#a11y-toggle {
  position: fixed; inset-block-end: 20px; left: 20px; z-index: 99998;
  width: 66px; height: 66px; border-radius: 50%;
  border: 3px solid #fff; cursor: pointer;
  background: #0B5CAB;
  color: #fff; font-size: 2.3rem; line-height: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
#a11y-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(0,0,80,0.5); }
#a11y-toggle:focus-visible { outline: 3px solid #ff0 !important; outline-offset: 3px; }

#a11y-panel {
  position: fixed; inset-block-end: 98px; left: 20px; z-index: 99999;
  width: 300px; max-width: calc(100vw - 40px); max-height: 80vh; overflow-y: auto;
  background: #fff; color: #2A1F12; border: 1px solid #E5D9C3; border-radius: 14px;
  box-shadow: 0 10px 40px rgba(46,35,24,0.30);
  font-family: 'Heebo', sans-serif; direction: rtl;
  padding: 0 0 12px; display: none;
}
#a11y-panel.open { display: block; }

#a11y-panel .a11y-head {
  background: linear-gradient(135deg, #46331E, #574025); color: #fff;
  padding: 14px 18px; border-radius: 14px 14px 0 0;
  display: flex; align-items: center; justify-content: space-between;
}
#a11y-panel .a11y-head h2 { font-size: 1.05rem; margin: 0; }
#a11y-panel .a11y-close {
  background: rgba(255,255,255,0.15); border: none; color: #fff; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; font-size: 1.1rem; line-height: 1;
}
#a11y-panel .a11y-close:hover { background: rgba(255,255,255,0.3); }

#a11y-panel .a11y-section { padding: 12px 18px 0; }
#a11y-panel .a11y-section h3 { font-size: 0.82rem; color: #556; margin: 0 0 8px; font-weight: 700; }

#a11y-panel .a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#a11y-panel button.a11y-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; border: 2px solid #E5D9C3; border-radius: 10px;
  background: #F3EBDD; color: #2A1F12; cursor: pointer;
  font-family: 'Heebo', sans-serif; font-size: 0.82rem; font-weight: 600;
  text-align: center; transition: all 0.15s;
}
#a11y-panel button.a11y-opt .ic { font-size: 1.3rem; }
#a11y-panel button.a11y-opt:hover { border-color: #6B4F2F; }
#a11y-panel button.a11y-opt[aria-pressed="true"] {
  background: #6B4F2F; color: #fff; border-color: #46331E;
}
#a11y-panel .a11y-fontrow { display: flex; align-items: center; gap: 8px; }
#a11y-panel .a11y-fontrow button {
  flex: 1; padding: 12px; border: 2px solid #E5D9C3; border-radius: 10px;
  background: #F3EBDD; color: #2A1F12; cursor: pointer; font-size: 1.1rem; font-weight: 700;
  font-family: 'Heebo', sans-serif;
}
#a11y-panel .a11y-fontrow button:hover { border-color: #6B4F2F; }
#a11y-panel .a11y-fontrow .a11y-fontval { flex: 1; text-align: center; font-weight: 700; font-size: 0.9rem; }

#a11y-panel .a11y-reset {
  margin: 14px 18px 0; width: calc(100% - 36px);
  padding: 11px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, #DC2626, #EF4444); color: #fff;
  font-family: 'Heebo', sans-serif; font-weight: 700; font-size: 0.9rem;
}
#a11y-panel .a11y-reset:hover { opacity: 0.9; }
#a11y-panel .a11y-statement {
  display: block; text-align: center; margin: 12px 18px 0;
  font-size: 0.82rem; color: #6B4F2F; text-decoration: none;
}
#a11y-panel .a11y-statement:hover { text-decoration: underline; }

/* ============================================================
   אפקטי המצב — מופעלים ע"י מחלקות על <html>
   (כל ה-UI של הסרגל מוחרג כדי שלא יושפע)
   ============================================================ */

/* הדגשת קישורים */
html.a11y-links a:not(#a11y-bar a):not(.a11y-skip) {
  text-decoration: underline !important;
  text-underline-offset: 2px;
  outline: 1px dashed currentColor; outline-offset: 2px;
  font-weight: 700 !important;
}

/* פונט קריא + מרווחים */
html.a11y-readable body :not(#a11y-bar):not(#a11y-bar *) {
  font-family: Arial, 'Heebo', sans-serif !important;
  letter-spacing: 0.04em !important;
  word-spacing: 0.12em !important;
  line-height: 1.9 !important;
  font-style: normal !important;
}

/* עצירת אנימציות ותנועה */
html.a11y-noanim *:not(#a11y-bar):not(#a11y-bar *),
html.a11y-noanim *::before, html.a11y-noanim *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* סמן עכבר גדול (data-URI SVG; נופל ל-auto אם נחסם) */
html.a11y-bigcursor, html.a11y-bigcursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l16 7-7 2-2 7z' fill='%23fff' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") 4 4, auto !important;
}

/* ניגודיות גבוהה — סכמת שחור/לבן/צהוב אוניברסלית, מחריגה את הסרגל ושומרת תמונות */
html.a11y-contrast body,
html.a11y-contrast body *:not(#a11y-bar):not(#a11y-bar *):not(img):not(svg):not(svg *) {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.a11y-contrast a:not(#a11y-bar a):not(.a11y-skip),
html.a11y-contrast a:not(#a11y-bar a) * { color: #ffff00 !important; }
html.a11y-contrast input,
html.a11y-contrast textarea,
html.a11y-contrast select { background-color: #000 !important; color: #fff !important; border: 2px solid #fff !important; }
html.a11y-contrast img, html.a11y-contrast svg { filter: none !important; }

/* ── לראש הדף (04/10/2026, בקשת אורן: "לחצן עם חץ שמוביל לראש הדף", בצד ימין, מופיע אחרי גלילה)
   ימין פיזי בשתי השפות, מעל הכפתור של שולה (greeter_embed.php: bottom:16px, right:16px, ~48px גובה).
   נגישות (♿) יושב שמאל למטה — אין התנגשות. מוסתר עד שגוללים מסך אחד; a11y.js מדליק אותו. */
#oa-totop {
  position: fixed; bottom: 84px; left: auto; right: 16px; z-index: 1198;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid #E6DCC8;
  background: #FAF6EF; color: #2E2318; font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(46,35,24,.22);
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility 0s .2s;
}
#oa-totop.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
#oa-totop:hover { background: #F3EBDD; }
#oa-totop:focus-visible { outline: 3px solid #ff0; outline-offset: 3px; }
@media print { #oa-totop { display: none !important; } }

