/* ================================================================
   Accessibility Widget — WCAG 2.1 AA
   Afikim Nadlan / Mordi Oz sites
   ================================================================ */

/* Skip link (used on pages that don't load styles.css) */
.skip-link {
  position: absolute;
  top: -999px;
  left: 50%;
  transform: translateX(-50%);
  background: #c79a36;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  text-decoration: none;
  z-index: 99999;
}
.skip-link:focus {
  top: 0;
}

/* Screen-reader helper */
.acc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Floating trigger button ── */
.acc-trigger {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 9998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #c79a36;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  line-height: 1;
}
.acc-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}
.acc-trigger:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.acc-trigger svg,
.acc-trigger i {
  width: 24px;
  height: 24px;
  pointer-events: none;
}

/* ── Dialog panel ── */
.acc-panel {
  position: fixed;
  bottom: calc(1.5rem + 64px);
  left: 1.5rem;
  z-index: 9999;
  width: min(316px, calc(100vw - 3rem));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 56px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow: hidden;
  direction: rtl;
  font-family: system-ui, -apple-system, sans-serif;
}
.acc-panel.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Panel header */
.acc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: #10233f;
  color: #fff;
}
.acc-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #c79a36;
}
.acc-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  padding: 0;
  transition: background 0.15s;
}
.acc-close:hover {
  background: rgba(255, 255, 255, 0.15);
}
.acc-close:focus-visible {
  outline: 2px solid #c79a36;
}
.acc-close svg,
.acc-close i {
  width: 18px;
  height: 18px;
}

/* Body */
.acc-body {
  padding: 0.75rem;
}

/* Grid of toggles */
.acc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.acc-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.55rem 0.35rem;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  color: #333;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  min-height: 62px;
}
.acc-btn svg,
.acc-btn i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.acc-btn:hover {
  background: #f0f0f0;
  border-color: #c79a36;
}
.acc-btn.active {
  background: #10233f;
  border-color: #c79a36;
  color: #c79a36;
}
.acc-btn:focus-visible {
  outline: 2px solid #c79a36;
  outline-offset: 2px;
}

/* Text size controls */
.acc-controls {
  border-top: 1px solid #f0f0f0;
  padding-top: 0.6rem;
  margin-bottom: 0.65rem;
}
.acc-controls-label {
  display: block;
  font-size: 0.7rem;
  color: #666;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.acc-resize-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}
.acc-resize-group button {
  background: transparent;
  border: none;
  width: 44px;
  height: 36px;
  cursor: pointer;
  font-size: 1.1rem;
  color: #10233f;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.acc-resize-group button:hover {
  background: #c79a36;
  color: #fff;
}
.acc-resize-group button:focus-visible {
  outline: 2px solid #c79a36;
}
#textSizeDisplay {
  font-size: 0.78rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  min-width: 48px;
}

/* Footer */
.acc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f0f0f0;
  padding-top: 0.6rem;
  gap: 0.4rem;
}
.acc-accessibility-link {
  font-size: 0.7rem;
  color: #10233f;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}
.acc-accessibility-link:hover {
  color: #c79a36;
}
.acc-accessibility-link:focus-visible {
  outline: 2px solid #c79a36;
}
.acc-reset {
  background: transparent;
  border: 1.5px solid #e5e5e5;
  border-radius: 6px;
  padding: 0.28rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.acc-reset:hover {
  border-color: #c79a36;
  color: #c79a36;
}
.acc-reset:focus-visible {
  outline: 2px solid #c79a36;
}

/* ================================================================
   Document-level mode classes (applied to <html> element)
   ================================================================ */

/* High Contrast */
.acc-mode-contrast,
.acc-mode-contrast body {
  background: #000 !important;
  color: #fff !important;
}
.acc-mode-contrast a { color: #ffff00 !important; }
.acc-mode-contrast button,
.acc-mode-contrast input,
.acc-mode-contrast select,
.acc-mode-contrast textarea {
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}

/* Invert colors */
.acc-mode-invert { filter: invert(1) hue-rotate(180deg); }
.acc-mode-invert img,
.acc-mode-invert video { filter: invert(1) hue-rotate(180deg); }

/* Grayscale */
.acc-mode-grayscale { filter: grayscale(100%); }

/* Highlight links */
.acc-mode-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  outline: 2px solid currentColor !important;
  outline-offset: 2px !important;
}

/* Readable font */
.acc-mode-font,
.acc-mode-font * {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.03em !important;
  line-height: 1.85 !important;
}

/* Hide images */
.acc-mode-hide-images img,
.acc-mode-hide-images video,
.acc-mode-hide-images figure { opacity: 0 !important; visibility: hidden !important; }

/* Big cursor */
.acc-mode-cursor-big,
.acc-mode-cursor-big * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M4 0L4 30L11 23L17 34L21 32L15 21L24 21Z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E"), auto !important;
}

/* Reduce motion */
.acc-mode-reduce-motion *,
.acc-mode-reduce-motion *::before,
.acc-mode-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}
