/* ==========================================================================
   Base — Reset + Semantic Defaults
   Mobile-first, RTL-first (v3 §6). כל ערך מפנה לטוקנים מ-tokens.css.
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text-primary);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-navy-900);
  line-height: 1.2;
  margin: 0 0 var(--space-3);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--color-blue-600);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* --- Focus state — עקבי לכל האתר, v2 §7 / v6 §4 --- */
:focus-visible {
  outline: 2.5px solid var(--color-blue-600);
  outline-offset: 3px;
}

/* --- Skip link — נגישות מקלדת, קופץ לתוכן הראשי --- */
.skip-link {
  position: absolute;
  right: var(--space-3);
  top: -100px;
  background: var(--color-navy-900);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: var(--z-modal);
  transition: top var(--duration-fast) var(--ease-standard);
}
.skip-link:focus { top: var(--space-3); }

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.container--prose { max-width: 72ch; }
.container--center { text-align: center; }
@media (min-width: 768px) {
  .container { padding: 0 var(--space-5); }
}

/* --- Reduced motion — מכבד את בחירת המשתמש, v3 §28 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Visually hidden but accessible to screen readers --- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
