/* ========================================
   TYPOGRAPHY UTILITIES
   ======================================== */

/* ===== TEXT SIZE ===== */
.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); }
.text-5xl { font-size: var(--text-5xl); }

/* ===== FONT WEIGHT ===== */
.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); }

/* ===== LINE HEIGHT ===== */
.leading-tight { line-height: var(--line-height-tight); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }

/* ===== TEXT ALIGNMENT ===== */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

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

/* ===== TEXT DECORATION ===== */
.underline { text-decoration: underline; }
.no-underline { text-decoration: none; }
.line-through { text-decoration: line-through; }

/* ===== TEXT COLORS ===== */
.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-secondary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }
.text-info { color: var(--color-info); }
.text-muted { color: var(--color-on-surface-variant); }
.text-current { color: currentColor; }
.text-white { color: white; }

/* ===== LETTER SPACING ===== */
.tracking-tight { letter-spacing: -0.01em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

/* ===== TEXT OVERFLOW ===== */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overflow-ellipsis { text-overflow: ellipsis; }
.overflow-clip { text-overflow: clip; }

/* ===== LINE CLAMP ===== */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-5 { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* ===== WORD BREAK ===== */
.break-words { word-wrap: break-word; }
.break-all { word-break: break-all; }
.break-keep { word-break: keep-all; }

/* ===== WHITESPACE ===== */
.whitespace-normal { white-space: normal; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre { white-space: pre; }
.whitespace-pre-wrap { white-space: pre-wrap; }
.whitespace-pre-line { white-space: pre-line; }

/* ===== HEADING STYLES ===== */
h1, .h1 {
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: var(--space-2xl) 0 var(--space-lg) 0;
}

h2, .h2 {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: var(--space-2xl) 0 var(--space-md) 0;
}

h3, .h3 {
  font-size: var(--text-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  margin: var(--space-xl) 0 var(--space-sm) 0;
}

h4, .h4 {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  margin: var(--space-lg) 0 var(--space-sm) 0;
}

h5, .h5 {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  margin: var(--space-lg) 0 var(--space-xs) 0;
}

h6, .h6 {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  margin: var(--space-md) 0 var(--space-xs) 0;
}

/* ===== PARAGRAPH STYLES ===== */
p {
  margin: 0 0 var(--space-lg) 0;
  line-height: var(--line-height-relaxed);
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-normal);
  color: var(--color-on-surface-variant);
}

/* ===== LIST STYLES ===== */
ul, ol {
  margin: 0 0 var(--space-lg) 0;
  padding-left: var(--space-2xl);
}

ul li, ol li {
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-sm);
}

li:last-child {
  margin-bottom: 0;
}

/* ===== BLOCKQUOTE ===== */
blockquote {
  margin: var(--space-2xl) 0;
  padding-left: var(--space-xl);
  border-left: 4px solid var(--color-primary);
  font-style: italic;
  color: var(--color-on-surface-variant);
}

blockquote p {
  margin: 0;
}

/* ===== CODE ===== */
code {
  background: var(--color-surface-variant);
  color: var(--color-error);
  padding: 0.25em 0.5em;
  border-radius: var(--radius-sm);
  font-family: var(--font-family-mono);
  font-size: 0.9em;
}

pre {
  background: var(--color-surface-dim);
  border: 1px solid var(--color-outline);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  margin: var(--space-lg) 0;
  font-family: var(--font-family-mono);
  font-size: var(--text-sm);
  line-height: var(--line-height-normal);
}

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

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

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

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

a:visited {
  color: var(--color-secondary);
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 768px) {
  h1, .h1 {
    font-size: var(--text-4xl);
  }

  h2, .h2 {
    font-size: var(--text-3xl);
  }

  h3, .h3 {
    font-size: var(--text-2xl);
  }

  h4, .h4 {
    font-size: var(--text-xl);
  }
}

@media (max-width: 480px) {
  h1, .h1 {
    font-size: var(--text-3xl);
    margin: var(--space-xl) 0 var(--space-md) 0;
  }

  h2, .h2 {
    font-size: var(--text-2xl);
    margin: var(--space-lg) 0 var(--space-md) 0;
  }

  h3, .h3 {
    font-size: var(--text-xl);
    margin: var(--space-lg) 0 var(--space-sm) 0;
  }

  h4, .h4 {
    font-size: var(--text-lg);
  }

  .text-2xl { font-size: var(--text-xl); }
  .text-3xl { font-size: var(--text-2xl); }
  .text-4xl { font-size: var(--text-3xl); }
  .text-5xl { font-size: var(--text-4xl); }
}
