/* =====================================================
   קליניקת ארגמן — accessibility-widget.css
   רכיב הנגשה עצמאי (ת"י 5568 / WCAG 2.1 AA)
   ===================================================== */

.a11y-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary, #1B3A6B);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg, 0 12px 28px rgba(15,35,71,.12));
  transition: transform .2s ease;
}
.a11y-toggle:hover,
.a11y-toggle:focus-visible { transform: scale(1.08); }
.a11y-toggle svg { width: 28px; height: 28px; }

.a11y-panel {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 10000;
  width: min(320px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 120px));
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-xl, 0 24px 48px rgba(15,35,71,.16));
  border: 1px solid rgba(0,0,0,.08);
  padding: 1.1rem;
  display: none;
}
.a11y-panel.open { display: block; }

.a11y-panel h2 {
  font-size: 1.05rem;
  color: var(--color-primary, #1B3A6B);
  margin: 0 0 .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.a11y-panel .a11y-close {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: transparent;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: .3rem;
  border-radius: 50%;
  display: flex;
}
.a11y-panel .a11y-close:hover { background: #f3f4f6; color: #1a1a1a; }

.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem 0;
  border-top: 1px solid #f0f0f0;
}
.a11y-row:first-of-type { border-top: none; }
.a11y-row-label {
  font-size: .92rem;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.a11y-stepper { display: flex; align-items: center; gap: .4rem; }
.a11y-stepper button {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm, 6px);
  border: 2px solid var(--color-primary, #1B3A6B);
  background: #fff;
  color: var(--color-primary, #1B3A6B);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.a11y-stepper button:hover:not(:disabled) { background: var(--color-primary, #1B3A6B); color: #fff; }
.a11y-stepper button:disabled { opacity: .35; cursor: not-allowed; }
.a11y-stepper .a11y-scale-label { font-size: .8rem; color: #6b7280; min-width: 34px; text-align: center; }

.a11y-switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: #d1d5db;
  cursor: pointer;
  flex-shrink: 0;
}
.a11y-switch::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.a11y-switch[aria-pressed="true"] { background: var(--color-primary, #1B3A6B); }
.a11y-switch[aria-pressed="true"]::before { transform: translateX(-18px); }

.a11y-reset {
  width: 100%;
  margin-top: .85rem;
  padding: .55rem;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}
.a11y-reset:hover { background: #f3f4f6; }

.a11y-statement-link {
  display: block;
  text-align: center;
  margin-top: .75rem;
  font-size: .8rem;
  color: var(--color-primary, #1B3A6B);
}

@media (max-width: 480px) {
  .a11y-toggle { bottom: 16px; right: 16px; width: 50px; height: 50px; }
  .a11y-panel { bottom: 76px; right: 16px; }
}

/* ===== Effect: text size ===== */
html[data-a11y-scale="1"] { font-size: 112.5%; }
html[data-a11y-scale="2"] { font-size: 125%; }
html[data-a11y-scale="3"] { font-size: 137.5%; }

/* ===== Effect: highlight links ===== */
html[data-a11y-links="on"] a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  background: #fff6a3 !important;
  color: #1a1a1a !important;
}

/* ===== Effect: stop animations ===== */
html[data-a11y-motion="off"] *,
html[data-a11y-motion="off"] *::before,
html[data-a11y-motion="off"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* ===== Effect: high contrast ===== */
html[data-a11y-contrast="on"] body {
  background: #fff !important;
  color: #000 !important;
}
html[data-a11y-contrast="on"] * {
  background-color: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  background-image: none !important;
}
html[data-a11y-contrast="on"] a {
  color: #00008B !important;
  text-decoration: underline !important;
}
html[data-a11y-contrast="on"] a:visited { color: #551A8B !important; }
html[data-a11y-contrast="on"] button,
html[data-a11y-contrast="on"] .btn,
html[data-a11y-contrast="on"] input[type="submit"] {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #000 !important;
}
html[data-a11y-contrast="on"] img,
html[data-a11y-contrast="on"] svg,
html[data-a11y-contrast="on"] picture {
  filter: grayscale(100%) contrast(1.3);
}
/* Keep the widget itself legible and on-brand even in high-contrast mode */
html[data-a11y-contrast="on"] .a11y-toggle,
html[data-a11y-contrast="on"] .a11y-toggle * {
  background: #000 !important;
  color: #fff !important;
}
html[data-a11y-contrast="on"] .a11y-panel * {
  background-color: #fff !important;
  color: #000 !important;
}
html[data-a11y-contrast="on"] .a11y-switch[aria-pressed="true"] {
  background: #000 !important;
}
