/* ==========================================================================
   LAYOUT — Grid System and Responsive Containers
   ========================================================================== 
   Structure definitions for responsive pages.
   Implements grid systems, flex utilities, and spacing helpers.
   ========================================================================== */

/* -----------------------------------------------------------------------
   CONTAINERS
   ----------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: 1200px;
  padding-left: var(--fa-space-24);
  padding-right: var(--fa-space-24);
  margin-left: auto;
  margin-right: auto;
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1440px;
}

/* -----------------------------------------------------------------------
   SECTIONS
   ----------------------------------------------------------------------- */

.section {
  padding-top: var(--fa-space-80);
  padding-bottom: var(--fa-space-80);
  position: relative;
  overflow: hidden;
}

@media (max-width: 767px) {
  .section {
    padding-top: var(--fa-space-48);
    padding-bottom: var(--fa-space-48);
  }
}

.section--dark {
  background-color: var(--fa-color-brand-navy);
  color: var(--fa-color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--fa-color-text-inverse);
}

/* -----------------------------------------------------------------------
   GRID SYSTEM
   ----------------------------------------------------------------------- */

.grid {
  display: grid;
  gap: var(--fa-space-24);
}

.grid--gap-lg {
  gap: var(--fa-space-40);
}

/* Mobile-first columns (default: 1 col) */
.grid--2,
.grid--3,
.grid--4 {
  grid-template-columns: 1fr;
}

/* Tablet columns (min 768px) */
@media (min-width: 768px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* -----------------------------------------------------------------------
   FLEX UTILITIES
   ----------------------------------------------------------------------- */

.flex {
  display: flex;
}

.flex--center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex--align-center {
  display: flex;
  align-items: center;
}

.flex--between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex--column {
  display: flex;
  flex-direction: column;
}

.flex--gap-sm {
  gap: var(--fa-space-8);
}

.flex--gap-md {
  gap: var(--fa-space-16);
}

.flex--gap-lg {
  gap: var(--fa-space-24);
}

/* -----------------------------------------------------------------------
   RESPONSIVE UTILITIES
   ----------------------------------------------------------------------- */

.hide-mobile {
  display: none !important;
}

.hide-desktop {
  display: block !important;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: block !important;
  }
  
  .hide-desktop {
    display: none !important;
  }
  
  .flex-row-desktop {
    flex-direction: row !important;
  }
}

/* Spacing Helpers */
.margin-bottom-sm { margin-bottom: var(--fa-space-8); }
.margin-bottom-md { margin-bottom: var(--fa-space-16); }
.margin-bottom-lg { margin-bottom: var(--fa-space-32); }
.margin-bottom-xl { margin-bottom: var(--fa-space-48); }
