/* ============================================================
   STAV — Base / איפוס וסגנונות בסיס
   משתמש ב-CSS Logical Properties כדי לתמוך אוטומטית ב-RTL/LTR.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--p-md);          /* 16px — Paragraph M */
  line-height: var(--p-md-lh);     /* 22px */
  font-weight: var(--fw-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-anchor: none;           /* מבטל scroll-anchoring — מונע לולאת משוב כשההאדר ה-sticky מתכווץ */
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-accent-hover); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  text-wrap: balance;
}
/* גדלים/line-height/tracking מהטוקנים — רספונסיבי (Desktop ↔ Mobile) */
h1 { font-size: var(--h1-size); line-height: var(--h1-lh); letter-spacing: var(--h1-tracking); }
h2 { font-size: var(--h2-size); line-height: var(--h2-lh); letter-spacing: var(--h2-tracking); }
h3 { font-size: var(--h3-size); line-height: var(--h3-lh); letter-spacing: var(--h3-tracking); }
h4 { font-size: var(--h4-size); line-height: var(--h4-lh); letter-spacing: var(--h4-tracking); }
h5 { font-size: var(--h5-size); line-height: var(--h5-lh); letter-spacing: var(--h5-tracking); }
h6 { font-size: var(--h6-size); line-height: var(--h6-lh); letter-spacing: var(--h6-tracking); }

p { line-height: var(--p-md-lh); }

/* מחלקות שירות לסקאלת הפסקאות / Paragraph scale utilities */
.p-xl { font-size: var(--p-xl); line-height: var(--p-xl-lh); }
.p-lg { font-size: var(--p-lg); line-height: var(--p-lg-lh); }
.p-md { font-size: var(--p-md); line-height: var(--p-md-lh); }
.p-sm { font-size: var(--p-sm); line-height: var(--p-sm-lh); }
.p-xs { font-size: var(--p-xs); line-height: var(--p-xs-lh); }

ul, ol { padding-inline-start: 1.25em; }

blockquote {
  border-inline-start: 3px solid var(--color-accent);
  padding-inline-start: var(--space-md);
  color: var(--color-text-muted);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---------- נגישות / a11y ---------- */
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  /* width/height/clip/overflow מגיעים מ-.screen-reader-text (המחלקה השנייה על אותו אלמנט) —
     אין להוסיף כאן inset-inline-start:-9999px: באתר RTL זה יוצר overflow-x אמיתי וניתן לגלילה
     (בניגוד לאתרי LTR שם הטריק הישן הזה "בטוח"). ה-clip כבר מסתיר את האלמנט לחלוטין בלי זה. */
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  z-index: var(--z-modal);
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  padding: var(--space-sm) var(--space-md);
}
