/**
 * Typography - SOLVUH Platform
 * ============================
 * Type scale, font families, and text utilities.
 */

/* Font families */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
  --font-display: var(--font-sans);
}

/* Type scale */
:root {
  --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 */
  --text-5xl: 3rem;        /* 48px */

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Font weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

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

/* Base typography */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-normal);
  color: var(--text-primary, #e0e0e0);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  color: var(--text-primary, #ffffff);
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: var(--tracking-tight);
}

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

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

h5 {
  font-size: var(--text-lg);
}

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

/* Paragraphs */
p {
  margin-bottom: 1em;
}

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

/* Links */
a {
  color: var(--color-primary, #6366f1);
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-primary-hover, #818cf8);
}

/* Small text */
small {
  font-size: var(--text-sm);
}

/* Strong/Bold */
strong, b {
  font-weight: var(--font-semibold);
}

/* Emphasis */
em, i {
  font-style: italic;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.125em 0.375em;
  background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  padding: 1rem;
  background: var(--bg-secondary, #1a1a2e);
  border-radius: 8px;
  overflow-x: auto;
}

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

/* Blockquote */
blockquote {
  padding-left: 1rem;
  border-left: 3px solid var(--color-primary, #6366f1);
  font-style: italic;
  color: var(--text-secondary, #a0a0a0);
}

/* Lists */
ul.styled,
ol.styled {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

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

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

ul.styled li,
ol.styled li {
  margin-bottom: 0.5rem;
}

/* Definition lists */
dl {
  margin-bottom: 1rem;
}

dt {
  font-weight: var(--font-semibold);
}

dd {
  margin-left: 1rem;
  margin-bottom: 0.5rem;
}

/* Mark/Highlight */
mark {
  background: rgba(99, 102, 241, 0.3);
  color: inherit;
  padding: 0.125em 0.25em;
  border-radius: 2px;
}

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

/* Subscript/Superscript */
sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup {
  top: -0.5em;
}

sub {
  bottom: -0.25em;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  margin: 1.5rem 0;
}

/* Selection */
::selection {
  background: var(--color-primary, #6366f1);
  color: white;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

/* Font weights */
.font-light { font-weight: var(--font-light); }
.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); }

/* Font families */
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* Text colors */
.text-primary { color: var(--text-primary, #ffffff); }
.text-secondary { color: var(--text-secondary, #a0a0a0); }
.text-muted { color: var(--text-muted, #666666); }
.text-success { color: var(--color-success, #10b981); }
.text-warning { color: var(--color-warning, #f59e0b); }
.text-danger { color: var(--color-danger, #ef4444); }
.text-info { color: var(--color-info, #3b82f6); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

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

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

/* Text overflow */
.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 */
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre { white-space: pre; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Word break */
.break-words { word-break: break-word; }
.break-all { word-break: break-all; }
