/* ================================================================ */
/* BERKO ACCESSIBILITY WIDGET                                        */
/* תקנות שוויון זכויות לאנשים עם מוגבלות (התאמות נגישות לשירות),    */
/* תשע"ג-2013 / ת"י 5568 / WCAG 2.0 AA                              */
/* ================================================================ */

/* Skip-link — מופיע ב-focus בלבד */
.a11y-skip {
  position: fixed;
  top: -100px;
  right: 16px;
  z-index: 100000;
  background: #1E3B2A;
  color: #fff;
  padding: 12px 20px;
  border-radius: 6px;
  font-family: 'Heebo', sans-serif;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transition: top .2s ease;
}
.a11y-skip:focus,
.a11y-skip:focus-visible {
  top: 16px;
  outline: 3px solid #C9A961;
  outline-offset: 2px;
}

/* Focus visible global — חובה לפי תקן */
*:focus-visible {
  outline: 3px solid #C9A961 !important;
  outline-offset: 2px !important;
}

/* FAB — כפתור צף */
.a11y-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1E3B2A;
  color: #fff;
  border: 2px solid #fff;
  cursor: pointer;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease;
  padding: 0;
}
.a11y-fab:hover,
.a11y-fab:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.a11y-fab svg {
  width: 30px;
  height: 30px;
  fill: #fff;
}
.a11y-fab[aria-expanded="true"] {
  background: #14281C;
}

/* Panel */
.a11y-panel {
  position: fixed;
  bottom: 92px;
  left: 24px;
  width: 340px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 120px);
  background: #fff;
  color: #1a1a1a;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
  z-index: 99998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Heebo', sans-serif;
  direction: rtl;
}
.a11y-panel[data-open="true"] {
  display: flex;
}
.a11y-panel__head {
  background: #1E3B2A;
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.a11y-panel__title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}
.a11y-panel__close {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  padding: 0;
}
.a11y-panel__close:hover { background: rgba(255,255,255,.15); }

.a11y-panel__body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.a11y-panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.a11y-panel__section-title {
  font-size: 12px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 12px 0 8px;
  padding: 0 4px;
}
.a11y-panel__section-title:first-child { margin-top: 0; }

.a11y-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: #f5f5f5;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Heebo', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
  transition: all .15s ease;
  min-height: 72px;
}
.a11y-toggle:hover {
  background: #eaeaea;
}
.a11y-toggle[aria-pressed="true"] {
  background: #1E3B2A;
  color: #fff;
  border-color: #C9A961;
}
.a11y-toggle__icon {
  font-size: 20px;
  line-height: 1;
}
.a11y-toggle__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
}

.a11y-panel__reset {
  display: block;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 2px solid #b3261e;
  color: #b3261e;
  border-radius: 8px;
  font-family: 'Heebo', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 8px;
}
.a11y-panel__reset:hover {
  background: #b3261e;
  color: #fff;
}

.a11y-panel__statement {
  display: block;
  text-align: center;
  margin-top: 12px;
  padding: 10px;
  color: #1E3B2A;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border-top: 1px solid #eee;
}
.a11y-panel__statement:hover { text-decoration: underline; }

/* Body-level modifier classes — מופעלים על <html> */
.a11y-fs-110 { font-size: 110% !important; }
.a11y-fs-125 { font-size: 125% !important; }
.a11y-fs-150 { font-size: 150% !important; }
.a11y-fs-200 { font-size: 200% !important; }

.a11y-contrast-high,
.a11y-contrast-high body {
  background: #000 !important;
  color: #fff !important;
}
.a11y-contrast-high *:not(.a11y-fab):not(.a11y-fab *):not(.a11y-panel):not(.a11y-panel *):not(.a11y-skip) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
.a11y-contrast-high a:not(.a11y-fab):not(.a11y-panel *):not(.a11y-skip) {
  color: #ffff00 !important;
}

.a11y-invert {
  filter: invert(1) hue-rotate(180deg);
}
.a11y-invert .a11y-fab,
.a11y-invert .a11y-panel,
.a11y-invert .a11y-skip,
.a11y-invert img,
.a11y-invert video,
.a11y-invert picture,
.a11y-invert [style*="background-image"] {
  filter: invert(1) hue-rotate(180deg);
}

.a11y-grayscale {
  filter: grayscale(1);
}
.a11y-grayscale .a11y-fab,
.a11y-grayscale .a11y-panel { filter: none; }

.a11y-links-highlighted a:not(.a11y-fab):not(.a11y-panel *):not(.a11y-skip) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  background-color: #fff3a3 !important;
  color: #003a8c !important;
  padding: 0 2px !important;
  border-radius: 2px !important;
}

.a11y-headings-highlighted h1,
.a11y-headings-highlighted h2,
.a11y-headings-highlighted h3 {
  outline: 2px dashed #C9A961 !important;
  outline-offset: 4px !important;
  background-color: rgba(201,169,97,.08) !important;
}

.a11y-readable-font,
.a11y-readable-font * {
  font-family: 'Heebo', Arial, sans-serif !important;
  font-style: normal !important;
}

.a11y-no-motion *,
.a11y-no-motion *::before,
.a11y-no-motion *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  animation-iteration-count: 1 !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

.a11y-big-cursor,
.a11y-big-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'><path d='M4 2 L4 38 L14 28 L20 42 L26 40 L20 26 L34 26 Z' fill='%23000' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/></svg>") 4 2, auto !important;
}

/* Mobile FAB */
@media (max-width: 480px) {
  .a11y-fab { width: 48px; height: 48px; bottom: 16px; left: 16px; }
  .a11y-fab svg { width: 26px; height: 26px; }
  .a11y-panel { bottom: 76px; left: 16px; width: calc(100vw - 32px); }
}

/* Reduced motion preference — auto-apply */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
