/* Typography Styles */

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-color);
  margin-bottom: var(--space-4);
}

h1 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
}

h2 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
}

h3 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
}

h4 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
}

h6 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

/* Responsive headings */
@media (min-width: 640px) {
  h1 {
    font-size: var(--font-size-6xl);
  }
  
  h2 {
    font-size: var(--font-size-5xl);
  }
  
  h3 {
    font-size: var(--font-size-4xl);
  }
}

@media (min-width: 1024px) {
  h1 {
    font-size: var(--font-size-7xl);
  }
  
  h2 {
    font-size: var(--font-size-6xl);
  }
  
  h3 {
    font-size: var(--font-size-5xl);
  }
}

/* Display headings */
.display-1 {
  font-size: var(--font-size-7xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
}

.display-2 {
  font-size: var(--font-size-6xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
}

.display-3 {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

.display-4 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
}

/* Text sizes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }
.text-6xl { font-size: var(--font-size-6xl); }
.text-7xl { font-size: var(--font-size-7xl); }

/* 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); }

/* 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); }

/* Text colors */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-accent { color: var(--accent-color); }
.text-muted { color: var(--text-muted); }
.text-white { color: var(--white); }
.text-black { color: var(--black); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }

/* Text decoration */
.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }
.line-through { text-decoration: line-through; }

/* Text transform */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* Font styles */
.italic { font-style: italic; }
.not-italic { font-style: normal; }

/* Letter spacing */
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* Paragraphs */
p {
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-color);
  margin-bottom: var(--space-4);
}

.lead {
  font-size: var(--font-size-xl);
  line-height: var(--line-height-relaxed);
  font-weight: var(--font-weight-normal);
  color: var(--text-muted);
}

.small {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

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

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

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

/* Link variants */
.link-primary {
  color: var(--primary-color);
}

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

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

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

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

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

/* Lists */
ul, ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

ul {
  list-style-type: disc;
}

ol {
  list-style-type: decimal;
}

li {
  margin-bottom: var(--space-1);
  line-height: var(--line-height-relaxed);
}

/* Nested lists */
ul ul, ol ol, ul ol, ol ul {
  margin-bottom: var(--space-2);
  margin-top: var(--space-1);
}

/* List variants */
.list-none {
  list-style: none;
  padding-left: 0;
}

.list-disc {
  list-style-type: disc;
}

.list-decimal {
  list-style-type: decimal;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: var(--space-6);
  margin: var(--space-6) 0;
  font-style: italic;
  font-size: var(--font-size-lg);
  color: var(--text-muted);
}

blockquote p {
  margin-bottom: var(--space-2);
}

blockquote cite {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--font-size-sm);
  font-style: normal;
  color: var(--text-muted);
}

blockquote cite:before {
  content: "— ";
}

/* Code */
code {
  font-family: var(--font-family-mono);
  font-size: 0.875em;
  background-color: var(--gray-100);
  color: var(--gray-800);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-family-mono);
  background-color: var(--gray-900);
  color: var(--gray-100);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background-color: var(--border-color);
  margin: var(--space-8) 0;
}

/* Mark/highlight */
mark {
  background-color: var(--warning-light);
  color: var(--gray-900);
  padding: var(--space-1);
  border-radius: var(--radius-sm);
}

/* Abbreviations */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* Subscript and superscript */
sub, sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* Text selection */
::selection {
  background-color: var(--primary-color);
  color: var(--white);
}

::-moz-selection {
  background-color: var(--primary-color);
  color: var(--white);
}

/* Page-specific typography */
.page-title {
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-extrabold);
  line-height: var(--line-height-tight);
  color: var(--white);
  margin-bottom: var(--space-4);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  color: var(--gray-200);
  margin-bottom: 0;
}

.section-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-color);
  margin-bottom: var(--space-4);
  text-align: center;
}

.section-subtitle {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-relaxed);
  color: var(--text-muted);
  text-align: center;
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive typography */
@media (min-width: 640px) {
  .page-title {
    font-size: var(--font-size-6xl);
  }
  
  .section-title {
    font-size: var(--font-size-5xl);
  }
  
  .page-subtitle {
    font-size: var(--font-size-2xl);
  }
}

@media (min-width: 1024px) {
  .page-title {
    font-size: var(--font-size-7xl);
  }
  
  .section-title {
    font-size: var(--font-size-6xl);
  }
}

/* Print typography */
@media print {
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  p, li {
    orphans: 3;
    widows: 3;
  }
  
  blockquote {
    page-break-inside: avoid;
  }
  
  .page-title {
    font-size: 24pt;
    color: black;
    text-shadow: none;
  }
  
  .section-title {
    font-size: 18pt;
    color: black;
  }
}

