/* ================================================================
   ORNEXI CV · ACCESSIBILITY WIDGET + MODIFIER CLASSES
   תקן ישראלי 5568 / WCAG 2.1 AA
   ================================================================ */

/* ── Skip link (shared across all pages) ──────────────────────── */
.skip-link {
  position: absolute;
  top: -200%;
  inset-inline-start: 16px;
  background: #D97706;
  color: #fff;
  padding: 8px 18px;
  border-radius: 0 0 10px 10px;
  font-weight: 700;
  z-index: 9999;
  font-family: 'Heebo', system-ui, sans-serif;
  font-size: .95rem;
  transition: top .15s ease;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Floating trigger button ───────────────────────────────────── */
#a11y-widget {
  position: fixed;
  bottom: 80px;
  inset-inline-start: 14px;
  z-index: 8000;
  font-family: 'Heebo', system-ui, sans-serif;
  direction: rtl;
}

#a11y-trigger {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #D97706;
  color: #fff;
  border: 3px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 18px rgba(0,0,0,.3);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  line-height: 1;
}
#a11y-trigger:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,.4); }
#a11y-trigger:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ── Panel ─────────────────────────────────────────────────────── */
#a11y-panel {
  position: absolute;
  bottom: calc(100% + 10px);
  inset-inline-start: 0;
  width: 230px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18);
  overflow: hidden;
}
#a11y-panel[hidden] { display: none; }

.a11y-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  background: #0F172A;
  color: #fff;
}
.a11y-panel__title {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.a11y-panel__close {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.a11y-panel__close:hover { background: rgba(255,255,255,.22); }

.a11y-panel__body { padding: 10px 10px 6px; }

/* Section title */
.a11y-sect {
  font-size: .7rem;
  font-weight: 700;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 4px 6px;
  margin-top: 4px;
}

/* Font row */
.a11y-font-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.a11y-font-row .a11y-opt {
  flex: 1;
  font-size: .95rem;
  font-weight: 700;
  min-height: 36px;
}
.a11y-font-level {
  flex: 0 0 28px;
  text-align: center;
  font-size: .78rem;
  font-weight: 600;
  color: #4B5563;
  padding: 2px 0;
}

/* Feature grid */
.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 8px;
}

/* Option buttons */
.a11y-opt {
  padding: 7px 6px;
  border-radius: 7px;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  color: #374151;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
  line-height: 1.3;
  font-family: 'Heebo', system-ui, sans-serif;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.a11y-opt:hover {
  background: #FEF3C7;
  border-color: #D97706;
  color: #92400E;
}
.a11y-opt.active,
.a11y-opt[aria-pressed="true"] {
  background: #D97706;
  border-color: #B45309;
  color: #fff;
  box-shadow: 0 2px 8px rgba(217,119,6,.35);
}
.a11y-opt:focus-visible { outline: 3px solid #D97706; outline-offset: 2px; }

/* Reset button */
.a11y-reset-btn {
  width: 100%;
  padding: 8px;
  border-radius: 7px;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  color: #6B7280;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-bottom: 4px;
  font-family: 'Heebo', system-ui, sans-serif;
  transition: background .14s, color .14s;
}
.a11y-reset-btn:hover { background: #FEE2E2; color: #991B1B; border-color: #FECACA; }

/* Panel footer */
.a11y-panel__footer {
  padding: 8px 14px;
  border-top: 1px solid #F3F4F6;
  text-align: center;
}
.a11y-panel__footer a {
  font-size: .75rem;
  color: #D97706;
  text-decoration: none;
  font-weight: 600;
}
.a11y-panel__footer a:hover { text-decoration: underline; }

/* ================================================================
   MODIFIER CLASSES  (applied to <html> element)
   ================================================================ */

/* ── Font scale ─────────────────────────────────────────────────── */
html.a11y-font--2 { font-size: 80% }
html.a11y-font--1 { font-size: 88% }
html.a11y-font-1  { font-size: 112% }
html.a11y-font-2  { font-size: 125% }
html.a11y-font-3  { font-size: 137% }
html.a11y-font-4  { font-size: 150% }
html.a11y-font-5  { font-size: 162% }

/* ── High contrast ──────────────────────────────────────────────── */
html.a11y-high-contrast body         { background: #000 !important; color: #fff !important; }
html.a11y-high-contrast h1,
html.a11y-high-contrast h2,
html.a11y-high-contrast h3,
html.a11y-high-contrast h4           { color: #fff !important; }
html.a11y-high-contrast p            { color: #e5e5e5 !important; }
html.a11y-high-contrast a            { color: #ffff00 !important; }
html.a11y-high-contrast button:not(#a11y-trigger):not(.a11y-opt):not(.a11y-panel__close):not(.a11y-reset-btn),
html.a11y-high-contrast input,
html.a11y-high-contrast select       { background: #111 !important; color: #fff !important; border: 2px solid #aaa !important; }
html.a11y-high-contrast [class*="card"],
html.a11y-high-contrast [class*="panel"]:not(#a11y-panel) { background: #111 !important; border: 1px solid #555 !important; }
html.a11y-high-contrast [class*="badge"],
html.a11y-high-contrast [class*="badge"] { background: #222 !important; color: #ffff00 !important; }
html.a11y-high-contrast nav          { background: #000 !important; border-color: #555 !important; }

/* ── Invert ─────────────────────────────────────────────────────── */
html.a11y-invert { filter: invert(1) hue-rotate(180deg); }
html.a11y-invert img,
html.a11y-invert video,
html.a11y-invert iframe { filter: invert(1) hue-rotate(180deg); }

/* ── Grayscale ──────────────────────────────────────────────────── */
html.a11y-grayscale { filter: grayscale(1); }

/* Both invert + grayscale */
html.a11y-invert.a11y-grayscale { filter: invert(1) hue-rotate(180deg) grayscale(1); }
html.a11y-invert.a11y-grayscale img,
html.a11y-invert.a11y-grayscale video { filter: invert(1) hue-rotate(180deg) grayscale(1); }

/* ── Link highlighting ──────────────────────────────────────────── */
html.a11y-links a:not(#a11y-panel a) {
  outline: 2px solid #D97706 !important;
  outline-offset: 2px !important;
  text-decoration: underline !important;
}

/* ── Readable (dyslexia-friendly) font ─────────────────────────── */
html.a11y-readable,
html.a11y-readable * {
  font-family: Verdana, Arial, Geneva, sans-serif !important;
}

/* ── Increased spacing ──────────────────────────────────────────── */
html.a11y-spacing p,
html.a11y-spacing li,
html.a11y-spacing label,
html.a11y-spacing span,
html.a11y-spacing td,
html.a11y-spacing th {
  line-height: 2.1 !important;
  letter-spacing: .06em !important;
  word-spacing: .12em !important;
}

/* ── Stop animations ────────────────────────────────────────────── */
html.a11y-no-anim *,
html.a11y-no-anim *::before,
html.a11y-no-anim *::after {
  animation: none !important;
  transition: none !important;
}
html.a11y-no-anim { scroll-behavior: auto !important; }

/* ── Enlarged cursor ────────────────────────────────────────────── */
html.a11y-big-cursor,
html.a11y-big-cursor * {
  /* SVG pointer arrow 40×48 */
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewBox='0 0 10 12'%3E%3Cpolygon points='0%2C0 0%2C10 3%2C8 5%2C12 6.5%2C11.4 4.5%2C7.5 7.5%2C7.5' fill='%23000' stroke='%23fff' stroke-width='.6'/%3E%3C%2Fsvg%3E") 0 0, auto !important;
}
