/* ============================================================================
   LAYOUT.CSS — Layout System & Utilities
   ============================================================================
   Containers, sections, grid system, flex utilities, and responsive breakpoints.
   
   Breakpoints:
     480px  — Mobile landscape / large phone
     768px  — Tablet portrait
     1024px — Tablet landscape / small desktop
     1280px — Large desktop
   
   Approach: Mobile-first — base styles target mobile, then build up.
   ============================================================================ */


/* ---------------------------------------------------------------------------
   CONTAINERS
   ---------------------------------------------------------------------------
   Horizontally centered content wrappers with max-width constraints.
   --------------------------------------------------------------------------- */

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

.container-sm {
  max-width: 800px;
}

.container-lg {
  max-width: 1400px;
}


/* ---------------------------------------------------------------------------
   SECTIONS
   ---------------------------------------------------------------------------
   Full-width page sections with consistent vertical rhythm.
   Desktop: 128px vertical padding / Mobile: 80px
   --------------------------------------------------------------------------- */

.section {
  position: relative;
  overflow: hidden;
  padding: var(--space-20) 0;
}

@media (min-width: 768px) {
  .section {
    padding: var(--space-32) 0;
  }
}


/* Section Header — Centered title + description block */

.section-header {
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .section-header {
    margin-bottom: var(--space-16);
  }
}

.section-header h2 {
  font-size: var(--text-h2);
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-body-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}


/* Section Variants */

.section.dark-section {
  background: var(--color-bg-dark);
  color: var(--color-text-white);
}

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

.section.dark-section p {
  color: var(--color-text-light);
}

.section.dark-section .section-header p {
  color: var(--color-text-light);
}

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


/* ---------------------------------------------------------------------------
   GRID SYSTEM
   ---------------------------------------------------------------------------
   CSS Grid utilities for common column layouts.
   Mobile: 1 column → Tablet: 2 columns → Desktop: full grid.
   --------------------------------------------------------------------------- */

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

/* 2-column grid */
.grid-2 {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3-column grid */
.grid-3 {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

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

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

/* 4-column grid */
.grid-4 {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
}

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

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

/* 5-column grid */
.grid-5 {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-5 {
    grid-template-columns: repeat(5, 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 {
  flex-direction: column;
}

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


/* ---------------------------------------------------------------------------
   GAP UTILITIES
   --------------------------------------------------------------------------- */

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

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

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


/* ---------------------------------------------------------------------------
   TEXT UTILITIES
   --------------------------------------------------------------------------- */

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}


/* ---------------------------------------------------------------------------
   SPACING UTILITIES
   --------------------------------------------------------------------------- */

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}


/* ---------------------------------------------------------------------------
   RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------------------------
   Fine-grained adjustments at each breakpoint for layout, spacing, & type.
   --------------------------------------------------------------------------- */

/* ── Large Desktop ≤ 1280px ─────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .container {
    max-width: 1100px;
  }

  .container-lg {
    max-width: 1200px;
  }
}

/* ── Tablet Landscape ≤ 1024px ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .container {
    max-width: 960px;
  }

  .section {
    padding: var(--space-24) 0;
  }

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

/* ── Tablet Portrait ≤ 768px ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding-left: var(--space-5);
    padding-right: var(--space-5);
  }

  .section {
    padding: var(--space-20) 0;
  }

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

  .section-header p {
    font-size: var(--text-body);
  }
}

/* ── Mobile ≤ 480px ─────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }

  .section {
    padding: var(--space-16) 0;
  }

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