/* ===== LAYOUT - MirrorG Premium ===== */

/* ===== CONTAINER ===== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--section-padding-x);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--full {
  max-width: var(--container-full);
}

/* ===== SECTIONS - Premium ===== */
.section {
  padding: var(--section-padding-y) 0;
  position: relative;
}

.section--bg {
  background-color: var(--color-bg-section);
}

/* Premium gradient background */
.section--gradient {
  background: var(--gradient-section-fade);
}

.section--dark {
  background: var(--gradient-dark);
  color: var(--color-white);
}

.section--primary {
  background: var(--gradient-primary);
  color: var(--color-white);
  position: relative;
  overflow: hidden;
}

/* Decorative element for primary sections */
.section--primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Subtle border separator */
.section--bordered {
  border-top: 1px solid var(--color-border-light);
}

/* ===== SECTION HEADER - Premium ===== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
  position: relative;
}

.section-header__eyebrow {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  margin-bottom: var(--space-md);
  display: block;
}

.section-header__title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: var(--letter-spacing-tight);
}

/* Decorative line under title */
.section-header__title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--border-radius-pill);
  margin: var(--space-md) auto 0;
}

.section--dark .section-header__title,
.section--primary .section-header__title {
  color: var(--color-white);
}

.section--dark .section-header__title::after,
.section--primary .section-header__title::after {
  background: var(--color-white);
  opacity: 0.5;
}

.section-header__subtitle {
  font-size: var(--font-size-md);
  color: var(--color-text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

.section--dark .section-header__subtitle,
.section--primary .section-header__subtitle {
  color: rgba(255, 255, 255, 0.85);
}

/* Large section header variant */
.section-header--large .section-header__title {
  font-size: var(--font-size-3xl);
}

.section-header--large .section-header__subtitle {
  font-size: var(--font-size-lg);
}

/* ===== GRID SYSTEM ===== */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Auto-fit grids */
.grid--auto-fit {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--auto-fit-sm {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* ===== FLEXBOX UTILITIES ===== */
.flex {
  display: flex;
}

.flex--center {
  justify-content: center;
  align-items: center;
}

.flex--between {
  justify-content: space-between;
  align-items: center;
}

.flex--start {
  justify-content: flex-start;
  align-items: center;
}

.flex--end {
  justify-content: flex-end;
  align-items: center;
}

.flex--column {
  flex-direction: column;
}

.flex--wrap {
  flex-wrap: wrap;
}

.flex--gap-sm { gap: var(--space-sm); }
.flex--gap-md { gap: var(--space-md); }
.flex--gap-lg { gap: var(--space-lg); }
.flex--gap-xl { gap: var(--space-xl); }

/* ===== SPACING UTILITIES ===== */
.mt-0 { margin-top: 0; }
.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); }

.mb-0 { margin-bottom: 0; }
.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); }

.py-section {
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
}

/* ===== TWO COLUMN LAYOUT ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.two-col--reverse {
  direction: ltr; /* Reverse for RTL */
}

[dir="rtl"] .two-col--reverse {
  direction: rtl;
}

/* ===== VISIBILITY ===== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== DISPLAY UTILITIES ===== */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* ===== WIDTH UTILITIES ===== */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.max-w-100 { max-width: 100%; }

/* ===== RESPONSIVE LAYOUTS ===== */
@media (max-width: 991px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }
}

@media (max-width: 767px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .section-header {
    margin-bottom: var(--space-2xl);
  }
}
