/* 20 — Layout primitives: containers, grids, splits, section rhythm */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* Equal-width responsive grids. Collapse to one column on phones. */
.grid {
  display: grid;
  gap: 1.75rem;
  grid-template-columns: minmax(0, 1fr); /* minmax(0,…) so long words can't stretch a column past the viewport */
}
.grid > *,
.split > * { min-width: 0; }

.grid--tight { gap: 1.25rem; }
.grid--loose { gap: 2.75rem; }

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

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

/* Two-column split, stacks below 64rem. Modifiers set the column ratio. */
.split {
  display: grid;
  gap: 4rem;
  grid-template-columns: minmax(0, 1fr);
}

.split--center { align-items: center; }

@media (min-width: 64rem) {
  .split { grid-template-columns: 1fr 1fr; gap: 6rem; }
  .split--aside { grid-template-columns: 1.25fr 0.75fr; gap: 5rem; }
  .split--narrow-aside { grid-template-columns: 1fr 19rem; gap: 4.5rem; align-items: start; }
  .split--cover { grid-template-columns: 0.8fr 1.2fr; gap: 5rem; align-items: center; }
  .split--cover-page { grid-template-columns: 22rem 1fr; gap: 5rem; align-items: start; }
  .split--resources { grid-template-columns: 1fr 2fr; gap: 5.5rem; }
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.center { display: flex; justify-content: center; }

/* Vertical rhythm for page sections */
.section { padding-block: 5.5rem; position: relative; }
.section--xl { padding-block: 7.5rem; }
.section--white { background: var(--white); }
.section--offwhite { background: var(--off-white); }
.section--paper {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(32, 120, 64, 0.055) 0 1px, transparent 1.5px),
    radial-gradient(circle at 82% 72%, rgba(30, 104, 194, 0.05) 0 1px, transparent 1.5px),
    linear-gradient(90deg, rgba(28, 43, 69, 0.018) 1px, transparent 1px);
  background-size: 23px 23px, 31px 31px, 7px 100%;
}
.section--ruled { border-bottom: 1px solid var(--border); }
.section--ruled-top { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

@media (min-width: 48rem) {
  .section { padding-block: 7rem; }
  .section--xl { padding-block: 10rem; }
}

/* Interior pages */
.page-body { padding-block: 5.5rem 7rem; }
.page-body--center { padding-block: 7rem; text-align: center; }
.page-section { margin-top: 8rem; }
.page-section--ruled { padding-top: 4.5rem; border-top: 1px solid var(--border); }

@media (min-width: 48rem) {
  .page-body { padding-block: 8rem 10rem; }
}

/* Heading + optional action, side by side on wide screens */
.section-head {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3.25rem;
}

.section-head--center { align-items: center; text-align: center; margin-bottom: 4.5rem; }
.section-head--wide { margin-bottom: 5rem; }

@media (min-width: 48rem) {
  .section-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 3rem; }
  .section-head--center { flex-direction: column; align-items: center; }
}

.section-title {
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  color: var(--slate);
  line-height: 1.3;
  max-width: 44rem;
}

.section-title--lg { font-size: clamp(1.7rem, 3.5vw, 2.6rem); margin-bottom: 1.75rem; }
.section-title--xl { font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.16; margin-bottom: 1.75rem; }
.section-title--light { color: var(--white); max-width: 32rem; }

.section-lede {
  margin-top: 1.1rem;
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--muted);
}

.section-lede--lg { font-size: 1.0625rem; line-height: 1.85; color: var(--body-text); margin-bottom: 2.5rem; }

