/* ===== ווידג'ט נגישות — גו לונדון ===== */

#a11y-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 100000;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #1E3A8A;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.25);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#a11y-toggle-btn:hover { transform: scale(1.08); box-shadow: 0 8px 30px rgba(0,0,0,0.45); }
#a11y-toggle-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

#a11y-panel {
  position: fixed;
  bottom: 84px;
  left: 20px;
  z-index: 100000;
  width: 340px;
  max-width: calc(100vw - 40px);
  max-height: min(640px, calc(100vh - 120px));
  overflow-y: auto;
  background: #14131f;
  color: #e2e8f0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  font-family: 'Heebo', system-ui, sans-serif;
  direction: rtl;
  display: none;
  flex-direction: column;
}
#a11y-panel.open { display: flex; }

#a11y-panel .a11y-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; background: #14131f; z-index: 1;
}
#a11y-panel .a11y-header h2 {
  font-size: 16px; font-weight: 900; color: #fff; display: flex; align-items: center; gap: 8px;
}
#a11y-panel .a11y-close {
  background: rgba(255,255,255,0.08); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#a11y-panel .a11y-close:hover { background: rgba(255,255,255,0.16); }

#a11y-panel .a11y-body { padding: 6px 18px 18px; }

.a11y-group { margin-top: 16px; }
.a11y-group h3 {
  font-size: 12px; font-weight: 800; color: rgba(255,255,255,0.45);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}
.a11y-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.a11y-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.a11y-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 8px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: #e2e8f0; font-family: 'Heebo', sans-serif; font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; text-align: center; line-height: 1.3;
}
.a11y-btn i { font-size: 17px; }
.a11y-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }
.a11y-btn:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.a11y-btn.active { background: #1E3A8A; border-color: #3b5bdb; color: #fff; }
.a11y-btn.active i { color: #93c5fd; }

.a11y-stepper {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 10px 14px;
}
.a11y-stepper span { font-size: 13px; font-weight: 700; }
.a11y-stepper .a11y-stepper-controls { display: flex; gap: 6px; }
.a11y-stepper button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06); color: #fff; font-size: 15px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.a11y-stepper button:hover { background: rgba(255,255,255,0.14); }

.a11y-reset {
  width: 100%; margin-top: 18px; padding: 12px; border-radius: 12px;
  background: rgba(220,38,38,0.12); border: 1px solid rgba(220,38,38,0.35);
  color: #f87171; font-family: 'Heebo', sans-serif; font-size: 13.5px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.a11y-reset:hover { background: rgba(220,38,38,0.2); }

.a11y-statement-link {
  display: block; text-align: center; margin-top: 14px; font-size: 12px;
  color: rgba(255,255,255,0.4); text-decoration: none;
}
.a11y-statement-link:hover { color: rgba(255,255,255,0.7); text-decoration: underline; }

.a11y-speech-controls { display: flex; gap: 8px; }
.a11y-speech-controls .a11y-btn { flex: 1; }

@media (max-width: 480px) {
  #a11y-panel { left: 10px; bottom: 78px; width: calc(100vw - 20px); }
  #a11y-toggle-btn { left: 12px; bottom: 12px; width: 48px; height: 48px; font-size: 20px; }
}

/* ===================================================== */
/* ===== מצבי נגישות פעילים — מוחלים על <html> ===== */
/* ===================================================== */

/* הגדלת/הקטנת טקסט */
html.a11y-fs-1 body { font-size: 108% !important; }
html.a11y-fs-2 body { font-size: 118% !important; }
html.a11y-fs-3 body { font-size: 130% !important; }

/* ריווח שורות */
html.a11y-lh body, html.a11y-lh body * { line-height: 1.9 !important; }

/* ריווח אותיות */
html.a11y-ls body, html.a11y-ls body * { letter-spacing: 0.06em !important; }

/* גופן קריא (ידידותי לדיסלקציה) */
html.a11y-readable-font body,
html.a11y-readable-font body * {
  font-family: Verdana, Arial, 'Heebo', sans-serif !important;
}

/* ניגודיות גבוהה */
html.a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}
html.a11y-contrast body * {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}
html.a11y-contrast body a,
html.a11y-contrast body button,
html.a11y-contrast body .btn {
  color: #ffeb3b !important;
  text-decoration: underline !important;
}
html.a11y-contrast body img,
html.a11y-contrast body .cat-emoji,
html.a11y-contrast body i.fa,
html.a11y-contrast body i.fas,
html.a11y-contrast body i.fab,
html.a11y-contrast body i.far {
  filter: none !important;
  opacity: 1 !important;
}

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

/* היפוך צבעים */
html.a11y-invert body { filter: invert(1) hue-rotate(180deg); }
html.a11y-invert body img,
html.a11y-invert body video,
html.a11y-invert body iframe {
  filter: invert(1) hue-rotate(180deg);
}

/* שילוב גווני אפור + היפוך */
html.a11y-grayscale.a11y-invert body { filter: grayscale(1) invert(1) hue-rotate(180deg); }

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

/* סמן עכבר מוגדל */
html.a11y-big-cursor, html.a11y-big-cursor * {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24"><path d="M4 2l16 8-6.5 2.5L11 19z" fill="black" stroke="white" stroke-width="1.2"/></svg>') 4 4, auto !important;
}

/* עצירת אנימציות */
html.a11y-pause-animations *,
html.a11y-pause-animations *::before,
html.a11y-pause-animations *::after {
  animation-play-state: paused !important;
  animation-duration: 0.001s !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* קו הכוונה לקריאה */
#a11y-reading-guide {
  position: fixed; left: 0; right: 0; height: 44px;
  background: rgba(255, 235, 59, 0.18);
  border-top: 2px solid rgba(255, 235, 59, 0.85);
  border-bottom: 2px solid rgba(255, 235, 59, 0.85);
  pointer-events: none; z-index: 99999; display: none;
}
#a11y-reading-guide.active { display: block; }

/* מצב הקראה פעיל — מדגיש שהעמוד מוקרא */
#a11y-toggle-btn.speaking { background: #16a34a; }
#a11y-toggle-btn.speaking::after {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid #4ade80; animation: a11y-pulse 1.4s ease-out infinite;
}
@keyframes a11y-pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.35); opacity: 0; }
}
