/* ==========================================================================
   Layout — containers, section rhythm, grids
   ========================================================================== */

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

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

.section {
  padding-block: var(--section-y);
}
.section--tight { padding-block: clamp(var(--space-7), 5vw, var(--space-8)); }

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

.section--dark {
  background: var(--color-surface-dark);
  color: var(--color-text-on-dark);
}
.section--dark h1,
.section--dark h2,
.section--dark h3 { color: var(--color-text-on-dark); }
.section--dark p  { color: var(--color-muted-on-dark); }
/* Inline links only. Without :not(.btn) this rule (0,1,1) outranks the button
   colour rules (0,1,0) and turned button text cyan — 2.55:1 on the primary fill. */
.section--dark a:not(.btn) { color: var(--color-cyan-400); }

/* Section heading block: title + optional lede, constrained for readability */
.section-head {
  max-width: 46ch;
  margin-bottom: var(--space-7);
}
.section-head--centred {
  margin-inline: auto;
  text-align: center;
}

/* --- Grids --------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--space-5);
}

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

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

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

/* Two-column editorial split: text beside an image */
.split {
  display: grid;
  gap: clamp(var(--space-6), 5vw, var(--space-8));
  align-items: center;
}
@media (min-width: 860px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--text-first > *:first-child { order: 0; }
  /* Image column slightly narrower keeps the text measure comfortable */
  .split--weighted { grid-template-columns: 1.05fr 0.95fr; }
}

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

.flow-end { display: flex; flex-wrap: wrap; gap: var(--space-3); }
