/* ווידג'ט העדפות נגישות - תקנה 35. שכבת CSS בלבד, ממותגת על <html>. */

#a11y-widget-trigger {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  z-index: 999;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: none;
  background: var(--blue, #1F5FA8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}
#a11y-widget-trigger:hover { background: var(--blue-dark, #164A87); }
#a11y-widget-trigger:focus-visible {
  outline: 2.5px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--blue, #1F5FA8);
}

#a11y-widget-panel {
  position: fixed;
  bottom: 86px;
  inset-inline-start: 24px;
  z-index: 999;
  width: min(320px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background: #fff;
  color: #1A1F24;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  padding: 18px;
  font-family: 'Heebo', 'Segoe UI', Tahoma, sans-serif;
}
#a11y-widget-panel h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.a11y-widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.a11y-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(62, 74, 86, 0.18);
  background: #F2F4F6;
  color: #1A1F24;
  cursor: pointer;
  font-family: inherit;
  text-align: right;
}
.a11y-toggle:hover { background: #e6e9ec; }
.a11y-toggle:focus-visible {
  outline: 2.5px solid var(--blue, #1F5FA8);
  outline-offset: 2px;
}
.a11y-toggle[aria-pressed="true"] {
  background: var(--blue, #1F5FA8);
  color: #fff;
  border-color: var(--blue, #1F5FA8);
}
.a11y-toggle-label { font-size: 13px; font-weight: 600; }
.a11y-toggle-state { font-size: 12px; opacity: 0.85; }

.a11y-reset {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(62, 74, 86, 0.3);
  background: #fff;
  color: #1A1F24;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.a11y-reset:hover { background: #F2F4F6; }
.a11y-reset:focus-visible {
  outline: 2.5px solid var(--blue, #1F5FA8);
  outline-offset: 2px;
}

/* היפוך/מונוכרום מכסה את כל הדף - הופכים גם את הווידג'ט בחזרה כדי שיישאר קריא ומבוטל-בר */
html.a11y-contrast-invert,
html.a11y-contrast-mono {
  filter: invert(1) hue-rotate(180deg);
}
html.a11y-contrast-mono { filter: grayscale(1); }
html.a11y-contrast-invert #a11y-widget-trigger,
html.a11y-contrast-invert #a11y-widget-panel {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-contrast-high {
  filter: contrast(1.35);
}

html.a11y-text-115 body { font-size: 115%; }
html.a11y-text-130 body { font-size: 130%; }
html.a11y-text-150 body { font-size: 150%; }

html.a11y-lines-160 body, html.a11y-lines-160 p { line-height: 1.6; }
html.a11y-lines-200 body, html.a11y-lines-200 p { line-height: 2; }

html.a11y-readable-font body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
}

html.a11y-highlight-headings h1,
html.a11y-highlight-headings h2,
html.a11y-highlight-headings h3 {
  outline: 2px dashed var(--blue, #1F5FA8);
  outline-offset: 4px;
  background: rgba(31, 95, 168, 0.08);
}

html.a11y-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
}

html.a11y-cursor-black, html.a11y-cursor-black * { cursor: default !important; }
html.a11y-cursor-big, html.a11y-cursor-big * { cursor: pointer !important; }

html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

@media print {
  #a11y-widget-trigger, #a11y-widget-panel { display: none !important; }
  html[class*="a11y-"] { filter: none !important; }
  html[class*="a11y-text-"] body { font-size: 100% !important; }
  html[class*="a11y-lines-"] body { line-height: normal !important; }
}
