/* Typography System - Central typography definitions for the entire application */

:root {
  /* Font Families */
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-primary);
  --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
  
  /* Font Size Scale - Mobile First Approach */
  /* Base sizes */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  
  /* Heading Scale */
  --heading-h1: 2rem;      /* 32px */
  --heading-h2: 1.75rem;   /* 28px */
  --heading-h3: 1.5rem;    /* 24px */
  --heading-h4: 1.25rem;   /* 20px */
  --heading-h5: 1.125rem;  /* 18px */
  --heading-h6: 1rem;      /* 16px */
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
}

/* Base Typography Styles */
body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: var(--font-normal);
}

/* Heading Elements */
h1, .h1 {
  font-family: var(--font-heading);
  font-size: var(--heading-h1);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: 0.5em;
}

h2, .h2 {
  font-family: var(--font-heading);
  font-size: var(--heading-h2);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: 0.5em;
}

h3, .h3 {
  font-family: var(--font-heading);
  font-size: var(--heading-h3);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  margin-bottom: 0.5em;
}

h4, .h4 {
  font-family: var(--font-heading);
  font-size: var(--heading-h4);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  margin-bottom: 0.5em;
}

h5, .h5 {
  font-family: var(--font-heading);
  font-size: var(--heading-h5);
  font-weight: var(--font-medium);
  line-height: var(--leading-snug);
  margin-bottom: 0.5em;
}

h6, .h6 {
  font-family: var(--font-heading);
  font-size: var(--heading-h6);
  font-weight: var(--font-medium);
  line-height: var(--leading-snug);
  margin-bottom: 0.5em;
}

/* Text Elements */
p {
  line-height: var(--leading-normal);
  margin-bottom: 1em;
}

/* Code and Monospace */
code, kbd, pre, samp {
  font-family: var(--font-mono);
}

/* Utility Classes for Font Sizes */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

/* Utility Classes for Font Weights */
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

/* Legacy weight utilities */
.fw-bold { font-weight: var(--font-bold); }
.fw-normal { font-weight: var(--font-normal); }

/* Utility Classes for Line Heights */
.leading-none { line-height: var(--leading-none); }
.leading-tight { line-height: var(--leading-tight); }
.leading-snug { line-height: var(--leading-snug); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }
.leading-loose { line-height: var(--leading-loose); }

/* Icon Size Utilities - for Bootstrap Icons and similar icon fonts */
.icon-3xl { font-size: 3rem; }             /* 48px */

/* Responsive Typography */
@media (max-width: 768px) {
  :root {
    --heading-h1: 1.75rem;    /* 28px on mobile */
    --heading-h2: 1.5rem;     /* 24px on mobile */
    --heading-h3: 1.25rem;    /* 20px on mobile */
    --heading-h4: 1.125rem;   /* 18px on mobile */
  }
}

/* Form Element Typography */
.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: var(--leading-snug);
}

.form-control {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

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

/* Button Typography */
.btn {
  font-family: var(--font-primary);
  font-weight: var(--font-medium);
  line-height: var(--leading-snug);
}

/* Migration Compatibility */
/* These variables maintain backward compatibility while transitioning */
:root {
  /* Maintain compatibility with existing variables in content_questions */
  --font-size-base: var(--text-base);
  --font-size-lg: var(--text-lg);
  --font-size-sm: var(--text-sm);
  --font-weight-normal: var(--font-normal);
  --font-weight-bold: var(--font-bold);
  --line-height-base: var(--leading-normal);
}
