/**
 * Typography Styles
 * Headings, text, and font-related styles
 */

/* ===========================================
   HEADINGS
   =========================================== */

h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-text);
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  color: var(--color-text);
}

h4, .h4 {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  color: var(--color-text);
}

h5, .h5 {
  font-family: var(--font-primary);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-snug);
  color: var(--color-text);
}

h6, .h6 {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-snug);
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

/* ===========================================
   BODY TEXT
   =========================================== */

p {
  margin-bottom: var(--spacing-4);
  line-height: var(--line-height-relaxed);
}

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

.small, small {
  font-size: var(--font-size-sm);
}

.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 COLORS
   =========================================== */

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

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

.text-accent {
  color: var(--color-accent);
}

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

.text-light {
  color: var(--color-text-light);
}

.text-success {
  color: var(--color-success);
}

.text-warning {
  color: var(--color-warning);
}

.text-error {
  color: var(--color-error);
}

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

/* ===========================================
   TEXT ALIGNMENT
   =========================================== */

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

/* ===========================================
   LINKS
   =========================================== */

a {
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

.link {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link:hover {
  color: var(--color-primary-light);
  text-decoration: none;
}

/* ===========================================
   LISTS
   =========================================== */

ul, ol {
  padding-left: var(--spacing-6);
  margin-bottom: var(--spacing-4);
}

li {
  margin-bottom: var(--spacing-2);
}

.list-none {
  list-style: none;
  padding-left: 0;
}

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

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

/* ===========================================
   BLOCKQUOTE
   =========================================== */

blockquote {
  padding-left: var(--spacing-4);
  border-left: 4px solid var(--color-accent);
  font-style: italic;
  color: var(--color-text-light);
  margin: var(--spacing-6) 0;
}

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

/* ===========================================
   CODE
   =========================================== */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: var(--color-border);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  background-color: var(--color-surface-dark);
  color: var(--color-text-inverse);
  padding: var(--spacing-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--spacing-4) 0;
}

pre code {
  background: none;
  padding: 0;
}

/* ===========================================
   TEXT UTILITIES
   =========================================== */

.uppercase {
  text-transform: uppercase;
}

.lowercase {
  text-transform: lowercase;
}

.capitalize {
  text-transform: capitalize;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.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;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.break-words {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

@media (max-width: 768px) {
  h1, .h1 {
    font-size: var(--font-size-3xl);
  }

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

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

  .lead {
    font-size: var(--font-size-lg);
  }
}
