/* layout.css — structural primitives + base typography on existing tokens.
   Loaded after reset.css + variables.css, before components.css. */

/* ---------- Base typography ---------- */
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-text);
  background: var(--color-surface);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.15;
  color: var(--color-primary);
  font-weight: 800;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
}
h4 {
  font-size: var(--fs-h4);
  font-weight: 700;
}

p {
  line-height: 1.6;
}

strong,
b {
  font-weight: 600;
}

/* Anchor-offset for sticky header (token-driven) */
html {
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--wide {
  max-width: var(--container-wide);
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--section-y);
}

.section--alt {
  background: var(--color-surface-alt);
}

.section__head {
  max-width: 720px;
  margin-bottom: var(--space-6);
}

.section__head--center {
  margin-inline: auto;
  text-align: center;
}

.section__eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-600);
  margin-bottom: var(--space-2);
}

.section__title {
  margin-bottom: var(--space-3);
}

.section__lead {
  font-size: var(--fs-body-lg);
  color: var(--color-text-muted);
}

/* ---------- Header shell ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  transition: height 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  height: var(--header-h-scrolled);
  box-shadow: var(--shadow-sm);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ---------- Footer grid ---------- */
.site-footer {
  background: var(--color-primary);
  color: var(--color-text-on-dark-muted);
  padding-block: var(--space-8) var(--space-5);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

@media (min-width: 1280px) {
  .site-footer__grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
  }
}

/* ---------- Responsive grids ---------- */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.grid--2,
.grid--3,
.grid--4 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -120px;
  z-index: 200;
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--space-3);
}

/* ---------- Utilities ---------- */
.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;
}

.flow > * + * {
  margin-top: var(--space-4);
}
