/* ==========================================================================
   YMDigital Store Kit — מודול נגישות
   ========================================================================== */

.ym-a11y {
  position: fixed;
  bottom: 20px;
  z-index: 860;
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  direction: rtl;
}
.ym-a11y--left { left: 20px; }
.ym-a11y--right { right: 20px; }

.ym-a11y__toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  transition: transform 0.18s ease;
}
.ym-a11y__toggle:hover { transform: translateY(-3px); }
.ym-a11y__toggle svg { width: 28px; height: 28px; }
.ym-a11y__toggle.is-active::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #F59E0B;
  border: 2px solid #fff;
}
.ym-a11y__toggle:focus-visible,
.ym-a11y__panel button:focus-visible,
.ym-a11y__panel a:focus-visible { outline: 3px solid #F59E0B; outline-offset: 2px; }

.ym-a11y__panel {
  position: absolute;
  bottom: 64px;
  width: min(320px, calc(100vw - 40px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: #fff;
  color: #0F172A;
  border-radius: 14px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  border: 1px solid #E5E7EB;
  padding: 16px;
}
.ym-a11y--left .ym-a11y__panel { left: 0; }
.ym-a11y--right .ym-a11y__panel { right: 0; }
.ym-a11y__panel[hidden] { display: none; }

.ym-a11y__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ym-a11y__head strong { font-size: 17px; }
.ym-a11y__close { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #F1F5F9; color: #0F172A; cursor: pointer; font-size: 15px; }

.ym-a11y__size { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: #F8FAFC; border: 1px solid #E5E7EB; border-radius: 10px; margin-bottom: 10px; font-weight: 600; }
.ym-a11y__size-ctrl { display: flex; align-items: center; gap: 6px; }
.ym-a11y__size-ctrl button { min-width: 44px; height: 40px; border: 1px solid #CBD5E1; border-radius: 8px; background: #fff; color: #0F172A; font-weight: 700; font-size: 15px; cursor: pointer; }
.ym-a11y__size-val { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }

.ym-a11y__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ym-a11y__opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 78px;
  padding: 10px 6px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  background: #fff;
  color: #0F172A;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.ym-a11y__opt svg { width: 24px; height: 24px; }
.ym-a11y__opt:hover { border-color: var(--accent); }
.ym-a11y__opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.ym-a11y__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #E5E7EB; }
.ym-a11y__reset { border: 0; background: none; color: #B91C1C; font-weight: 700; font-size: 14px; cursor: pointer; padding: 6px 0; }
.ym-a11y__foot a { color: #1D4ED8; font-weight: 700; font-size: 14px; text-decoration: underline; }

@media (max-width: 40rem) {
  .ym-a11y { bottom: 14px; }
  .ym-a11y--left { left: 14px; }
  .ym-a11y--right { right: 14px; }
  .ym-a11y__toggle { width: 46px; height: 46px; }
}

/* ==========================================================================
   ההתאמות עצמן
   ========================================================================== */

html[data-ym-a11y-size="1"] { font-size: 110%; }
html[data-ym-a11y-size="2"] { font-size: 120%; }
html[data-ym-a11y-size="3"] { font-size: 130%; }
html[data-ym-a11y-size="4"] { font-size: 140%; }

html.ym-a11y-contrast body > *:not(.ym-a11y),
html.ym-a11y-contrast body > *:not(.ym-a11y) *:not(img):not(svg):not(path):not(circle) {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.ym-a11y-contrast body { background: #000 !important; }
html.ym-a11y-contrast body > *:not(.ym-a11y) a,
html.ym-a11y-contrast body > *:not(.ym-a11y) a * { color: #FDE047 !important; }
html.ym-a11y-contrast body > *:not(.ym-a11y) button,
html.ym-a11y-contrast body > *:not(.ym-a11y) .ym-btn,
html.ym-a11y-contrast body > *:not(.ym-a11y) input,
html.ym-a11y-contrast body > *:not(.ym-a11y) select,
html.ym-a11y-contrast body > *:not(.ym-a11y) textarea { border: 2px solid #fff !important; }

html.ym-a11y-grayscale body > *:not(.ym-a11y) { filter: grayscale(1); }

html.ym-a11y-links body > *:not(.ym-a11y) a {
  text-decoration: underline !important;
  text-underline-offset: 0.2em;
  outline: 2px dashed currentColor;
  outline-offset: 2px;
}

html.ym-a11y-font body > *:not(.ym-a11y),
html.ym-a11y-font body > *:not(.ym-a11y) *:not(svg):not(path) {
  font-family: Arial, 'Helvetica Neue', sans-serif !important;
  letter-spacing: 0.02em !important;
}

html.ym-a11y-spacing body > *:not(.ym-a11y) p,
html.ym-a11y-spacing body > *:not(.ym-a11y) li,
html.ym-a11y-spacing body > *:not(.ym-a11y) dd,
html.ym-a11y-spacing body > *:not(.ym-a11y) td,
html.ym-a11y-spacing body > *:not(.ym-a11y) blockquote,
html.ym-a11y-spacing body > *:not(.ym-a11y) label {
  line-height: 2 !important;
  word-spacing: 0.16em !important;
}

html.ym-a11y-motion,
html.ym-a11y-motion *,
html.ym-a11y-motion *::before,
html.ym-a11y-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html.ym-a11y-cursor,
html.ym-a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 8.5-6.5 1.8L10.7 19z' fill='%23000' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important;
}

html.ym-a11y-focus *:focus,
html.ym-a11y-focus *:focus-visible {
  outline: 4px solid #F59E0B !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 7px rgba(15, 23, 42, 0.85) !important;
}
