/* Foundational element styles. Loads after tokens.css. */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-hebrew);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[lang="en"] body, body.lang-en { font-family: var(--font-english); }

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

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

h1 { font-size: var(--text-2xl); letter-spacing: -0.02em; font-weight: var(--weight-black); }
h2 { font-size: var(--text-xl); font-weight: var(--weight-bold); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

p { margin: 0; }

a {
  color: var(--olive-deep);
  text-decoration: none;
  transition: color var(--duration-quick) var(--easing-out);
}
a:hover { color: var(--olive-primary); }
a:focus-visible {
  outline: 2px solid var(--olive-primary);
  outline-offset: 3px;
  border-radius: 2px;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
}
button:focus-visible {
  outline: 2px solid var(--olive-primary);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: 0.5; }

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

::selection { background: var(--gold-faint); color: var(--text-primary); }

/* Reusable patterns */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--space-4);
}
.container--narrow { max-width: var(--container-narrow); }

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 14px 32px;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  background: var(--olive-deep);
  color: var(--text-inverse);
  box-shadow: var(--shadow-button);
  transition:
    background var(--duration-quick) var(--easing-out),
    box-shadow var(--duration-medium) var(--easing-out),
    transform var(--duration-quick) var(--easing-out);
  letter-spacing: -0.01em;
}
.btn:hover {
  background: var(--olive-darker);
  color: var(--text-inverse);
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn--terracotta {
  background: var(--terracotta-deep);
}
.btn--terracotta:hover { background: var(--terracotta); }

.btn--ghost {
  background: transparent;
  color: var(--olive-deep);
  box-shadow: none;
  border: 2px solid var(--olive-deep);
  padding: 12px 30px;
}
.btn--ghost:hover {
  background: var(--olive-deep);
  color: var(--text-inverse);
  box-shadow: none;
}

.btn--lg { padding: 18px 40px; font-size: var(--text-base); }
.btn--block { width: 100%; justify-content: center; }

/* Cards */

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}

/* Utilities */

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-terracotta { color: var(--terracotta-deep); }
.text-olive { color: var(--olive-deep); }
.text-gold { color: var(--gold-deep); }

.font-display { font-family: var(--font-display); }
.font-hebrew  { font-family: var(--font-hebrew); }

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