/* ========== Accessibility Widget - Israeli Standard SI 5568 / WCAG 2.0 AA ========== */

/* Toggle Button */
.a11y-toggle {
  position: fixed;
  bottom: 90px;
  left: 20px;
  z-index: 10000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1565c0;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: transform 0.2s, background 0.2s;
}

.a11y-toggle:hover,
.a11y-toggle:focus {
  transform: scale(1.1);
  background: #0d47a1;
  outline: 3px solid #ffd600;
}

.a11y-toggle svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

/* Panel */
.a11y-panel {
  position: fixed;
  bottom: 150px;
  left: 20px;
  z-index: 10001;
  width: 320px;
  max-height: 80vh;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  padding: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  direction: rtl;
  font-family: 'Heebo', 'Outfit', sans-serif;
}

.a11y-panel.open {
  display: flex;
}

.a11y-panel-header {
  background: #1565c0;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.a11y-panel-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.a11y-panel-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}

.a11y-panel-close:hover,
.a11y-panel-close:focus {
  outline: 2px solid #ffd600;
  border-radius: 4px;
}

.a11y-panel-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: calc(80vh - 60px);
}

.a11y-section-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  margin: 16px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.a11y-section-title:first-child {
  margin-top: 0;
}

/* Buttons Grid */
.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.a11y-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  color: #333;
  transition: all 0.15s;
  font-family: inherit;
  text-align: center;
  line-height: 1.3;
}

.a11y-btn:hover,
.a11y-btn:focus {
  border-color: #1565c0;
  background: #e3f2fd;
  outline: none;
}

.a11y-btn.active {
  border-color: #1565c0;
  background: #e3f2fd;
  color: #1565c0;
  font-weight: 600;
}

.a11y-btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* Font Size Controls */
.a11y-font-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.a11y-font-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  background: #fafafa;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}

.a11y-font-btn:hover,
.a11y-font-btn:focus {
  border-color: #1565c0;
  background: #e3f2fd;
  outline: none;
}

.a11y-font-size-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  min-width: 50px;
  text-align: center;
}

/* Reset Button */
.a11y-reset {
  width: 100%;
  padding: 10px;
  margin-top: 16px;
  border: 2px solid #e53935;
  border-radius: 10px;
  background: #fff;
  color: #e53935;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.a11y-reset:hover,
.a11y-reset:focus {
  background: #ffebee;
  outline: none;
}

/* Statement Link */
.a11y-statement-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 0.78rem;
  color: #1565c0;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 4px;
  width: 100%;
}

.a11y-statement-link:hover,
.a11y-statement-link:focus {
  color: #0d47a1;
  outline: 2px solid #1565c0;
  border-radius: 4px;
}

/* ========== Accessibility Modes ========== */

/* High Contrast */
body.a11y-high-contrast,
body.a11y-high-contrast * {
  background-color: #000 !important;
  color: #ffff00 !important;
  border-color: #ffff00 !important;
}

body.a11y-high-contrast a,
body.a11y-high-contrast a * {
  color: #00ffff !important;
}

body.a11y-high-contrast img {
  filter: contrast(1.5) !important;
}

body.a11y-high-contrast .a11y-panel,
body.a11y-high-contrast .a11y-panel * {
  background-color: revert !important;
  color: revert !important;
  border-color: revert !important;
}

body.a11y-high-contrast .a11y-panel-header,
body.a11y-high-contrast .a11y-panel-header * {
  background-color: #1565c0 !important;
  color: #fff !important;
}

body.a11y-high-contrast .a11y-toggle {
  background: #1565c0 !important;
  color: #fff !important;
}

/* Invert Colors */
body.a11y-invert {
  filter: invert(1) hue-rotate(180deg);
}

body.a11y-invert img,
body.a11y-invert video,
body.a11y-invert .a11y-panel,
body.a11y-invert .a11y-toggle {
  filter: invert(1) hue-rotate(180deg);
}

/* Grayscale */
body.a11y-grayscale {
  filter: grayscale(1);
}

body.a11y-grayscale .a11y-panel,
body.a11y-grayscale .a11y-toggle {
  filter: grayscale(0);
}

/* Highlight Links */
body.a11y-highlight-links a {
  outline: 3px solid #ff0 !important;
  outline-offset: 2px !important;
  text-decoration: underline !important;
}

body.a11y-highlight-links .a11y-panel a {
  outline: none !important;
}

/* Readable Font */
body.a11y-readable-font,
body.a11y-readable-font * {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.5px !important;
  word-spacing: 2px !important;
}

/* Big Cursor */
body.a11y-big-cursor,
body.a11y-big-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48'%3E%3Cpath d='M4 4l16 40 6-16 16-6z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
}

/* Stop Animations */
body.a11y-stop-animations,
body.a11y-stop-animations * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

body.a11y-stop-animations .marquee-track {
  animation: none !important;
}

/* Line Height */
body.a11y-line-height,
body.a11y-line-height * {
  line-height: 2 !important;
}

/* Letter Spacing */
body.a11y-letter-spacing,
body.a11y-letter-spacing * {
  letter-spacing: 2px !important;
  word-spacing: 4px !important;
}

/* Accessibility Statement Modal */
.a11y-statement-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10002;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.a11y-statement-modal.open {
  display: flex;
}

.a11y-statement-content {
  background: #fff;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  direction: rtl;
  font-family: 'Heebo', 'Outfit', sans-serif;
  color: #333;
  position: relative;
}

.a11y-statement-content h2 {
  color: #1565c0;
  margin: 0 0 16px;
  font-size: 1.3rem;
}

.a11y-statement-content p {
  margin: 0 0 12px;
  line-height: 1.8;
  font-size: 0.95rem;
}

.a11y-statement-content ul {
  padding-right: 20px;
  margin: 0 0 12px;
}

.a11y-statement-content li {
  margin-bottom: 6px;
  line-height: 1.6;
  font-size: 0.9rem;
}

.a11y-statement-close {
  position: absolute;
  top: 16px;
  left: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
}

.a11y-statement-close:hover,
.a11y-statement-close:focus {
  color: #000;
  outline: 2px solid #1565c0;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  .a11y-panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 100px;
  }

  .a11y-toggle {
    bottom: 90px;
    left: 12px;
    width: 44px;
    height: 44px;
  }

  .a11y-toggle svg {
    width: 24px;
    height: 24px;
  }
}

/* Skip to content link */
.skip-to-content {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  background: #1565c0;
  color: #fff;
  padding: 12px 24px;
  border-radius: 0 0 8px 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
  font-family: 'Heebo', sans-serif;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid #ffd600;
}
