/* =========================================================
   נגישות: כפתור צף, תפריט התאמות והצהרת נגישות.
   ההתאמות עצמן הן מחלקות על <html> (a11y-*), כדי שכל האתר יגיב להן.
   ========================================================= */

/* ---------- בסיס נגיש תמיד (גם בלי הפעלת התפריט) ---------- */
.skip-link { position: fixed; top: 8px; right: 8px; z-index: 300; padding: 12px 20px; border-radius: 12px; background: #fff; color: #111; font-weight: 700; transform: translateY(-160%); transition: transform 0.2s; }
.skip-link:focus { transform: none; outline: 3px solid var(--orange); }
.a11y-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- הכפתור הצף ---------- */
.a11y-btn {
  position: fixed; left: clamp(14px, 2vw, 28px); bottom: calc(clamp(14px, 2.4vh, 26px) + 66px); z-index: 46; width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: #1a0f0a; border: 2px solid var(--orange-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(255, 90, 31, 0.16); transition: transform 0.35s var(--ease), box-shadow 0.35s, background 0.3s;
}
.a11y-btn:hover { transform: scale(1.08); background: #2a170d; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 0 5px rgba(255, 90, 31, 0.28); }
.a11y-btn svg { width: 30px; height: 30px; }
.a11y-btn[aria-expanded='true'] { background: var(--orange); border-color: #fff; }
@media (max-width: 899px) {
  .a11y-btn { width: 46px; height: 46px; left: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 140px); }
  .a11y-btn svg { width: 26px; height: 26px; }
}
@media (max-height: 520px) and (orientation: landscape) { .a11y-btn { bottom: 88px; } }
@media (max-height: 520px) and (orientation: landscape) and (max-width: 899px) { .a11y-btn { bottom: 78px; } }

/* ---------- הפאנל ---------- */
.a11y-panel {
  position: fixed; left: clamp(14px, 2vw, 28px); bottom: calc(clamp(14px, 2.4vh, 26px) + 132px); z-index: 160; width: min(392px, calc(100vw - 24px));
  max-height: calc(100svh - clamp(14px, 2.4vh, 26px) - 150px); display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; direction: rtl; text-align: right;
  background: #17100b; color: #f7f0e9; border: 1px solid rgba(255, 150, 90, 0.4); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(0.98); transform-origin: bottom left; transition: opacity 0.25s, transform 0.3s var(--ease), visibility 0s 0.3s;
}
.a11y-panel.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s, transform 0.3s var(--ease); }
@media (max-width: 899px) { .a11y-panel { left: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 198px); max-height: calc(100svh - 220px - env(safe-area-inset-bottom, 0px)); } }
@media (max-height: 520px) and (orientation: landscape) { .a11y-panel { bottom: 144px; max-height: calc(100svh - 156px); } }
.a11y-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); background: #1f140d; }
.a11y-head h2 { font-size: 1.12rem; font-weight: 700; }
.a11y-x { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; line-height: 1; background: rgba(255, 255, 255, 0.08); }
.a11y-x:hover { background: rgba(255, 255, 255, 0.18); }
.a11y-body { overflow-y: auto; padding: 14px 16px 16px; overscroll-behavior: contain; }
.a11y-sec { font-size: 0.82rem; letter-spacing: 0.06em; color: #ffb27a; margin: 14px 0 8px; font-weight: 600; }
.a11y-sec:first-child { margin-top: 0; }
.a11y-size { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-opt {
  display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 8px 12px; border-radius: 12px; text-align: right; font-size: 0.93rem; line-height: 1.25; color: #f7f0e9;
  background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(255, 255, 255, 0.16); transition: background 0.2s, border-color 0.2s;
}
.a11y-opt:hover { background: rgba(255, 255, 255, 0.12); }
.a11y-opt svg { flex: none; width: 22px; height: 22px; }
.a11y-opt[aria-pressed='true'] { background: rgba(255, 90, 31, 0.24); border-color: var(--orange-2); }
.a11y-opt[aria-pressed='true']::after { content: '✓'; margin-inline-start: auto; font-weight: 800; color: #ffb27a; }
.a11y-size .a11y-opt { justify-content: center; font-weight: 700; font-size: 1.05rem; }
.a11y-size .a11y-opt::after { content: none !important; }
.a11y-level { text-align: center; font-size: 0.85rem; color: #d9cbbd; margin-top: 6px; }
.a11y-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.a11y-foot .a11y-opt { justify-content: center; font-weight: 600; }
.a11y-foot .a11y-opt::after { content: none !important; }
.a11y-reset { background: rgba(255, 255, 255, 0.1); }
.a11y-note { margin-top: 12px; font-size: 0.8rem; color: #bfae9f; line-height: 1.5; }

/* ---------- הצהרת נגישות ---------- */
.a11y-modal { position: fixed; inset: 0; z-index: 400; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.72); direction: rtl; }
.a11y-modal.is-open { display: flex; }
.a11y-card { width: min(680px, 100%); max-height: min(86svh, 760px); overflow: auto; border-radius: 20px; background: #17100b; color: #f7f0e9; border: 1px solid rgba(255, 150, 90, 0.4); padding: clamp(20px, 3vw, 32px); text-align: right; line-height: 1.7; }
.a11y-card h2 { font-size: 1.5rem; margin-bottom: 4px; }
.a11y-card h3 { font-size: 1.05rem; color: #ffb27a; margin: 18px 0 4px; }
.a11y-card p, .a11y-card li { font-size: 0.97rem; color: #eadfd3; }
.a11y-card ul { list-style: disc; padding-inline-start: 1.3rem; }
.a11y-card a { color: #ffb27a; text-decoration: underline; }
.a11y-card .a11y-x { position: sticky; top: 0; float: left; }

/* ---------- ההתאמות ---------- */
html.a11y-t1 { font-size: 112.5%; }
html.a11y-t2 { font-size: 125%; }
html.a11y-t3 { font-size: 150%; }
html.a11y-t4 { font-size: 175%; }

html.a11y-links a:not(.a11y-opt):not(.wa):not(.a11y-btn) { text-decoration: underline !important; text-underline-offset: 4px; text-decoration-thickness: 2px; background: rgba(255, 212, 0, 0.18); outline: 1px dashed #ffd400; outline-offset: 2px; }
html.a11y-heads :is(h1, h2, h3, h4, .s-title, .faq-title, .c-title) { outline: 2px solid #ffd400; outline-offset: 6px; background: rgba(255, 212, 0, 0.1); }
html.a11y-font body, html.a11y-font body *:not(.mono):not(code):not(pre) { font-family: Arial, 'Segoe UI', Tahoma, sans-serif !important; font-style: normal !important; }
html.a11y-letters body * { letter-spacing: 0.1em !important; word-spacing: 0.18em !important; }
html.a11y-lines body * { line-height: 1.9 !important; }
html.a11y-right body * { text-align: right !important; }
html.a11y-focus *:focus, html.a11y-focus *:focus-visible { outline: 4px solid #ffd400 !important; outline-offset: 3px !important; }
html.a11y-noimg img, html.a11y-noimg .home-bgphoto, html.a11y-noimg .home-ghost, html.a11y-noimg .photo-stage { visibility: hidden !important; }
html.a11y-nomotion *, html.a11y-nomotion *::before, html.a11y-nomotion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-nomotion [data-in] { filter: none !important; }
html.a11y-cursor, html.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 9-6.5 1.6L16 20l-3 1.3-3.4-7.4L4 17z' fill='%23000' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important;
}
html.a11y-cursor .cursor { display: none !important; }
.a11y-guide { position: fixed; left: 0; right: 0; top: 0; height: 0; z-index: 140; pointer-events: none; display: none; }
html.a11y-guide-on .a11y-guide { display: block; }
.a11y-guide::before { content: ''; position: absolute; left: 0; right: 0; top: -22px; height: 44px; background: rgba(255, 212, 0, 0.14); border-block: 3px solid #ffd400; }

/* ניגודיות גבוהה (כהה) */
html.a11y-contrast { --bg: #000; --bg-2: #000; --ink: #fff; --muted: #fff; --dim: #e6e6e6; --orange: #ffd400; --orange-2: #ffd400; --amber: #ffd400; --line: #fff; --line-soft: #fff; }
html.a11y-contrast, html.a11y-contrast body { background: #000 !important; color: #fff !important; }
html.a11y-contrast .bg-fx, html.a11y-contrast .home-bgphoto, html.a11y-contrast .home-ghost, html.a11y-contrast .bp, html.a11y-contrast .spot, html.a11y-contrast #spot { display: none !important; }
html.a11y-contrast body *:not(img):not(video):not(svg):not(path):not(.a11y-btn):not(.a11y-panel *):not(.a11y-modal *) { color: #fff !important; text-shadow: none !important; box-shadow: none !important; }
html.a11y-contrast :is(a, button, .btn, .act, em, .o, .num, .bn):not(.a11y-opt):not(.a11y-x) { color: #ffd400 !important; }
html.a11y-contrast :is(.svc, .proc, .car-card, .faq-item, .cform, .menu, .hud, .fld, .code-card, header.top, .btn, .cinfo) { background: #000 !important; border: 2px solid #fff !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.a11y-contrast .btn-solid { background: #ffd400 !important; color: #000 !important; border-color: #000 !important; }
html.a11y-contrast .btn-solid * { color: #000 !important; }
html.a11y-contrast input, html.a11y-contrast textarea, html.a11y-contrast select { background: #000 !important; color: #fff !important; border: 2px solid #fff !important; }

/* ניגודיות בהירה */
html.a11y-light { --bg: #fff; --bg-2: #fff; --ink: #000; --muted: #111; --dim: #222; --orange: #a63400; --orange-2: #a63400; --amber: #7a2600; --line: #000; --line-soft: #000; }
html.a11y-light, html.a11y-light body { background: #fff !important; color: #000 !important; }
html.a11y-light .bg-fx, html.a11y-light .home-bgphoto, html.a11y-light .home-ghost, html.a11y-light .bp, html.a11y-light #spot { display: none !important; }
html.a11y-light body *:not(img):not(video):not(svg):not(path):not(.a11y-btn):not(.a11y-panel *):not(.a11y-modal *) { color: #000 !important; text-shadow: none !important; box-shadow: none !important; }
html.a11y-light :is(a, button, .btn, .act, em, .o, .num, .bn):not(.a11y-opt):not(.a11y-x) { color: #a63400 !important; }
html.a11y-light :is(.svc, .proc, .car-card, .faq-item, .cform, .menu, .hud, .fld, .code-card, header.top, .btn, .cinfo) { background: #fff !important; border: 2px solid #000 !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
html.a11y-light .btn-solid { background: #a63400 !important; border-color: #000 !important; }
html.a11y-light .btn-solid, html.a11y-light .btn-solid * { color: #fff !important; }
html.a11y-light input, html.a11y-light textarea, html.a11y-light select { background: #fff !important; color: #000 !important; border: 2px solid #000 !important; }

/* היפוך צבעים: התמונות והווידאו חוזרים לצבעם */
html.a11y-invert :is(img, video) { filter: invert(1) hue-rotate(180deg); }

/* גלילה טבעית (טקסט מוגדל): בלי סרגל המסכים שמכסה תוכן */
html.a11y-flow .hud { display: none !important; }
/* הלוגו הלבן נהיה כהה על רקע בהיר */
html.a11y-light :is(.logo img, .logo svg, header img) { filter: brightness(0) !important; }
