/* ==========================================================================
   LAYOUT.CSS — Container, Grid & Section System
   ==========================================================================
   WordPress/Elementor: These map to Container width settings and
   Section padding/margin controls.
   ========================================================================== */

/* ==========================================================================
   CONTAINER
   ========================================================================== */

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

@media (min-width: 768px) {
  .container {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

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

.section--sm {
  padding-top: calc(var(--section-padding) / 2);
  padding-bottom: calc(var(--section-padding) / 2);
}

/* ==========================================================================
   GRID SYSTEM
   ========================================================================== */

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

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

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

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

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

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

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

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

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

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

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

/* Grid column spans */
.col-span-2  { grid-column: span 2; }
.col-span-4  { grid-column: span 4; }
.col-span-8  { grid-column: span 8; }
.col-span-12 { grid-column: span 12; }

@media (max-width: 767px) {
  .col-span-2,
  .col-span-4,
  .col-span-8,
  .col-span-12 {
    grid-column: span 1;
  }
}

/* ==========================================================================
   FLEX UTILITIES
   ========================================================================== */

.flex {
  display: flex;
}

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

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

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

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

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

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

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

.gap-xl {
  gap: var(--space-xl);
}

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

.flex-grow {
  flex-grow: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

/* ==========================================================================
   SPACING HELPERS
   ========================================================================== */

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

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

.w-full { width: 100%; }

.max-w-sm  { max-width: 24rem; }
.max-w-md  { max-width: 28rem; }
.max-w-lg  { max-width: 32rem; }
.max-w-xl  { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }

/* ==========================================================================
   OVERFLOW & POSITIONING
   ========================================================================== */

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }

.overflow-hidden { overflow: hidden; }

.z-0  { z-index: 0; }
.z-10 { z-index: 10; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* ==========================================================================
   VISIBILITY HELPERS
   ========================================================================== */

.hidden { display: none; }

@media (min-width: 768px) {
  .md-hidden { display: none; }
  .md-flex   { display: flex; }
  .md-block  { display: block; }
  .md-grid   { display: grid; }
}

@media (max-width: 767px) {
  .mobile-hidden { display: none; }
  .mobile-flex   { display: flex; }
  .mobile-block  { display: block; }
}
