/* Modeno Theme 2 - Modern Typography System */
/* Professional typography with accessibility and readability focus */

/* ========================================
   TYPOGRAPHY FOUNDATION
   ======================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* Accessibility: Ensure proper font loading fallbacks */
@supports (font-display: swap) {
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800;900&display=swap');
}

/* Typography CSS Variables */
:root {
  /* Font Families */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  
  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;
  --font-weight-black: 900;
  
  /* Line Heights */
  --line-height-tight: 1.1;
  --line-height-snug: 1.2;
  --line-height-normal: 1.4;
  --line-height-relaxed: 1.5;
  --line-height-loose: 1.6;
  --line-height-extra-loose: 1.7;
  
  /* Letter Spacing */
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.025em;
  --letter-spacing-wider: 0.05em;
  --letter-spacing-widest: 0.1em;
  
  /* Font Sizes - Desktop First Approach (Accessibility: Minimum 16px base) */
  --text-xs: 0.75rem;      /* 12px - Use sparingly, ensure contrast */
  --text-sm: 0.875rem;     /* 14px - Minimum for secondary text */
  --text-base: 1rem;       /* 16px - Base size for accessibility */
  --text-lg: 1.125rem;     /* 18px - Enhanced readability */
  --text-xl: 1.25rem;      /* 20px - Large body text */
  --text-2xl: 1.5rem;      /* 24px - Small headings */
  --text-3xl: 1.875rem;    /* 30px - Medium headings */
  --text-4xl: 2.25rem;     /* 36px - Large headings */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  --text-7xl: 4.5rem;      /* 72px */
  --text-8xl: 6rem;        /* 96px */
  --text-9xl: 8rem;        /* 128px */
}

/* ========================================
   BASE TYPOGRAPHY STYLES
   ======================================== */

/* Base body text - Accessibility Focused */
body {
  font-family: var(--font-body);
  font-size: var(--text-base); /* 16px minimum for WCAG compliance */
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed); /* 1.5 minimum for readability */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--foreground));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ========================================
   HEADING HIERARCHY (H1-H6)
   ======================================== */

/* H1 - Hero/Page Titles - Accessibility: Clear hierarchy */
h1, .text-h1 {
  font-family: var(--font-heading);
  font-size: var(--text-6xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight); /* 1.1 for large headings */
  letter-spacing: var(--letter-spacing-tight);
  color: hsl(var(--foreground));
  margin: 0 0 1.5rem 0;
}

/* H2 - Section Titles - Accessibility: Clear hierarchy */
h2, .text-h2 {
  font-family: var(--font-heading);
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug); /* 1.2 for section headings */
  letter-spacing: var(--letter-spacing-tight);
  color: hsl(var(--foreground));
  margin: 0 0 1.25rem 0;
}

/* H3 - Subsection Titles - Accessibility: Clear hierarchy */
h3, .text-h3 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug); /* 1.2 for subsection headings */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--foreground));
  margin: 0 0 1rem 0;
}

/* H4 - Card/Component Titles - Accessibility: Clear hierarchy */
h4, .text-h4 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal); /* 1.4 for card titles */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--foreground));
  margin: 0 0 0.75rem 0;
}

/* H5 - Small Titles - Accessibility: Clear hierarchy */
h5, .text-h5 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal); /* 1.4 for small titles */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--foreground));
  margin: 0 0 0.5rem 0;
}

/* H6 - Micro Titles - Accessibility: Clear hierarchy */
h6, .text-h6 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal); /* 1.4 for micro titles */
  letter-spacing: var(--letter-spacing-wide);
  color: hsl(var(--foreground));
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
}

/* ========================================
   BODY TEXT VARIATIONS
   ======================================== */

/* Large body text for hero descriptions - Accessibility: Enhanced readability */
.text-body-large {
  font-family: var(--font-body);
  font-size: var(--text-xl); /* 20px for better readability */
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-loose); /* 1.6 for large text */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--muted-foreground));
}

/* Standard body text - WCAG compliant */
.text-body {
  font-family: var(--font-body);
  font-size: var(--text-base); /* 16px minimum */
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed); /* 1.5 minimum for readability */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--foreground));
}

/* Small body text - Use sparingly, ensure contrast */
.text-body-small {
  font-family: var(--font-body);
  font-size: var(--text-sm); /* 14px - minimum for secondary text */
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed); /* 1.5 for small text */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--muted-foreground));
}

/* Micro text for captions, labels - Use sparingly, ensure contrast */
.text-micro {
  font-family: var(--font-body);
  font-size: var(--text-xs); /* 12px - use sparingly, ensure contrast */
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal); /* 1.4 for micro text */
  letter-spacing: var(--letter-spacing-wide);
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
}

/* ========================================
   SPECIALIZED TEXT STYLES
   ======================================== */

/* Hero title - largest display text - Accessibility: Clear hierarchy */
.text-hero {
  font-family: var(--font-heading);
  font-size: var(--text-8xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight); /* 1.1 for large display text */
  letter-spacing: var(--letter-spacing-tight);
  color: hsl(var(--foreground));
}

/* Section title - large section headers - Accessibility: Clear hierarchy */
.text-section-title {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug); /* 1.2 for section headers */
  letter-spacing: var(--letter-spacing-tight);
  color: hsl(var(--foreground));
}

/* Card title - component headers - Accessibility: Clear hierarchy */
.text-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug); /* 1.2 for card titles */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--foreground));
}

/* Pricing amount - large numbers - Accessibility: Clear hierarchy */
.text-pricing-amount {
  font-family: var(--font-heading);
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight); /* 1.1 for large numbers */
  letter-spacing: var(--letter-spacing-tight);
  color: hsl(var(--foreground));
}

/* Button text - Accessibility: Clear and readable */
.text-button {
  font-family: var(--font-body);
  font-size: var(--text-base); /* 16px minimum for buttons */
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal); /* 1.4 for button text */
  letter-spacing: var(--letter-spacing-normal);
}

/* Link text */
.text-link {
  font-family: var(--font-body);
  font-size: var(--text-base); /* 16px minimum for links */
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal); /* 1.4 for link text */
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--primary));
  text-decoration: none;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: hsl(var(--primary) / 0.8);
  text-decoration: underline;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY - Accessibility Focused
   ======================================== */

/* Tablet adjustments - Maintain readability */
@media (max-width: 1024px) {
  :root {
    --text-6xl: 3.5rem;    /* 56px - Still readable on tablets */
    --text-5xl: 2.75rem;   /* 44px - Maintain hierarchy */
    --text-4xl: 2rem;      /* 32px - Clear section titles */
    --text-3xl: 1.75rem;   /* 28px - Readable subsection titles */
    --text-2xl: 1.375rem;  /* 22px - Clear card titles */
  }
  
  .text-hero {
    font-size: var(--text-7xl); /* 60px - Still impactful */
  }
  
  .text-section-title {
    font-size: var(--text-4xl); /* 32px - Clear hierarchy */
  }
  
  .text-pricing-amount {
    font-size: var(--text-4xl); /* 32px - Clear pricing */
  }
}

/* Mobile adjustments - Maintain accessibility */
@media (max-width: 768px) {
  :root {
    --text-8xl: 4rem;      /* 64px - Still readable on mobile */
    --text-7xl: 3.5rem;    /* 56px - Maintain impact */
    --text-6xl: 3rem;      /* 48px - Clear hierarchy */
    --text-5xl: 2.5rem;    /* 40px - Readable section titles */
    --text-4xl: 2rem;      /* 32px - Clear subsection titles */
    --text-3xl: 1.75rem;   /* 28px - Readable card titles */
    --text-2xl: 1.5rem;    /* 24px - Clear small headings */
    --text-xl: 1.125rem;   /* 18px - Enhanced body text */
    --text-lg: 1rem;       /* 16px - WCAG compliant base */
  }
  
  .text-hero {
    font-size: var(--text-6xl); /* 48px - Still impactful on mobile */
  }
  
  .text-section-title {
    font-size: var(--text-3xl); /* 28px - Clear hierarchy on mobile */
  }
  
  .text-pricing-amount {
    font-size: var(--text-3xl); /* 28px - Clear pricing on mobile */
  }
  
  .text-body-large {
    font-size: var(--text-lg); /* 16px - Maintain readability on mobile */
  }
}

/* Small mobile adjustments - Maintain accessibility */
@media (max-width: 480px) {
  :root {
    --text-6xl: 2.5rem;    /* 40px - Still readable on small screens */
    --text-5xl: 2.25rem;   /* 36px - Maintain hierarchy */
    --text-4xl: 1.875rem;  /* 30px - Clear section titles */
    --text-3xl: 1.5rem;    /* 24px - Readable card titles */
    --text-2xl: 1.25rem;   /* 20px - Clear small headings */
  }
  
  .text-hero {
    font-size: var(--text-5xl); /* 36px - Still impactful on small screens */
  }
  
  .text-section-title {
    font-size: var(--text-2xl); /* 20px - Clear hierarchy on small screens */
  }
  
  .text-pricing-amount {
    font-size: var(--text-2xl); /* 20px - Clear pricing on small screens */
  }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS - WCAG 2.1 AA Compliant
   ======================================== */

/* Focus styles for better accessibility */
h1:focus,
h2:focus,
h3:focus,
h4:focus,
h5:focus,
h6:focus {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  border-radius: 2px;
}

/* Ensure minimum contrast ratios */
.text-body,
.text-body-large,
.text-body-small {
  color: hsl(var(--foreground)); /* Ensure sufficient contrast */
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .text-link {
    transition: none;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --foreground: 0 0% 0%;
    --muted-foreground: 0 0% 20%;
  }
  
  body {
    font-weight: var(--font-weight-medium);
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-extrabold);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Font weights */
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }

/* Text colors */
.text-foreground { color: hsl(var(--foreground)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-secondary { color: hsl(var(--secondary)); }

/* Line heights */
.leading-tight { line-height: var(--line-height-tight); }
.leading-snug { line-height: var(--line-height-snug); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

/* Letter spacing */
.tracking-tight { letter-spacing: var(--letter-spacing-tight); }
.tracking-normal { letter-spacing: var(--letter-spacing-normal); }
.tracking-wide { letter-spacing: var(--letter-spacing-wide); }
.tracking-wider { letter-spacing: var(--letter-spacing-wider); }
.tracking-widest { letter-spacing: var(--letter-spacing-widest); }

/* ========================================
   COMPONENT-SPECIFIC TYPOGRAPHY
   ======================================== */

/* Navigation text */
.nav-text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
}

/* Form labels */
.form-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--foreground));
}

/* Form input text */
.form-input {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-normal);
}

/* Badge text */
.badge-text {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

/* Testimonial text */
.testimonial-text {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-loose);
  letter-spacing: var(--letter-spacing-normal);
  font-style: italic;
  color: hsl(var(--muted-foreground));
}

/* Footer text */
.footer-text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  letter-spacing: var(--letter-spacing-normal);
  color: hsl(var(--muted-foreground));
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  * {
    color: black !important;
    background: white !important;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
  
  .text-hero {
    font-size: 2rem;
  }
  
  .text-section-title {
    font-size: 1.5rem;
  }
}
