﻿/* ============================================================
   קוסטילאטאס · נגישות + עוגיות (תאימות ת"י 5568 / חוק ישראלי)
   קובץ משותף לכל דפי האתר. נטען בכל עמוד.
   התוסף = כלי העדפות-נוחות בשליטת המשתמש בלבד (לא overlay).
   ============================================================ */

:root{
  --c-cream:#F7F4EE; --c-ink:#0E2A47; --c-ink2:#2C4A68;
  --c-glacial:#5FB6DC; --c-deep:#15648F; --c-magenta:#E11A86;
  --c-line:rgba(14,42,71,.16); --c-paper:#FFFFFF;
}

/* ---------- Skip link (חובה ת"י 5568) ---------- */
.skip-link{
  position:fixed; top:10px; inset-inline-start:-9999px; z-index:100000;
  background:var(--c-ink); color:#fff; padding:12px 22px; border-radius:10px;
  font:600 16px/1.2 'Assistant',system-ui,sans-serif; box-shadow:0 8px 30px rgba(14,42,71,.35);
}
.skip-link:focus{ inset-inline-start:14px; outline:3px solid var(--c-glacial); outline-offset:2px; }

/* ---------- Focus visibility (מקלדת) ---------- */
:where(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid var(--c-deep); outline-offset:3px; border-radius:4px;
}
html.a11y-contrast-invert :where(a,button,input,select,textarea,[tabindex]):focus-visible{ outline-color:#ffd34d; }

/* ============================================================
   1) פקדי-העדפה (מופעלים ע"י class על <html>)
   ============================================================ */

/* הדגשת קישורים */
html.a11y-links main a,
html.a11y-links footer a,
html.a11y-links header a{ text-decoration:underline !important; text-underline-offset:3px; text-decoration-thickness:2px !important; }

/* הגדלת טקסט - zoom על אזורי התוכן. עובד גם בעמודי px וגם בעמודי rem,
   ומגדיל בפועל את כל הטקסט (px לא יורש מ-font-size של root/body). הפקדים הצפים נשארים בגודלם. */
html.a11y-text-115 :is(main,footer){ zoom:1.15; }
html.a11y-text-130 :is(main,footer){ zoom:1.30; }
html.a11y-text-150 :is(main,footer){ zoom:1.50; }

/* ריווח שורות */
html.a11y-lines-16 :is(p,li,dd,blockquote){ line-height:1.6 !important; }
html.a11y-lines-20 :is(p,li,dd,blockquote){ line-height:2.0 !important; }
html.a11y-lines-16 body{ line-height:1.6; }
html.a11y-lines-20 body{ line-height:2.0; }

/* גופן קריא (OS stack בלבד, ללא webfont) */
html.a11y-readable, html.a11y-readable :not(.a11y-ui, .a11y-ui *){
  font-family:Arial,"Segoe UI","Helvetica Neue",system-ui,sans-serif !important;
  letter-spacing:normal !important;
}

/* הדגשת כותרות */
html.a11y-headings :is(h1,h2,h3){
  background:#FFF6C2 !important; color:#0E2A47 !important;
  outline:2px solid #15648F; outline-offset:2px; padding:.08em .25em; border-radius:4px;
  -webkit-text-fill-color:#0E2A47 !important; text-shadow:none !important;
}

/* סמן עכבר שחור / מוגדל (SVG data-URI) */
html.a11y-cursor-black *{ cursor:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 2 L3 21 L8 16 L11 23 L14 22 L11 15 L18 15 Z" fill="black" stroke="white" stroke-width="1.2"/></svg>') 2 2, auto !important; }
html.a11y-cursor-big *{ cursor:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 24 24"><path d="M3 2 L3 21 L8 16 L11 23 L14 22 L11 15 L18 15 Z" fill="black" stroke="white" stroke-width="1.1"/></svg>') 4 4, auto !important; }

/* עצירת הנפשות ותנועה */
html.a11y-stop-motion .bgvid, html.a11y-stop-motion .lvid{ display:none !important; }
html.a11y-stop-motion [data-reveal]{ opacity:1 !important; transform:none !important; }
html.a11y-stop-motion #scrollProgress, html.a11y-stop-motion #cursorRing{ display:none !important; }
html.a11y-stop-motion *, html.a11y-stop-motion *::before, html.a11y-stop-motion *::after{
  animation-duration:.001ms !important; animation-iteration-count:1 !important;
  transition-duration:.001ms !important; scroll-behavior:auto !important;
}

/* ---------- ניגודיות: סינון משטחי-תוכן בנפרד (לא על <html>, כדי לא לשבור position:fixed) ---------- */
html.a11y-contrast-high :is(#loader,header.nav,#mNav,main,footer){ filter:contrast(1.35); }
html.a11y-contrast-invert :is(#loader,header.nav,#mNav,main,footer){ filter:invert(1) hue-rotate(180deg); }
html.a11y-contrast-invert :is(#loader,header.nav,#mNav,main,footer) img,
html.a11y-contrast-invert :is(#loader,header.nav,#mNav,main,footer) video{ filter:invert(1) hue-rotate(180deg); }
html.a11y-contrast-mono :is(#loader,header.nav,#mNav,main,footer){ filter:grayscale(1); }
/* התוסף והבאנר (.a11y-ui) אינם ברשימה → תמיד קריאים */

/* הדפסה - איפוס מסננים/הגדלה */
@media print{
  html[class*="a11y-"] :is(#loader,header.nav,#mNav,main,footer){ filter:none !important; }
  html[class*="a11y-text-"] :is(main,footer){ zoom:1 !important; }
  .a11y-ui{ display:none !important; }
}

/* ============================================================
   2) ממשק התוסף (כפתור צף + פאנל)
   ============================================================ */
.a11y-ui{ font-family:'Kostilatas Sans',system-ui,sans-serif; }

#a11yTrigger{
  position:fixed; inset-block-end:calc(20px + env(safe-area-inset-bottom)); inset-inline-start:20px; z-index:99990;
  width:56px; height:56px; border-radius:50%; border:2px solid #fff; cursor:pointer;
  background:var(--c-deep); color:#fff; display:grid; place-items:center;
  box-shadow:0 10px 34px rgba(14,42,71,.4); transition:transform .25s, background .25s;
}
#a11yTrigger:hover{ transform:scale(1.07); background:var(--c-ink); }
#a11yTrigger svg{ width:30px; height:30px; display:block; }
body.cookie-open #a11yTrigger{ inset-block-end:calc(104px + env(safe-area-inset-bottom)); }

#a11yPanel{
  position:fixed; inset-block-end:calc(88px + env(safe-area-inset-bottom)); inset-inline-start:20px; z-index:99991;
  width:min(360px,calc(100vw - 40px)); max-height:min(78vh,640px); overflow:auto;
  background:var(--c-paper); color:var(--c-ink); border:1px solid var(--c-line);
  border-radius:18px; box-shadow:0 24px 70px rgba(14,42,71,.34);
  padding:18px; display:none;
}
#a11yPanel[data-open="true"]{ display:block; }
#a11yPanel h2{ font:700 19px/1.2 'Assistant',sans-serif; margin:0 0 4px; }
#a11yPanel .a11y-sub{ font-size:13px; color:var(--c-ink2); margin:0 0 14px; }
.a11y-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:9px; }
.a11y-card{
  border:1px solid var(--c-line); border-radius:12px; background:var(--c-cream);
  padding:11px 9px; text-align:center; cursor:pointer; color:var(--c-ink);
  font:600 13px/1.25 'Assistant',sans-serif; transition:border-color .2s, background .2s, transform .15s;
  display:flex; flex-direction:column; align-items:center; gap:6px; min-height:74px; justify-content:center;
}
.a11y-card:hover{ transform:translateY(-1px); border-color:var(--c-deep); }
.a11y-card .ic{ font-size:21px; line-height:1; }
.a11y-card .val{ font-size:11px; color:var(--c-deep); font-weight:700; min-height:13px; }
.a11y-card[aria-pressed="true"], .a11y-card.is-on{
  border-color:var(--c-deep); background:#E9F3F8; box-shadow:inset 0 0 0 1px var(--c-deep);
}
.a11y-reset{
  grid-column:1 / -1; margin-top:4px; border:1px solid var(--c-magenta); background:#fff;
  color:var(--c-magenta); border-radius:12px; padding:11px; cursor:pointer;
  font:700 14px/1 'Assistant',sans-serif;
}
.a11y-reset:hover{ background:var(--c-magenta); color:#fff; }
.a11y-foot{ margin-top:13px; font-size:11.5px; color:var(--c-ink2); line-height:1.5; }
.a11y-foot a{ color:var(--c-deep); text-decoration:underline; font-weight:700; }
#a11yClose{
  position:absolute; inset-block-start:12px; inset-inline-end:12px; width:30px; height:30px;
  border:none; background:transparent; font-size:22px; color:var(--c-ink2); cursor:pointer; line-height:1;
}
.a11y-sr{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* ============================================================
   3) באנר עוגיות (Cookies)
   ============================================================ */
#cookieBanner{
  position:fixed; inset-inline:0; inset-block-end:0; z-index:99980;
  background:var(--c-ink); color:#F4F7FA; padding:16px clamp(16px,4vw,40px); padding-block-end:calc(16px + env(safe-area-inset-bottom));
  display:none; box-shadow:0 -8px 34px rgba(14,42,71,.34);
}
#cookieBanner[data-open="true"]{ display:block; }
.cookie-inner{ max-width:1180px; margin-inline:auto; display:flex; gap:18px; align-items:center; flex-wrap:wrap; justify-content:space-between; }
.cookie-txt{ flex:1 1 460px; font-size:14px; line-height:1.6; }
.cookie-txt strong{ color:#fff; }
.cookie-txt a{ color:var(--c-glacial); text-decoration:underline; font-weight:700; }
.cookie-actions{ display:flex; gap:10px; flex-wrap:wrap; }
.cookie-actions button{
  border-radius:10px; padding:11px 20px; cursor:pointer; font:700 14px/1 'Assistant',sans-serif; border:1.5px solid transparent;
}
.ck-accept{ background:var(--c-glacial); color:var(--c-ink); border-color:var(--c-glacial); }
.ck-accept:hover{ background:#7fc8e6; }
.ck-essential{ background:transparent; color:#F4F7FA; border-color:rgba(255,255,255,.5); }
.ck-essential:hover{ border-color:#fff; }

@media (max-width:560px){
  .cookie-actions{ width:100%; }
  .cookie-actions button{ flex:1 1 auto; }
  #a11yPanel{ inset-inline-start:50%; transform:translateX(-50%); }
}

@media (prefers-reduced-motion: reduce){
  #a11yTrigger, .a11y-card{ transition:none !important; }
}

/* קישורי מסמכים בפוטר דף הבית */
.ft-legal-links{ display:flex; flex-wrap:wrap; gap:8px 20px; justify-content:center; margin:16px 0 2px; }
.ft-legal-links a{ color:inherit; opacity:.82; text-decoration:none; font-size:14px; font-weight:600; display:inline-block; padding:8px 4px; }
.ft-legal-links a:hover{ opacity:1; text-decoration:underline; }

