/* =========================================== */
/* MAIN CONTENT VISUAL HIERARCHY 2026 */
/* Award-winning typography scale and spacing */
/* =========================================== */

:root {
  /* Typography Scale - Modular Scale (1.333 ratio) */
  --h1-size: clamp(3rem, 8vw, 6rem);
  --h2-size: clamp(2.25rem, 6vw, 4.5rem);
  --h3-size: clamp(1.75rem, 4vw, 3rem);
  --h4-size: clamp(1.5rem, 3vw, 2.25rem);
  --h5-size: clamp(1.25rem, 2.5vw, 1.75rem);
  --h6-size: clamp(1.125rem, 2vw, 1.5rem);
  
  /* Line Heights - Optimized for readability */
  --h1-line-height: 1.1;
  --h2-line-height: 1.15;
  --h3-line-height: 1.2;
  --h4-line-height: 1.25;
  --h5-line-height: 1.3;
  --h6-line-height: 1.35;
  --body-line-height: 1.7;
  
  /* Letter Spacing - Refined for large headings */
  --h1-letter-spacing: -0.03em;
  --h2-letter-spacing: -0.02em;
  --h3-letter-spacing: -0.01em;
  --h4-letter-spacing: 0;
  --h5-letter-spacing: 0.01em;
  --h6-letter-spacing: 0.01em;
  
  /* Spacing Rhythm - 8px grid system */
  --spacing-rhythm: 0.5rem; /* 8px base unit */
  --spacing-xs: calc(var(--spacing-rhythm) * 0.5);   /* 4px */
  --spacing-sm: var(--spacing-rhythm);                /* 8px */
  --spacing-md: calc(var(--spacing-rhythm) * 2);      /* 16px */
  --spacing-lg: calc(var(--spacing-rhythm) * 3);      /* 24px */
  --spacing-xl: calc(var(--spacing-rhythm) * 4);      /* 32px */
  --spacing-2xl: calc(var(--spacing-rhythm) * 6);     /* 48px */
  --spacing-3xl: calc(var(--spacing-rhythm) * 8);     /* 64px */
  --spacing-4xl: calc(var(--spacing-rhythm) * 12);    /* 96px */
  
  /* Contrast Ratios - WCAG AAA compliant */
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-contrast-ratio: 7.1; /* AAA compliant */
}

/* =========================================== */
/* MAIN CONTENT SECTION */
/* =========================================== */

#main-content-section {
  /* Enhanced spacing rhythm */
  --section-spacing-top: var(--spacing-3xl);
  --section-spacing-bottom: var(--spacing-2xl);
}

/* =========================================== */
/* HEADING HIERARCHY */
/* =========================================== */

#main-content-section h1,
#main-content-section .h1,
#main-content-section .section-title {
  font-size: var(--h1-size);
  line-height: var(--h1-line-height);
  letter-spacing: var(--h1-letter-spacing);
  font-weight: 700;
  margin-top: 0;
  margin-bottom: var(--spacing-xl);
  color: var(--text-primary);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#main-content-section h2,
#main-content-section .h2,
#main-content-section .underline-animated {
  font-size: var(--h2-size);
  line-height: var(--h2-line-height);
  letter-spacing: var(--h2-letter-spacing);
  font-weight: 700;
  margin-top: var(--spacing-3xl);
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
}

#main-content-section h3,
#main-content-section .h3 {
  font-size: var(--h3-size);
  line-height: var(--h3-line-height);
  letter-spacing: var(--h3-letter-spacing);
  font-weight: 600;
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

#main-content-section h4,
#main-content-section .h4 {
  font-size: var(--h4-size);
  line-height: var(--h4-line-height);
  letter-spacing: var(--h4-letter-spacing);
  font-weight: 600;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

#main-content-section h5,
#main-content-section .h5 {
  font-size: var(--h5-size);
  line-height: var(--h5-line-height);
  letter-spacing: var(--h5-letter-spacing);
  font-weight: 600;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

#main-content-section h6,
#main-content-section .h6 {
  font-size: var(--h6-size);
  line-height: var(--h6-line-height);
  letter-spacing: var(--h6-letter-spacing);
  font-weight: 600;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--text-secondary);
}

/* =========================================== */
/* LEAD TEXT & INTRODUCTIONS */
/* =========================================== */

#main-content-section .text-lead,
#main-content-section .lead,
#main-content-section .lead-text-dark {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  line-height: var(--body-line-height);
  font-weight: 400;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  color: var(--text-secondary);
  max-width: 65ch; /* Optimal reading width */
}

/* =========================================== */
/* BODY TEXT */
/* =========================================== */

#main-content-section p {
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: var(--body-line-height);
  margin-top: 0;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
  max-width: 65ch; /* Optimal reading width */
}

#main-content-section .text-muted {
  color: var(--text-muted);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
}

#main-content-section .text-small {
  font-size: clamp(0.75rem, 1.25vw, 0.875rem);
  line-height: 1.6;
}

/* =========================================== */
/* SPACING RHYTHM */
/* =========================================== */

#main-content-section .section {
  /* Asymmetric spacing - more space above headings */
  padding-top: var(--section-spacing-top);
  padding-bottom: var(--section-spacing-bottom);
}

#main-content-section .section:first-child {
  padding-top: var(--spacing-2xl);
}

#main-content-section .section:last-child {
  padding-bottom: var(--spacing-4xl);
}

/* Section dividers */
#main-content-section .section-divider {
  margin: var(--spacing-3xl) 0;
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(99, 102, 241, 0.2) 50%,
    transparent 100%
  );
}

/* =========================================== */
/* VISUAL WEIGHT DISTRIBUTION */
/* =========================================== */

#main-content-section .card {
  margin-bottom: var(--spacing-xl);
}

#main-content-section .card:last-child {
  margin-bottom: 0;
}

#main-content-section .card-body {
  padding: var(--spacing-xl);
}

#main-content-section .card-body h3,
#main-content-section .card-body h4 {
  margin-top: 0;
}

#main-content-section .card-body h3 + p,
#main-content-section .card-body h4 + p {
  margin-top: var(--spacing-md);
}

/* =========================================== */
/* CONTRAST ENHANCEMENTS */
/* =========================================== */

#main-content-section {
  /* Ensure WCAG AAA contrast */
  color: var(--text-primary);
}

#main-content-section strong,
#main-content-section b {
  font-weight: 600;
  color: var(--text-primary);
}

#main-content-section a {
  color: #6366f1;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

#main-content-section a:hover {
  color: #4f46e5;
  text-decoration: underline;
}

/* =========================================== */
/* GOLDEN RATIO SPACING */
/* =========================================== */

#main-content-section .section > .row:first-child {
  margin-top: var(--spacing-2xl);
}

#main-content-section .section > .row:last-child {
  margin-bottom: var(--spacing-2xl);
}

/* Golden ratio spacing for featured sections */
#main-content-section .section.section-pattern {
  padding-top: calc(var(--spacing-3xl) * 1.618);
  padding-bottom: calc(var(--spacing-2xl) * 1.618);
}

/* =========================================== */
/* RESPONSIVE ADJUSTMENTS */
/* =========================================== */

@media (max-width: 768px) {
  #main-content-section .section {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
  }
  
  #main-content-section .section.section-pattern {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
  }
  
  #main-content-section .card-body {
    padding: var(--spacing-lg);
  }
  
  #main-content-section h1,
  #main-content-section .h1,
  #main-content-section .section-title {
    margin-bottom: var(--spacing-lg);
  }
  
  #main-content-section h2,
  #main-content-section .h2 {
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-md);
  }
}

@media (min-width: 1200px) {
  /* Larger screens get more dramatic spacing */
  #main-content-section .section {
    padding-top: calc(var(--spacing-3xl) * 1.2);
    padding-bottom: calc(var(--spacing-2xl) * 1.2);
  }
  
  #main-content-section .section.section-pattern {
    padding-top: calc(var(--spacing-3xl) * 1.618 * 1.2);
    padding-bottom: calc(var(--spacing-2xl) * 1.618 * 1.2);
  }
}

/* =========================================== */
/* ACCESSIBILITY */
/* =========================================== */

@media (prefers-contrast: high) {
  #main-content-section {
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
  }
  
  #main-content-section h1,
  #main-content-section h2,
  #main-content-section h3,
  #main-content-section h4,
  #main-content-section h5,
  #main-content-section h6 {
    font-weight: 800;
  }
}

@media (prefers-reduced-motion: reduce) {
  #main-content-section * {
    transition: none !important;
    animation: none !important;
  }
}

