/* ==========================================================================
   LAYOUT.CSS — Grid, Flexbox & Responsive Layout Primitives
   Mobile-First Responsive System
   ========================================================================== */

/* ---------- Section Spacing ---------- */
.section {
  padding: var(--space-section) 0;
  position: relative;
  overflow: hidden;
}

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

.section--gradient {
  background: var(--gradient-section);
}

/* ---------- Grid System ---------- */
.grid {
  display: grid;
  gap: var(--space-6);
}

/* Auto-fit responsive grids */
.grid--2 {
  grid-template-columns: 1fr;
}

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

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

/* ---------- Flex Utilities ---------- */
.flex {
  display: flex;
}

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

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

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

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

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

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

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

/* ---------- Text Alignment ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ---------- Spacing Utilities ---------- */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* ==========================================
   RESPONSIVE BREAKPOINTS — Mobile First
   ========================================== */

/* ---------- Small (576px+) ---------- */
@media (min-width: 576px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

/* ---------- Large / Laptop (1024px+) ---------- */
@media (min-width: 1024px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* ---------- XL / Desktop (1280px+) ---------- */
@media (min-width: 1280px) {
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}
