/* ===== LAYOUT SYSTEMS ===== */
/* Grid and layout utilities for Onyx Mail */

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container--full {
  max-width: none;
}

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

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

/* ===== SECTION LAYOUTS ===== */
.section {
  padding: var(--space-4xl) 0;
}

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

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

.section--hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* ===== GRID SYSTEM ===== */
.grid {
  display: grid;
  gap: var(--space-lg);
}

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

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

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

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

.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
}

.grid--features {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2xl);
}

/* ===== FLEXBOX UTILITIES ===== */
.flex {
  display: flex;
}

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

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

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

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

/* Justify Content */
.justify-start {
  justify-content: flex-start;
}

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

.justify-end {
  justify-content: flex-end;
}

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

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

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

/* Align Items */
.items-start {
  align-items: flex-start;
}

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

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

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

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

/* ===== POSITIONING ===== */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

/* Common positioning patterns */
.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.center-absolute {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ===== Z-INDEX UTILITIES ===== */
.z-dropdown {
  z-index: var(--z-dropdown);
}

.z-sticky {
  z-index: var(--z-sticky);
}

.z-fixed {
  z-index: var(--z-fixed);
}

.z-modal {
  z-index: var(--z-modal);
}

/* ===== OVERFLOW ===== */
.overflow-hidden {
  overflow: hidden;
}

.overflow-visible {
  overflow: visible;
}

.overflow-auto {
  overflow: auto;
}

.overflow-scroll {
  overflow: scroll;
}

.overflow-x-hidden {
  overflow-x: hidden;
}

.overflow-y-hidden {
  overflow-y: hidden;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

/* ===== DISPLAY UTILITIES ===== */
.block {
  display: block;
}

.inline {
  display: inline;
}

.inline-block {
  display: inline-block;
}

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

.hidden {
  display: none;
}

/* ===== RESPONSIVE LAYOUT CLASSES ===== */
/* Mobile-first responsive grid */
@media (max-width: 767px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
  
  .grid--stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }
  
  .grid--features {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .flex--mobile-column {
    flex-direction: column;
  }
  
  .flex--mobile-wrap {
    flex-wrap: wrap;
  }
  
  .hidden-mobile {
    display: none;
  }
  
  .section {
    padding: var(--space-2xl) 0;
  }
  
  .section--hero {
    min-height: 100vh;
    padding: var(--space-xl) 0;
  }
}

@media (min-width: 768px) {
  .hidden-desktop {
    display: none;
  }
}

/* ===== ASPECT RATIO ===== */
.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-4-3 {
  aspect-ratio: 4 / 3;
}

/* ===== LAYOUT PATTERNS ===== */
/* Common layout patterns for the application */

/* Two-column layout with sidebar */
.layout-sidebar {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-2xl);
}

@media (max-width: 1023px) {
  .layout-sidebar {
    grid-template-columns: 1fr;
  }
}

/* Hero layout with content centering */
.layout-hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

/* Card grid layout */
.layout-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
  margin: var(--space-2xl) 0;
}

/* Content layout with max width */
.layout-content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-2xl) 0;
}

/* ===== SPACING UTILITIES ===== */
/* Gap utilities for flex and grid */
.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); }
.gap-2xl { gap: var(--space-2xl); }