/* ============================================
   Layout System
   ============================================ */

/* --- Containers --- */

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

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

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

/* --- Grid Systems --- */

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

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

/* Asymmetric layout for about sections */
.grid--asymmetric {
  grid-template-columns: 1fr;
  gap: var(--space-12);
}

@media (min-width: 768px) {
  .grid--asymmetric {
    grid-template-columns: 3fr 2fr;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .grid--asymmetric-reverse {
    grid-template-columns: 2fr 3fr;
  }
}

/* --- Flexbox Utilities --- */

.flex {
  display: flex;
}

.flex--center {
  align-items: center;
  justify-content: center;
}

.flex--between {
  align-items: center;
  justify-content: space-between;
}

.flex--column {
  flex-direction: column;
}

.flex--gap-sm {
  gap: var(--space-4);
}

.flex--gap-md {
  gap: var(--space-8);
}

.flex--gap-lg {
  gap: var(--space-12);
}

/* --- Full Bleed Sections --- */

.full-bleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
}

/* --- Section Backgrounds --- */

.bg-paper {
  background-color: var(--rice-paper);
}

.bg-warm {
  background-color: var(--rice-paper-warm);
}

.bg-cool {
  background-color: var(--rice-paper-cool);
}

.bg-dark {
  background-color: var(--ink-black);
  color: var(--rice-paper);
}

.bg-dark h1,
.bg-dark h2,
.bg-dark h3,
.bg-dark h4,
.bg-dark h5,
.bg-dark h6 {
  color: var(--rice-paper);
}

.bg-dark p {
  color: var(--ink-wash);
}

/* --- Vertical Rhythm --- */

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

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

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