/* ================================
   LAYOUT.CSS — STRUCTURE ONLY
   (Containers, grids, splits, spacing, responsive)
   ================================ */

/* Container */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Section spacing */
.section {
  padding-block: var(--space-10);
}

.section-header {
  margin-bottom: var(--space-6);
}

.section-title {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  color: var(--color-text-muted);
  max-width: 36rem;
}

/* =========================================
   TWO-COLUMN SPLIT (Hero + other wide layouts)
   ========================================= */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-8);
  align-items: center;
}

@media (max-width: 1024px) {
  .split {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   GRID UTILITIES (3-column, 2-column, auto)
   ========================================= */
.grid-3 {
  display: grid;
  gap: var(--space-5);
}

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

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

/* Desktop columns */
@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================
   FLEX UTILITIES
   ========================================= */
.flex {
  display: flex;
}

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

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

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

.flex-wrap {
  flex-wrap: wrap;
}

/* Gap utility */
.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-6); }

/* =========================================
   RESPONSIVE TYPE + ELEMENT ADJUSTMENTS
   ========================================= */
@media (max-width: 768px) {
  .section {
    padding-block: var(--space-8);
  }

  .section-title {
    font-size: var(--fs-h3);
    line-height: var(--lh-h3);
  }

  .container {
    padding-inline: var(--space-4);
  }
}

/* =========================================
   FULL-WIDTH BACKGROUND STRIPS
   ========================================= */
.full-width-bg {
  width: 100%;
  padding-block: var(--space-10);
}

/* Optional: white sheet wrapper for inner sections */
.sheet {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 3vw, 32px);
}

/* Small header layout used by some pages */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

/* =========================================
   MOBILE STACKING HELPERS
   ========================================= */
.stack-mobile {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .stack-mobile {
    flex-direction: row;
  }
}

/* =========================================
   HERO-SPECIFIC OPTIONAL SPACING (safe)
   ========================================= */
.hero {
  padding-block: var(--space-10);
}

@media (max-width: 768px) {
  .hero {
    padding-block: var(--space-8);
  }
}

/* =========================================
   FOOTER GRID HANDLED IN components.css
   ========================================= */