/* SIT & DRINK — WCAG 2.2 + accessibility widget */

.sd-skip-link {
  position: fixed; top: 8px; inset-inline-start: 8px; z-index: 100000;
  padding: 12px 20px; background: #003d82; color: #fff;
  font: 700 15px/1.4 "Noto Sans Hebrew", system-ui, sans-serif;
  text-decoration: none; border-radius: 8px;
  transform: translateY(-160%); transition: transform .2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,.35);
}
.sd-skip-link:focus, .sd-skip-link:focus-visible {
  transform: translateY(0); outline: 3px solid #ffd54f; outline-offset: 2px;
}

html.sd-a11y-focus :focus-visible {
  outline: 3px solid #0066cc !important; outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(0,102,204,.22) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}
html.sd-a11y-no-motion *, html.sd-a11y-no-motion *::before, html.sd-a11y-no-motion *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

html.sd-a11y-text-110 { font-size: 110%; }
html.sd-a11y-text-125 { font-size: 125%; }
html.sd-a11y-text-150 { font-size: 150%; }

html.sd-a11y-font-readable body,
html.sd-a11y-font-readable body *:not(.sd-a11y-icon-img):not(.sd-a11y-panel *) {
  font-family: var(--sd-font), 'Open Sans', Arial, sans-serif !important;
  letter-spacing: 0.02em;
}

html.sd-a11y-lh-relaxed body { line-height: 1.75 !important; }
html.sd-a11y-lh-loose body { line-height: 2 !important; }
html.sd-a11y-spacing-wide body { letter-spacing: 0.06em !important; word-spacing: 0.12em !important; }

html.sd-a11y-contrast-high { filter: contrast(1.2) saturate(1.08); }
html.sd-a11y-contrast-invert { filter: invert(1) hue-rotate(180deg); }
html.sd-a11y-contrast-invert img, html.sd-a11y-contrast-invert video,
html.sd-a11y-contrast-invert .sd-a11y-widget { filter: invert(1) hue-rotate(180deg); }

html.sd-a11y-site-light { color-scheme: light; }
html.sd-a11y-site-light {
  --ink: #f0f4f8; --ink2: #ffffff; --ink3: #e8edf2;
  --cream: #1a2332; --cream2: #0f172a; --muted: #5a6578; --muted2: #334155;
  --border: rgba(15,23,42,.14); --border2: rgba(15,23,42,.08); --glow: rgba(212,168,67,.08);
}
html.sd-a11y-site-light body { background: var(--ink) !important; color: var(--cream) !important; }
html.sd-a11y-site-light nav, html.sd-a11y-site-light .nav-mobile {
  background: rgba(255,255,255,.97) !important; border-bottom-color: rgba(15,23,42,.1) !important;
  box-shadow: 0 4px 24px rgba(15,23,42,.08) !important;
}
html.sd-a11y-site-light .nav-links { background: rgba(15,23,42,.04) !important; border-color: rgba(15,23,42,.08) !important; }
html.sd-a11y-site-light .nav-links a { color: #334155 !important; }
html.sd-a11y-site-light .nav-brand-name, html.sd-a11y-site-light .nav-links a.active { color: #6b4f0e !important; }
html.sd-a11y-site-light .fc, html.sd-a11y-site-light .svc-card {
  background: #ffffff !important; color: #334155 !important;
  border-color: rgba(15,23,42,.1) !important;
}
html.sd-a11y-site-light .fc .ft, html.sd-a11y-site-light .svc-card .svc-title { color: #0f172a !important; }
html.sd-a11y-site-light .fc .fd, html.sd-a11y-site-light .svc-card .svc-desc { color: #334155 !important; }
html.sd-a11y-site-light section.sec { background: #fff !important; }
html.sd-a11y-site-light footer { background: #e8edf2 !important; }
html.sd-a11y-site-light h1, html.sd-a11y-site-light h2, html.sd-a11y-site-light h3, html.sd-a11y-site-light h4 { color: #0f172a !important; }
html.sd-a11y-site-light p, html.sd-a11y-site-light li { color: #334155 !important; }
html.sd-a11y-site-light.rsvp-page body, html.sd-a11y-site-light body.rsvp-body {
  background: #f8fafc !important; color: #1e293b !important;
}

html.sd-a11y-links a:not(.sd-a11y-toggle) {
  text-decoration: underline !important; text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important; background: rgba(255,213,79,.35) !important;
}
html.sd-a11y-headings h1, html.sd-a11y-headings h2, html.sd-a11y-headings h3, html.sd-a11y-headings h4 {
  outline: 2px dashed #0066cc !important; outline-offset: 4px !important;
}
html.sd-a11y-reading-mask::after {
  content: ""; pointer-events: none; position: fixed; left: 0; right: 0;
  height: 80px; top: var(--sd-read-y, 40vh); transform: translateY(-50%);
  background: rgba(0,0,0,.55); box-shadow: 0 0 0 9999px rgba(0,0,0,.55);
  z-index: 99990;
}

/* ══ WIDGET SHELL ══ */
.sd-a11y-widget {
  position: fixed; left: 0; bottom: 0; z-index: 99999;
  font-family: var(--sd-font), 'Open Sans', Arial, sans-serif; direction: rtl;
  pointer-events: none;
}
.sd-a11y-widget > * { pointer-events: auto; }

/* ══ FLOAT — למטה מימין (נגישות); וואטסאפ נשאר משמאל ══ */
.sd-a11y-float-host {
  position: fixed;
  left: auto;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 28px);
  transition: bottom .2s ease;
}

.sd-a11y-float {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sd-a11y-toggle {
  width: 80px; height: 87px; padding: 0; border: none; background: transparent;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 14px rgba(0,61,130,.5));
  transition: transform .18s ease, filter .18s ease;
}
.sd-a11y-toggle:hover { transform: scale(1.04); }
.sd-a11y-toggle:focus-visible { outline: 3px solid #0066cc; outline-offset: 4px; border-radius: 50%; }
.sd-a11y-icon-img {
  width: 80px; height: 87px; display: block; object-fit: contain; pointer-events: none;
}
.sd-a11y-toggle-label {
  font: 800 12px/1.2 var(--sd-font), 'Open Sans', Arial, sans-serif;
  color: #f5f0e8; text-align: center;
  text-shadow: 0 2px 10px rgba(0,0,0,.75);
}
html.sd-a11y-site-light .sd-a11y-toggle-label { color: #0f172a; text-shadow: 0 1px 0 #fff; }

/* ══ THEME TOGGLE — header (desktop) ══ */
.sd-theme-host--header {
  margin-inline-end: 4px;
  padding-inline-end: 8px;
  border-inline-end: 1px solid rgba(212,168,67,.2);
  flex-shrink: 0;
}
.sd-theme-host--header .sd-theme-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: rgba(212,168,67,.07);
  border: 1px solid rgba(212,168,67,.25);
  border-radius: 999px;
}
.sd-theme-host--header .sd-theme-pill-label {
  font: 600 10px/1 var(--sd-font), 'Open Sans', sans-serif;
  color: rgba(245,240,232,.4); transition: color .2s;
}
.sd-theme-host--header .sd-theme-pill:not(:has(.is-light)) .sd-theme-pill-label:first-child,
.sd-theme-host--header .sd-theme-pill:has(.is-light) .sd-theme-pill-label:last-child {
  color: #f0cc72;
}
.sd-theme-host--header .sd-theme-pill-track { width: 42px; height: 22px; }
.sd-theme-host--header .sd-theme-pill-knob { width: 18px; height: 18px; top: 1px; }

/* ══ THEME TOGGLE — mobile: פינה עליונה שמאל (לא מפריע לכפתורים) ══ */
.sd-theme-host--corner {
  position: fixed;
  top: max(74px, calc(68px + env(safe-area-inset-top, 0px)));
  left: max(8px, env(safe-area-inset-left, 0px));
  z-index: 498;
}
.sd-theme-host--corner .sd-theme-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(7,6,10,.88);
  border: 1px solid rgba(212,168,67,.35);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.sd-theme-host--corner .sd-theme-pill-label { font: 700 10px/1 "Noto Sans Hebrew", sans-serif; color: rgba(245,240,232,.5); }
.sd-theme-host--corner .sd-theme-pill:not(:has(.is-light)) .sd-theme-pill-label:first-child,
.sd-theme-host--corner .sd-theme-pill:has(.is-light) .sd-theme-pill-label:last-child { color: #f0cc72; }
.sd-theme-host--corner .sd-theme-pill-track { width: 42px; height: 22px; }
.sd-theme-host--corner .sd-theme-pill-knob { width: 18px; height: 18px; top: 1px; }
html.sd-a11y-site-light .sd-theme-host--corner .sd-theme-pill {
  background: rgba(255,255,255,.95); border-color: rgba(15,23,42,.15);
}

/* ══ THEME TOGGLE — mobile legacy (unused) ══ */
.sd-theme-host--mobile { width: 100%; display: flex; justify-content: center; }
.sd-theme-host--mobile .sd-theme-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(7,6,10,.82);
  border: 1px solid rgba(212,168,67,.35);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
}
.sd-theme-host--mobile .sd-theme-pill-label {
  font: 700 11px/1 "Noto Sans Hebrew", sans-serif;
  color: rgba(245,240,232,.5);
}
.sd-theme-host--mobile .sd-theme-pill:not(:has(.is-light)) .sd-theme-pill-label:first-child,
.sd-theme-host--mobile .sd-theme-pill:has(.is-light) .sd-theme-pill-label:last-child {
  color: #f0cc72;
}
html.sd-a11y-site-light .sd-theme-host--mobile .sd-theme-pill {
  background: rgba(255,255,255,.95); border-color: rgba(15,23,42,.15);
}
html.sd-a11y-site-light .sd-theme-host--mobile .sd-theme-pill-label { color: rgba(15,23,42,.45); }
html.sd-a11y-site-light .sd-theme-host--mobile .sd-theme-pill:not(:has(.is-light)) .sd-theme-pill-label:first-child,
html.sd-a11y-site-light .sd-theme-host--mobile .sd-theme-pill:has(.is-light) .sd-theme-pill-label:last-child {
  color: #8a6420;
}

/* ── Switch track (shared) ── */
.sd-theme-pill-switch {
  border: none; background: none; padding: 0; cursor: pointer; line-height: 0;
}
.sd-theme-pill-switch:focus-visible { outline: 3px solid #f0cc72; outline-offset: 3px; border-radius: 999px; }
.sd-theme-pill-track {
  display: block; width: 50px; height: 26px; border-radius: 999px;
  background: rgba(7,6,10,.6); border: 1px solid rgba(212,168,67,.35);
  position: relative; transition: background .22s ease;
}
.sd-theme-pill-switch.is-light .sd-theme-pill-track {
  background: rgba(212,168,67,.25); border-color: rgba(212,168,67,.55);
}
.sd-theme-pill-knob {
  position: absolute; top: 2px;
  inset-inline-start: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(145deg, #0077e6, #004999);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  color: #f0cc72;
  transition: inset-inline-start .22s cubic-bezier(.4,0,.2,1), inset-inline-end .22s cubic-bezier(.4,0,.2,1), background .22s ease;
}
.sd-theme-pill-knob svg { width: 13px; height: 13px; }
.sd-theme-pill-switch.is-light .sd-theme-pill-knob {
  inset-inline-start: auto;
  inset-inline-end: 2px;
  background: linear-gradient(145deg, #f0cc72, #d4a843);
  color: #4a3020;
}

.sd-opt-svg svg { width: 20px; height: 20px; }

/* ══ PANEL — מחוץ ל-widget, מיקום פיזי (left/top) בלבד ══ */
.sd-a11y-panel {
  position: fixed;
  top: -9999px;
  left: -9999px;
  width: min(360px, calc(100vw - 24px));
  max-height: min(82vh, 620px);
  display: flex;
  flex-direction: column;
  direction: rtl;
  background: #fff;
  color: #1e293b;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(15,23,42,.22);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(.98);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  overflow: hidden;
  z-index: 100001;
  margin: 0;
  inset-inline: auto;
}
.sd-a11y-panel[hidden] { display: none !important; }
.sd-a11y-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
html.sd-a11y-compact .sd-a11y-panel { transform-origin: bottom left; }

.sd-a11y-panel-header {
  flex-shrink: 0; display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; background: linear-gradient(135deg, #0066cc, #004999); color: #fff;
}
.sd-a11y-header-icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; }
.sd-a11y-header-icon svg { width: 24px; height: 24px; fill: #fff; }
.sd-a11y-panel-header h2 { margin: 0 0 2px; font-size: 17px; font-weight: 800; color: #fff; }
.sd-a11y-header-sub { margin: 0; font-size: 11px; opacity: .88; }
.sd-a11y-close { background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 20px; cursor: pointer; border-radius: 8px; min-width: 36px; min-height: 36px; }
.sd-a11y-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; -webkit-overflow-scrolling: touch; }
.sd-a11y-section { margin-bottom: 16px; }
.sd-a11y-section-title { font-size: 11px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.sd-a11y-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sd-a11y-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.sd-a11y-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.sd-a11y-opt {
  min-height: 64px; padding: 10px 8px; border: 1.5px solid #e2e8f0; border-radius: 12px;
  background: #f8fafc; color: #334155; cursor: pointer;
  font: 600 12px/1.25 var(--sd-font), 'Open Sans', Arial, sans-serif;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.sd-a11y-opt[aria-pressed="true"] { background: #dbeafe; border-color: #0066cc; color: #004999; }
.sd-a11y-opt.wide { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 52px; padding-inline: 14px; }
.sd-a11y-reset { width: 100%; min-height: 48px; padding: 12px; border: 1.5px solid #fecaca; border-radius: 12px; background: #fef2f2; color: #b91c1c; font: 700 13px var(--sd-font), 'Open Sans', Arial, sans-serif; cursor: pointer; }
.sd-a11y-footer { padding: 10px 14px; border-top: 1px solid #e2e8f0; font-size: 11px; color: #64748b; background: #f8fafc; }
.sd-a11y-footer a { color: #0066cc; font-weight: 600; }
.sd-a11y-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ══ COMPACT — אישורי הגעה (כפתור קטן יותר) ══ */
html.sd-a11y-compact .sd-a11y-float-host {
  left: max(10px, env(safe-area-inset-left, 0px));
  right: auto;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  gap: 6px;
}
html.sd-a11y-compact .sd-a11y-toggle { width: 52px; height: 56px; }
html.sd-a11y-compact .sd-a11y-icon-img { width: 52px; height: 56px; }
html.sd-a11y-compact .sd-a11y-toggle-label { display: none; }
html.sd-a11y-compact .sd-theme-host--mobile { display: none; }
html.sd-a11y-compact .sd-a11y-panel {
  width: min(320px, calc(100vw - 20px));
  max-height: min(72vh, 540px);
}
html.sd-a11y-compact .sd-a11y-panel-header h2 { font-size: 15px; }
html.sd-a11y-compact .sd-a11y-opt { min-height: 56px; }

@media (max-width: 900px) {
  .sd-a11y-float-host {
    right: 0;
    bottom: max(0px, env(safe-area-inset-bottom, 0px));
    align-items: flex-end;
    padding-right: env(safe-area-inset-right, 0px);
    gap: 0;
  }
  .sd-a11y-toggle-label { display: none; }
  .sd-a11y-icon-img { width: 72px; height: 78px; }
  .sd-a11y-toggle { width: 72px; height: 78px; }
  .sd-a11y-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  html.sd-a11y-compact .sd-a11y-icon-img { width: 48px; height: 52px; }
  html.sd-a11y-compact .sd-a11y-toggle { width: 48px; height: 52px; }
  body:has(.sd-a11y-widget) .hero { padding-bottom: max(100px, calc(64px + env(safe-area-inset-bottom, 0px))); }
}

@media (max-width: 380px) {
  .sd-a11y-icon-img { width: 64px; height: 70px; }
  .sd-a11y-toggle { width: 64px; height: 70px; }
  html.sd-a11y-compact .sd-a11y-icon-img { width: 44px; height: 48px; }
  html.sd-a11y-compact .sd-a11y-toggle { width: 44px; height: 48px; }
}
