/* ============================================
   PHASE 0 TYPOGRAPHY SYSTEM
   Font hierarchy and text utilities
   ============================================ */

/* Import fonts */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   FONT FAMILIES
   ============================================ */

:root {
  --font-serif: 'Merriweather', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Font 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 */
  --text-5xl: 3rem; /* 48px */
  
  /* Line heights */
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* Letter spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
}

/* ============================================
   BASE TYPOGRAPHY
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: #1a2639;
  background-color: #f9fafb;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--leading-tight);
  margin-bottom: 0.5em;
  color: #1a2639;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 0.75em;
}

@media (max-width: 640px) {
  h1 {
    font-size: var(--text-4xl);
  }
}

h2 {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 0.6em;
}

@media (max-width: 640px) {
  h2 {
    font-size: var(--text-3xl);
  }
}

h3 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: 0.5em;
}

@media (max-width: 640px) {
  h3 {
    font-size: var(--text-2xl);
  }
}

h4 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: 0.5em;
}

h5 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 0.5em;
}

h6 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 0.5em;
}

/* ============================================
   PARAGRAPH & TEXT
   ============================================ */

p {
  margin-bottom: 1em;
  line-height: var(--leading-relaxed);
}

p + p {
  margin-top: 0;
}

small {
  font-size: var(--text-sm);
  color: #6b7280;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

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

a {
  color: #3b82f6;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #2563eb;
  text-decoration: underline;
}

a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

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

ul, ol {
  margin-left: 1.5em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.5em;
  line-height: var(--leading-relaxed);
}

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

blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1.5em;
  margin-left: 0;
  margin-bottom: 1em;
  font-style: italic;
  color: #4b5563;
}

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

code {
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  background-color: #f3f4f6;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: #ef4444;
}

pre {
  background-color: #1f2937;
  color: #f3f4f6;
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1em;
}

pre code {
  color: inherit;
  background-color: transparent;
  padding: 0;
}

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

.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-light {
  font-weight: 300;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-black {
  font-weight: 900;
}

.font-serif {
  font-family: var(--font-serif);
}

.font-sans {
  font-family: var(--font-sans);
}

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

.tracking-tight {
  letter-spacing: var(--tracking-tight);
}

.tracking-normal {
  letter-spacing: var(--tracking-normal);
}

.tracking-wide {
  letter-spacing: var(--tracking-wide);
}

.tracking-wider {
  letter-spacing: var(--tracking-wider);
}

.tracking-widest {
  letter-spacing: var(--tracking-widest);
}

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

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

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

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

.italic {
  font-style: italic;
}

.not-italic {
  font-style: normal;
}

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