/* =============================================
   Accessibility Widget — תקן ישראלי 5568 / WCAG 2.1 AA
   O&Y Studio — editorial black/white aesthetic
============================================= */

/* Trigger — bottom-left floating FAB, matches site's editorial dark-glass aesthetic */
.a11y-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(28, 24, 48, 0.92), rgba(18, 16, 32, 0.96));
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(245, 217, 123, 0.32);
  border-radius: 50%;
  box-shadow: 0 14px 36px -10px rgba(120, 80, 200, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 91;
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 220ms ease,
              box-shadow 220ms ease,
              background 220ms ease;
}
.a11y-trigger:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: rgba(245, 217, 123, 0.62);
  box-shadow: 0 18px 44px -10px rgba(120, 80, 200, 0.6), 0 3px 8px rgba(0, 0, 0, 0.45);
  background: linear-gradient(135deg, rgba(36, 30, 56, 0.94), rgba(22, 20, 38, 0.98));
}
.a11y-trigger:focus-visible { outline: 2px solid rgba(245, 217, 123, 0.85); outline-offset: 3px; }
.a11y-trigger svg { width: 22px; height: 22px; }

/* Panel — opens from the same corner as the trigger (bottom-left) */
.a11y-panel {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  width: min(360px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.18);
  z-index: 110;
  padding: 1.5rem 1.5rem 1.25rem;
  transform: translateY(120%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
  direction: rtl;
  font-family: 'Work Sans', 'Heebo', system-ui, sans-serif;
}
.a11y-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.a11y-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 1rem; margin-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.a11y-panel-head h3 {
  font: 600 1.05rem/1.3 inherit;
  margin: 0;
  color: #1a1a1a;
}
.a11y-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #f4f4f5;
  color: #1a1a1a;
  border: none;
  cursor: pointer;
  font: 600 14px/1 inherit;
  transition: background 0.25s ease, color 0.25s ease;
}
.a11y-close:hover { background: #1a1a1a; color: #fff; }
.a11y-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  margin-bottom: 1rem;
}
.a11y-btn {
  display: flex;
  align-items: center; justify-content: center;
  padding: 0.85rem 0.5rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 8px;
  font: 500 0.78rem/1.25 inherit;
  color: #1a1a1a;
  cursor: pointer;
  text-align: center;
  min-height: 64px;
  transition: all 0.25s ease;
}
.a11y-btn:hover { background: #f9f9f9; border-color: #1a1a1a; }
.a11y-btn.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.a11y-btn:focus-visible { outline: 2px solid #057dbc; outline-offset: 2px; }
.a11y-reset {
  width: 100%;
  padding: 0.7rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font: 600 0.85rem/1 inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.3s ease;
}
.a11y-reset:hover { background: #000; }
.a11y-statement {
  display: block;
  text-align: center;
  margin-top: 0.85rem;
  font: 400 0.78rem/1 inherit;
  color: rgba(0,0,0,0.55);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.a11y-statement:hover { color: #057dbc; }

/* Skip-to-content link */
.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  background: #1a1a1a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 4px;
  z-index: 200;
  font: 600 14px/1 'Work Sans', system-ui, sans-serif;
  text-decoration: none;
  transition: top 0.3s ease;
}
.skip-link:focus { top: 1rem; outline: 3px solid #057dbc; }

@media (max-width: 640px) {
  .a11y-trigger { width: 50px; height: 50px; bottom: 1rem; inset-inline-end: 1rem; }
  .a11y-trigger svg { width: 24px; height: 24px; }
  .a11y-panel { bottom: 0.75rem; inset-inline-end: 0.75rem; padding: 1.25rem; }
}

/* =============================================
   Accessibility STATES — applied to <html>
============================================= */
html.a11y-text-lg  { font-size: 18px; }
html.a11y-text-xl  { font-size: 20px; }
html.a11y-text-xxl { font-size: 22px; }

html.a11y-spacing { letter-spacing: 0.05em; word-spacing: 0.1em; }
html.a11y-spacing p, html.a11y-spacing li,
html.a11y-spacing h1, html.a11y-spacing h2,
html.a11y-spacing h3, html.a11y-spacing h4,
html.a11y-spacing h5 { line-height: 1.9; }

html.a11y-readable body,
html.a11y-readable h1, html.a11y-readable h2, html.a11y-readable h3,
html.a11y-readable h4, html.a11y-readable h5,
html.a11y-readable p, html.a11y-readable a,
html.a11y-readable button, html.a11y-readable li {
  font-family: 'Arial', 'Heebo', sans-serif !important;
}

html.a11y-links a:not(.a11y-btn):not(.a11y-statement):not(.a11y-close):not(.skip-link):not([data-a11y-skip]) {
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  font-weight: 600 !important;
}

html.a11y-highlight-headings h1,
html.a11y-highlight-headings h2,
html.a11y-highlight-headings h3,
html.a11y-highlight-headings h4 {
  outline: 2px solid #d4af6a;
  outline-offset: 4px;
  background: rgba(212, 175, 106, 0.08);
}

html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}
html.a11y-no-motion .bg-particles,
html.a11y-no-motion .cursor-light { display: none !important; }

html.a11y-contrast { filter: contrast(1.5); }
html.a11y-contrast body {
  background: #000 !important;
  color: #fff !important;
}
html.a11y-contrast h1, html.a11y-contrast h2, html.a11y-contrast h3,
html.a11y-contrast h4, html.a11y-contrast h5,
html.a11y-contrast p, html.a11y-contrast li,
html.a11y-contrast span:not(.a11y-btn span):not([data-a11y-skip] *) {
  color: #fff !important;
  text-shadow: none !important;
}
html.a11y-contrast a:not(.a11y-btn):not([data-a11y-skip]) { color: #ffd866 !important; }
html.a11y-contrast section,
html.a11y-contrast header,
html.a11y-contrast footer,
html.a11y-contrast nav,
html.a11y-contrast main { background: #000 !important; }
html.a11y-contrast img, html.a11y-contrast video { filter: grayscale(0.4) contrast(1.2); }

html.a11y-light, html.a11y-light body {
  background: #fff !important;
  color: #000 !important;
}
html.a11y-light section, html.a11y-light header,
html.a11y-light footer, html.a11y-light nav,
html.a11y-light main { background: #fff !important; }
html.a11y-light h1, html.a11y-light h2, html.a11y-light h3,
html.a11y-light h4, html.a11y-light p, html.a11y-light li,
html.a11y-light a:not(.a11y-btn):not([data-a11y-skip]),
html.a11y-light span { color: #000 !important; }

html.a11y-focus *:focus-visible {
  outline: 4px solid #ff6b00 !important;
  outline-offset: 4px !important;
  border-radius: 2px !important;
}

html.a11y-cursor *,
html.a11y-cursor *::before,
html.a11y-cursor *::after {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='%23000' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'><path d='M5 3l16 9-7 1 4 9-3 1-4-9-6 5z'/></svg>") 0 0, auto !important;
}
