/**
 * Typography Component
 * Unified typography system for Clevertech theme
 * 
 * Structure:
 * - Font families
 * - Type scale
 * - Headings
 * - Body text
 * - Utility classes
 */

/* ========================================
   Design Tokens
   ======================================== */
:root {
  /* Font Families */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Sora', var(--font-primary);
  --font-mono: 'Courier New', monospace;
  
  /* Font Sizes - Fluid Typography */
  --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);      /* 12-14px */
  --fs-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);         /* 14-16px */
  --fs-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);        /* 16-18px */
  --fs-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);       /* 18-20px */
  --fs-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);        /* 20-24px */
  --fs-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);             /* 24-32px */
  --fs-3xl: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);       /* 30-40px */
  --fs-4xl: clamp(2.25rem, 1.75rem + 2vw, 3rem);           /* 36-48px */
  --fs-5xl: clamp(3rem, 2rem + 3vw, 3.5rem);               /* 48-56px */
  
  /* Line Heights */
  --lh-tight: 1.2;
  --lh-snug: 1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.6;
  --lh-loose: 1.8;
  
  /* Font Weights */
  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;
  --fw-black: 900;
  
  /* Letter Spacing */
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.04em;
  --tracking-widest: 0.08em;
}

/* ========================================
   Base Typography
   ======================================== */

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

body {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-text, #333333);
}

/* ========================================
   Headings
   ======================================== */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--color-heading, #1a1a1a);
}

h1, .h1 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--tracking-tight);
}

h2, .h2 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
}

h3, .h3 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
}

h4, .h4 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
}

h5, .h5 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

h6, .h6 {
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* Hero Headings */
.hero-title,
.hero h1 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-extrabold);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle,
.hero .subtitle {
  font-size: var(--fs-xl);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  opacity: 0.9;
}

/* Section Headings */
.section-title {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  text-align: center;
  margin-bottom: 1rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--color-primary, #0066cc);
  margin: 1.5rem auto 0;
}

.section-subtitle {
  font-size: var(--fs-lg);
  font-weight: var(--fw-regular);
  text-align: center;
  color: var(--color-text-muted, #666666);
  margin-bottom: 3rem;
}

/* ========================================
   Body Text
   ======================================== */

p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: var(--lh-relaxed);
}

.lead,
.text-lead {
  font-size: var(--fs-lg);
  font-weight: var(--fw-light);
  line-height: var(--lh-loose);
}

.text-small {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}

.text-xs {
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
}

/* ========================================
   Lists
   ======================================== */

ul, ol {
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

ul ul, ul ol,
ol ol, ol ul {
  margin-bottom: 0;
}

li {
  margin-bottom: 0.5rem;
  line-height: var(--lh-relaxed);
}

/* ========================================
   Links
   ======================================== */

a {
  color: var(--color-link, #0066cc);
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-link-hover, #0052a3);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ========================================
   Blockquotes
   ======================================== */

blockquote {
  margin: 2rem 0;
  padding: 1.5rem;
  padding-left: 2rem;
  border-left: 4px solid var(--color-primary, #0066cc);
  background: var(--color-bg-subtle, #f8f9fa);
  font-style: italic;
}

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

blockquote cite {
  display: block;
  margin-top: 1rem;
  font-size: var(--fs-sm);
  font-style: normal;
  font-weight: var(--fw-semibold);
  color: var(--color-text-muted, #666666);
}

/* ========================================
   Code & Preformatted
   ======================================== */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  background: var(--color-bg-code, #f3f4f6);
  border-radius: 3px;
  color: var(--color-text-code, #d73a49);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--color-bg-code, #f3f4f6);
  border-radius: 8px;
  overflow-x: auto;
}

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

/* ========================================
   Text Utilities
   ======================================== */

/* Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Weight */
.text-light { font-weight: var(--fw-light); }
.text-normal { font-weight: var(--fw-regular); }
.text-medium { font-weight: var(--fw-medium); }
.text-semibold { font-weight: var(--fw-semibold); }
.text-bold { font-weight: var(--fw-bold); }
.text-extrabold { font-weight: var(--fw-extrabold); }

/* Style */
.text-italic { font-style: italic; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

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

/* Colors */
.text-primary { color: var(--color-primary, #0066cc); }
.text-secondary { color: var(--color-secondary, #6c757d); }
.text-success { color: var(--color-success, #28a745); }
.text-warning { color: var(--color-warning, #ffc107); }
.text-error { color: var(--color-error, #dc3545); }
.text-muted { color: var(--color-text-muted, #666666); }
.text-white { color: #ffffff; }

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

/* Line Height */
.leading-tight { line-height: var(--lh-tight); }
.leading-snug { line-height: var(--lh-snug); }
.leading-normal { line-height: var(--lh-normal); }
.leading-relaxed { line-height: var(--lh-relaxed); }
.leading-loose { line-height: var(--lh-loose); }

/* ========================================
   WordPress Compatibility
   ======================================== */

/* WordPress Block Editor Typography */
.wp-block-heading {
  /* Inherits from our heading styles */
}

.has-small-font-size { font-size: var(--fs-sm); }
.has-normal-font-size { font-size: var(--fs-base); }
.has-medium-font-size { font-size: var(--fs-lg); }
.has-large-font-size { font-size: var(--fs-xl); }
.has-huge-font-size { font-size: var(--fs-3xl); }

/* WordPress Entry Content */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.entry-content h2:first-child,
.entry-content h3:first-child {
  margin-top: 0;
}

.entry-content p {
  margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

/* ========================================
   Responsive Typography
   ======================================== */

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  h1, .h1 {
    font-size: var(--fs-3xl);
  }
  
  .hero-title {
    font-size: var(--fs-4xl);
  }
  
  .section-title {
    font-size: var(--fs-2xl);
  }
}

/* ========================================
   Migration Helpers
   ======================================== */

/* Map old heading classes during migration */
.hero-title,
.page-hero h1,
.service-hero h1,
.about-hero h1,
.contact-hero h1,
.diensten-hero h1,
.tarieven-hero h1,
.pricing-hero h1,
.cybersecurity-hero h1 {
  /* Will inherit from h1 styles */
}

.section-title,
.overview-content h2,
.service-process h2,
.case-results h2 {
  /* Will inherit from h2 styles */
}

.card-title,
.service-card h3,
.process-step h3,
.industry-card h3 {
  /* Will inherit from h3 styles */
}