/*
  isrMouse - design tokens (משתני CSS בלבד, בלי כללי רכיבים)
  מקור האמת למפרט: docs/team/design-spec.md
  - ערכת צבעים: בהיר כברירת מחדל; כהה לפי prefers-color-scheme; כפייה ידנית עם
    <html data-theme="light|dark">. בלי data-theme = אוטומטי לפי המערכת.
  - גופנים: גופן מערכת בלבד, בלי טעינה מהרשת.
  - מאפיינים לוגיים (inline/block) בלבד בצד הצרכן; אין כאן left/right.
  - צורת תצוגה: <html data-form="tv"> מגדיל מטרות, גופנים ומסגרת פוקוס (10-foot UI).
*/

:root {
  color-scheme: light;

  /* ---------- צבעים: מצב בהיר ---------- */
  --is-bg:            #F3F7FA; /* רקע מסך */
  --is-surface:       #FFFFFF; /* כרטיס, פאנל, דף */
  --is-surface-2:     #E8EFF4; /* כפתור משני, שדה, מקש */
  --is-surface-sunken:#E3ECF3; /* משטח מגע */
  --is-border:        #D3DEE7; /* קו עדין, מפריד (לא נושא מידע) */
  --is-border-strong: #6F8499; /* גבול רכיב אינטראקטיבי, 3:1 לפחות */

  --is-text:          #0F1B26;
  --is-text-muted:    #475A6B;
  --is-text-on-accent:#FFFFFF;

  --is-accent:        #0A6B8F;
  --is-accent-hover:  #085A78;
  --is-accent-active: #064B65;
  --is-accent-soft:   #D9EEF6; /* רקע תג/בחירה; הטקסט עליו --is-accent */
  --is-focus:         #0A6B8F;

  --is-brand-cyan:    #22D3E6; /* לוגו ואלמנטים דקורטיביים בלבד, לא לטקסט */
  --is-brand-white:   #FFFFFF;

  --is-success:       #1B7A4B;
  --is-success-soft:  #DDF3E8;
  --is-warning:       #8A5A00;
  --is-warning-soft:  #FFF1CC;
  --is-danger:        #B3261E;
  --is-danger-soft:   #FDE4E1;
  --is-danger-fill:   #B3261E; /* כפתור הרסני; טקסט עליו לבן */

  --is-scrim:         rgba(15, 27, 38, 0.48);
  --is-glass:         rgba(255, 255, 255, 0.72);
  --is-pad-glow:      rgba(10, 107, 143, 0.10); /* הילה פנימית של משטח המגע */

  /* ---------- צל ---------- */
  --is-shadow-1: 0 1px 2px rgba(15, 27, 38, 0.10), 0 1px 1px rgba(15, 27, 38, 0.06);
  --is-shadow-2: 0 4px 14px rgba(15, 27, 38, 0.12);
  --is-shadow-3: 0 12px 32px rgba(15, 27, 38, 0.18);

  /* ---------- טיפוגרפיה ---------- */
  --is-font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system,
                  "Noto Sans Hebrew", "Arial Hebrew", Roboto, "Helvetica Neue", Arial, sans-serif;
  --is-font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Roboto Mono", monospace;

  --is-fs-xs:   0.8125rem; /* 13: תגיות משנה בלבד */
  --is-fs-sm:   0.9375rem; /* 15 */
  --is-fs-md:   1rem;      /* 16: גוף */
  --is-fs-lg:   1.125rem;  /* 18 */
  --is-fs-xl:   1.375rem;  /* 22: כותרת מסך */
  --is-fs-2xl:  1.75rem;   /* 28 */
  --is-fs-3xl:  2.25rem;   /* 36 */
  --is-fs-display: 3rem;   /* 48: קוד צימוד */

  --is-lh-tight: 1.25;
  --is-lh-body:  1.55;     /* עברית צריכה מרווח שורה נדיב */
  --is-fw-regular: 400;
  --is-fw-strong:  700;    /* 400/700 בלבד, למניעת סינתזה של משקלים */

  /* ---------- ריווח (בסיס 4) ---------- */
  --is-space-1: 4px;
  --is-space-2: 8px;
  --is-space-3: 12px;
  --is-space-4: 16px;
  --is-space-5: 20px;
  --is-space-6: 24px;
  --is-space-8: 32px;
  --is-space-10: 40px;
  --is-space-14: 56px;
  --is-space-18: 72px;

  --is-page-gutter: var(--is-space-4); /* שוליים צדדיים של מסך */
  --is-safe-inset: 0px;                /* ב-TV: אזור בטוח */

  /* ---------- רדיוסים: שפת קפסולה, נגזרת מהלוגו ---------- */
  --is-r-xs: 6px;
  --is-r-sm: 10px;
  --is-r-md: 14px;
  --is-r-lg: 20px;
  --is-r-xl: 28px;
  --is-r-pill: 999px;

  /* ---------- גדלי מגע ---------- */
  --is-touch-min:     48px; /* רצפה לכל מטרה */
  --is-touch-comfort: 56px; /* פעולות ראשיות */
  --is-touch-large:   72px; /* כפתורי עכבר, ניגון */
  --is-icon-sm: 20px;
  --is-icon-md: 24px;
  --is-icon-lg: 32px;
  --is-target-gap: 8px;     /* מרווח מינימלי בין מטרות סמוכות */

  /* ---------- פוקוס ---------- */
  --is-focus-width: 3px;
  --is-focus-offset: 2px;
  --is-focus-ring: 0 0 0 var(--is-focus-offset) var(--is-bg), 0 0 0 calc(var(--is-focus-offset) + var(--is-focus-width)) var(--is-focus);

  /* ---------- פריסה ---------- */
  --is-bp-tablet: 600px;    /* לשימוש במסמך; media query אינו תומך ב-var */
  --is-bp-desktop: 1024px;
  --is-nav-height: 64px;    /* ניווט תחתון בטלפון */
  --is-rail-width: 88px;    /* פס ניווט בטאבלט */
  --is-sidebar-width: 248px;/* ניווט בשולחן */
  --is-content-max: 1200px;
  --is-pad-min-block: 40vh; /* גובה מינימלי למשטח המגע כשפאנל פתוח (טלפון) */

  /* ---------- שכבות ---------- */
  --is-z-nav: 10;
  --is-z-sheet: 20;
  --is-z-dialog: 30;
  --is-z-toast: 40;

  /* ---------- תנועה (קצרה) ---------- */
  --is-dur-fast: 100ms;
  --is-dur-base: 160ms;
  --is-dur-slow: 240ms;
  --is-dur-sheet: 280ms;
  --is-ease-out: cubic-bezier(0.2, 0, 0, 1);
  --is-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --is-press-scale: 0.97;
  --is-focus-scale: 1;      /* ב-TV: 1.06 */
}

/* ---------- מצב כהה: אוטומטי לפי המערכת ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --is-bg:            #0E151C;
    --is-surface:       #141D26;
    --is-surface-2:     #1B2733;
    --is-surface-sunken:#0A1016;
    --is-border:        #263544;
    --is-border-strong: #5B7084;

    --is-text:          #E8EFF5;
    --is-text-muted:    #9FB1C2;
    --is-text-on-accent:#06222E;

    --is-accent:        #5CC8E8;
    --is-accent-hover:  #7AD6F0;
    --is-accent-active: #9BE0F4;
    --is-accent-soft:   #17313E;
    --is-focus:         #8BDDF2;

    --is-brand-cyan:    #22D3E6;
    --is-brand-white:   #F4F7FA;

    --is-success:       #5FD39A;
    --is-success-soft:  #12301F;
    --is-warning:       #F2C14E;
    --is-warning-soft:  #3A2D0B;
    --is-danger:        #FF8A80;
    --is-danger-soft:   #3D1816;
    --is-danger-fill:   #FF8A80; /* טקסט עליו --is-text-on-accent */

    --is-scrim:         rgba(2, 6, 10, 0.64);
    --is-glass:         rgba(20, 29, 38, 0.72);
    --is-pad-glow:      rgba(92, 200, 232, 0.08);

    --is-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
    --is-shadow-2: 0 4px 14px rgba(0, 0, 0, 0.45);
    --is-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.55);
  }
}

/* ---------- מצב כהה: בחירה ידנית (זהה לבלוק שלמעלה) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --is-bg:            #0E151C;
  --is-surface:       #141D26;
  --is-surface-2:     #1B2733;
  --is-surface-sunken:#0A1016;
  --is-border:        #263544;
  --is-border-strong: #5B7084;

  --is-text:          #E8EFF5;
  --is-text-muted:    #9FB1C2;
  --is-text-on-accent:#06222E;

  --is-accent:        #5CC8E8;
  --is-accent-hover:  #7AD6F0;
  --is-accent-active: #9BE0F4;
  --is-accent-soft:   #17313E;
  --is-focus:         #8BDDF2;

  --is-brand-cyan:    #22D3E6;
  --is-brand-white:   #F4F7FA;

  --is-success:       #5FD39A;
  --is-success-soft:  #12301F;
  --is-warning:       #F2C14E;
  --is-warning-soft:  #3A2D0B;
  --is-danger:        #FF8A80;
  --is-danger-soft:   #3D1816;
  --is-danger-fill:   #FF8A80;

  --is-scrim:         rgba(2, 6, 10, 0.64);
  --is-glass:         rgba(20, 29, 38, 0.72);
  --is-pad-glow:      rgba(92, 200, 232, 0.08);

  --is-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --is-shadow-2: 0 4px 14px rgba(0, 0, 0, 0.45);
  --is-shadow-3: 0 12px 32px rgba(0, 0, 0, 0.55);
}

/* ---------- מסכי מגע גדולים ושימוש ביד אחת ---------- */
@media (min-width: 600px) {
  :root {
    --is-page-gutter: var(--is-space-6);
    --is-touch-comfort: 56px;
  }
}
@media (min-width: 1024px) {
  :root {
    --is-page-gutter: var(--is-space-8);
  }
}

/* ---------- טלוויזיה: 10-foot UI (מסך 1920x1080 ומעלה, מרחק צפייה ~3 מ') ---------- */
:root[data-form="tv"] {
  --is-fs-xs: 1.5rem;       /* 24 */
  --is-fs-sm: 1.625rem;     /* 26 */
  --is-fs-md: 1.75rem;      /* 28: גוף מינימלי */
  --is-fs-lg: 2rem;         /* 32 */
  --is-fs-xl: 2.5rem;       /* 40 */
  --is-fs-2xl: 3rem;        /* 48 */
  --is-fs-3xl: 3.75rem;     /* 60 */
  --is-fs-display: 6rem;    /* 96: קוד צימוד */

  --is-touch-min: 72px;     /* מטרת מיקוד מינימלית */
  --is-touch-comfort: 88px;
  --is-touch-large: 112px;
  --is-icon-sm: 32px;
  --is-icon-md: 40px;
  --is-icon-lg: 56px;
  --is-target-gap: 16px;

  --is-focus-width: 5px;
  --is-focus-offset: 4px;
  --is-focus-scale: 1.06;

  --is-page-gutter: 5vw;
  --is-safe-inset: 5vh;     /* overscan: 5% אנכי, 5vw אופקי */
  --is-dur-base: 200ms;
}

/* ---------- הפחתת תנועה ---------- */
@media (prefers-reduced-motion: reduce) {
  :root {
    --is-dur-fast: 0.01ms;
    --is-dur-base: 0.01ms;
    --is-dur-slow: 0.01ms;
    --is-dur-sheet: 0.01ms;
    --is-press-scale: 1;
    --is-focus-scale: 1;
  }
}
/* כפייה ידנית של הפחתת תנועה (הגדרה באפליקציה) */
:root[data-motion="reduce"] {
  --is-dur-fast: 0.01ms;
  --is-dur-base: 0.01ms;
  --is-dur-slow: 0.01ms;
  --is-dur-sheet: 0.01ms;
  --is-press-scale: 1;
  --is-focus-scale: 1;
}
