/* ==========================================================================
   Layout — Container, Grid, Section Spacing
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Sections */
.section {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

.section--light {
  background-color: var(--white);
}

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

.section--dark {
  background-color: var(--navy);
  color: var(--deep-text);
}

.section--deep {
  background-color: var(--deep);
  color: var(--deep-text);
}

.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--deep h2,
.section--deep h3,
.section--deep h4 {
  color: var(--white);
}

.section--dark p,
.section--deep p {
  color: rgba(255, 255, 255, 0.8);
}

.section--dark .section__header p {
  color: rgba(255, 255, 255, 0.7);
}

/* Revision 8: H2 headings on light backgrounds use blue */
.section--light h2,
.section--surface h2 {
  color: var(--blue);
}

.section__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section__header p {
  margin-left: auto;
  margin-right: auto;
  margin-top: var(--space-sm);
  color: var(--slate-light);
}

/* Grids */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive */
@media (max-width: 1024px) {
  .section {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }
}

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }

  .section {
    padding-top: var(--space-xl);
    padding-bottom: var(--space-xl);
  }

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

@media (max-width: 480px) {
  .section {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
  }
}
