/**
 * Typography Standardization
 * 
 * Ensures consistent typography across all pages
 * Uses theme-system.css variables
 */

/* ============================================
   HEADING COLORS - Consistent Across All Pages
   ============================================ */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.section-title,
.page-title,
.content-title {
  color: var(--color-text-primary);
  font-family: var(--font-display);
}

/* Lighter heading color for better readability (as requested) */
h1, .h1 {
  color: var(--color-secondary-800);
  font-weight: var(--font-extrabold);
}

h2, .h2 {
  color: var(--color-secondary-800);
  font-weight: var(--font-bold);
}

h3, .h3 {
  color: var(--color-secondary-700);
  font-weight: var(--font-bold);
}

h4, .h4 {
  color: var(--color-secondary-700);
  font-weight: var(--font-semibold);
}

h5, .h5 {
  color: var(--color-secondary-600);
  font-weight: var(--font-semibold);
}

h6, .h6 {
  color: var(--color-secondary-600);
  font-weight: var(--font-semibold);
}

/* Main headings - Softer colors for better UX */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    color: #4B5563; /* Softer gray instead of dark black */
    line-height: 1.2;
    margin-bottom: 1rem;
}

/* Section Titles - Consistent Styling */
.section-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-6);
  letter-spacing: var(--tracking-tight);
}

.section-subtitle {
  font-size: var(--text-lg);
  font-weight: var(--font-normal);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-8);
}

/* Page Titles */
.page-title {
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-4);
}

.page-subtitle {
  font-size: var(--text-xl);
  font-weight: var(--font-normal);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-6);
}

/* Content Titles */
.content-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-4);
}

/* ============================================
   PARAGRAPH STYLING
   ============================================ */

p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-4);
}

p.lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-primary);
  font-weight: var(--font-normal);
}

/* ============================================
   LINK STYLING
   ============================================ */

a {
  color: var(--color-primary-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-700);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.link-primary {
  color: var(--color-primary-600);
  font-weight: var(--font-medium);
}

.link-primary:hover {
  color: var(--color-primary-700);
}

.link-secondary {
  color: var(--color-text-secondary);
}

.link-secondary:hover {
  color: var(--color-text-primary);
}

/* ============================================
   TEXT UTILITIES - Extending Theme System
   ============================================ */

.text-heading {
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-weight: var(--font-bold);
}

.text-body {
  color: var(--color-text-secondary);
  font-family: var(--font-primary);
  font-weight: var(--font-normal);
}

.text-caption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

.text-small {
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.text-large {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */

@media (max-width: 768px) {
  .section-title {
    font-size: var(--text-3xl);
    margin-bottom: var(--spacing-4);
  }
  
  .page-title {
    font-size: var(--text-4xl);
  }
  
  .page-subtitle {
    font-size: var(--text-lg);
  }
  
  .content-title {
    font-size: var(--text-xl);
  }
}

/* ============================================
   FONT LOADING OPTIMIZATION
   ============================================ */

/* Prevent FOIT (Flash of Invisible Text) */
body {
  font-display: swap;
}

/* Ensure consistent font rendering */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

