/* ==========================================================================
   AETHER DESIGN SYSTEM — LAYOUT & GRID
   Source: docs/04-DESIGN-SYSTEM-OFICIAL.md
   ========================================================================== */

.container {
  width: 100%;
  max-width: calc(var(--container-max-width) + (var(--page-margin) * 2));
  margin-inline: auto;
  padding-left: max(var(--page-margin), env(safe-area-inset-left));
  padding-right: max(var(--page-margin), env(safe-area-inset-right));
}

.container-full {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Master 12-Column Grid System */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2vw, 32px);
  row-gap: var(--space-xl);
}

/* Responsive Column Spans */
.col-12, .col-11, .col-10, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2 {
  min-width: 0;
}

.col-12 { grid-column: span 12; }
.col-11 { grid-column: span 11; }
.col-10 { grid-column: span 10; }
.col-9  { grid-column: span 9; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
.col-2  { grid-column: span 2; }

/* Asymmetrical Hero Layout (7 cols text / 5 cols visual) */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(24px, 3vw, 48px);
  align-items: stretch;
}

.hero-text-col {
  grid-column: 1 / span 7;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.hero-visual-col {
  grid-column: 8 / span 5;
  position: relative;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

/* Section Wrapper and Rhythm */
.site-section {
  position: relative;
  padding-top: var(--section-space-y);
  padding-bottom: var(--section-space-y);
  overflow: hidden;
}

.site-section-compact {
  padding-top: clamp(40px, 5vw, 80px);
  padding-bottom: clamp(40px, 5vw, 80px);
}

/* Hairline Grid Dividers (1px subtle precision) */
.hairline-divider {
  width: 100%;
  height: 1px;
  background-color: var(--border-light);
  border: none;
  margin: 0;
}

.surface-dark .hairline-divider,
.surface-blue .hairline-divider {
  background-color: var(--border-dark);
}

/* Editorial Metadata Line */
.section-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.section-meta-header .eyebrow {
  margin-bottom: 0;
}

.surface-dark .section-meta-header,
.surface-blue .section-meta-header {
  border-bottom-color: var(--border-dark);
}

/* Tablet Breakpoint (768px – 1023px): 8 Columns */
@media (max-width: 1023px) {
  .hero-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-2xl);
  }

  .hero-text-col,
  .hero-visual-col {
    grid-column: 1 / -1;
  }

  .grid-12 {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    column-gap: 20px;
  }

  .col-12, .col-11, .col-10, .col-9, .col-8, .col-7 { grid-column: span 8; }
  .col-6, .col-5, .col-4, .col-3, .col-2 { grid-column: span 8; }
}

/* Mobile Breakpoint (≤ 767px): Linearized */
@media (max-width: 767px) {
  .hero-grid {
    grid-template-columns: 1fr;
    row-gap: var(--space-xl);
  }

  .grid-12 {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: var(--space-lg);
  }

  .col-12, .col-11, .col-10, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2 {
    grid-column: 1 / -1;
  }

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

/* Short viewports & low height handling (landscape phones, foldables, short laptops) */
@media (min-width: 600px) and (max-height: 700px) {
  .site-section {
    padding-top: clamp(28px, 4vh, 48px);
    padding-bottom: clamp(28px, 4vh, 48px);
  }

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