/* ==========================================================================
   layout.css — Containers, section spacing, grid helpers (mobile-first)
   ========================================================================== */

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

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

/* Every top-level section */
.section {
  position: relative;
  padding-block: var(--space-2xl);
  /* Small comfortable offset so headings land near the top on anchor jumps */
  scroll-margin-top: 20px;
}

.section--blush {
  background: var(--gradient-blush);
}

.section--tight {
  padding-block: var(--space-xl);
}

/* Centered text block */
.text-center {
  text-align: center;
}

/* Grid helpers: 1 col on mobile, more as space allows */
.grid {
  display: grid;
  gap: var(--space-md);
  grid-template-columns: 1fr;
}

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

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

/* Vertical stack with consistent gap */
.stack > * + * {
  margin-top: var(--space-sm);
}
