/**
 * Layout Styles
 * Global layout patterns and section structure
 */

/* ========================================================================
   SECTION PATTERNS
   ======================================================================== */

.section {
  position: relative;
  width: 100%;
  padding: var(--space-3xl) 0;
  overflow: hidden;
}

.section-wrapper {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

@media (min-width: 1280px) {
  .section-wrapper {
    padding: 0 var(--space-lg);
  }
}

/* Section spacing variations */
.section--compact {
  padding: var(--space-2xl) 0;
}

.section--spacious {
  padding: var(--space-4xl) 0;
}

/* Background variations */
.section--light {
  background-color: var(--color-grey-50);
}

.section--dark {
  background-color: var(--color-grey-900);
  color: var(--color-white);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--color-white);
}

/* ========================================================================
   SECTION HEADERS
   Consistent styling for section titles and subtitles
   Central alignment for elegant Apple-style symmetry
   ======================================================================== */

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

/* Ensure all sections maintain central alignment for titles/headers */
#foundations,
#domains,
#tools,
#methods,
#pricing {
  text-align: center;
}

/* Grids and card containers centered within sections */
.foundation-grid,
.domain-carousel,
.methods-grid,
.pricing-tiers,
.grid {
  margin-left: auto;
  margin-right: auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  background: var(--color-grey-100);
  color: var(--color-grey-700);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--space-4);
  color: var(--color-grey-900);
}

.section-subtitle {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  color: var(--color-grey-600);
  max-width: 700px;
  margin: 0 auto;
}

/* Dark mode variations */
.section--dark .section-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-grey-300);
}

.section--dark .section-title {
  color: var(--color-white);
}

.section--dark .section-subtitle {
  color: var(--color-grey-400);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .section {
    padding: var(--space-2xl) 0;
  }

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

  .section--spacious {
    padding: var(--space-3xl) 0;
  }

  .section-title {
    font-size: var(--font-size-4xl);
  }

  .section-subtitle {
    font-size: var(--font-size-base);
  }
}

/* ========================================================================
   GRID LAYOUTS
   Common grid patterns used throughout the site
   ======================================================================== */

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

/* Two column grid */
.grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

/* Three column grid */
.grid--3col {
  grid-template-columns: repeat(3, 1fr);
}

/* Four column grid */
.grid--4col {
  grid-template-columns: repeat(4, 1fr);
}

/* Auto-fit responsive grid */
.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

/* Responsive grid adjustments */
@media (max-width: 1024px) {
  .grid--4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

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

/* ========================================================================
   FLEX LAYOUTS
   ======================================================================== */

.flex {
  display: flex;
}

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

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

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

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

/* Gap utilities */
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

/* ========================================================================
   SPACING UTILITIES
   ======================================================================== */

/* Margin utilities */
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

/* Padding utilities */
.p-0 { padding: 0; }
.p-xs { padding: var(--space-xs); }
.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-xs { padding-top: var(--space-xs); padding-bottom: var(--space-xs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-xl); padding-bottom: var(--space-xl); }

.px-0 { padding-left: 0; padding-right: 0; }
.px-xs { padding-left: var(--space-xs); padding-right: var(--space-xs); }
.px-sm { padding-left: var(--space-sm); padding-right: var(--space-sm); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.px-xl { padding-left: var(--space-xl); padding-right: var(--space-xl); }

/* ========================================================================
   FOOTER
   Moved to styles/footer.css for better modularity
   ======================================================================== */
