/* =================================================================
   PROFESSIONAL TYPOGRAPHY SYSTEM
   World-class, balanced typography for all devices
   Based on 16px base with 1.250 scale (Major Third)
================================================================= */

/* =================================================================
   1. BASE TYPOGRAPHY - Clean & Professional
================================================================= */

html {
    font-size: 100%; /* 16px base */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--wm-font, 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    font-size: 1rem; /* 16px */
    font-weight: 400;
    line-height: 1.6; /* Optimal for readability */
    color: var(--wm-body-text, #555);
    letter-spacing: 0.01em; /* Subtle letter spacing for clarity */
}

/* =================================================================
   2. HEADING SYSTEM - Balanced & Elegant
   Using Major Third scale (1.250) for harmony
================================================================= */

h1, .h1 {
    font-size: 2.441rem; /* ~39px */
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

h2, .h2 {
    font-size: 1.953rem; /* ~31px */
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 0.875rem;
}

h3, .h3 {
    font-size: 1.563rem; /* ~25px */
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
}

h4, .h4 {
    font-size: 1.25rem; /* ~20px */
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
    margin-bottom: 0.625rem;
}

h5, .h5 {
    font-size: 1rem; /* 16px */
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.01em;
    margin-bottom: 0.5rem;
}

h6, .h6 {
    font-size: 0.8rem; /* ~13px */
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* =================================================================
   3. RESPONSIVE TYPOGRAPHY - Mobile First
================================================================= */

/* Small devices (< 576px) */
@media (max-width: 575.98px) {
    html {
        font-size: 100%; /* Keep 16px for mobile inputs */
    }

    body {
        font-size: 0.9375rem; /* 15px - slightly smaller */
    }

    h1, .h1 { 
        font-size: 1.75rem; /* 28px */
        line-height: 1.25;
    }
    
    h2, .h2 { 
        font-size: 1.5rem; /* 24px */
        line-height: 1.3;
    }
    
    h3, .h3 { 
        font-size: 1.25rem; /* 20px */
    }
    
    h4, .h4 { 
        font-size: 1.125rem; /* 18px */
    }
    
    h5, .h5 { 
        font-size: 1rem; /* 16px */
    }
    
    h6, .h6 { 
        font-size: 0.75rem; /* 12px */
    }
}

/* Medium devices (576px - 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    h1, .h1 { 
        font-size: 2rem; /* 32px */
    }
    
    h2, .h2 { 
        font-size: 1.75rem; /* 28px */
    }
}

/* Large devices (768px - 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    h1, .h1 { 
        font-size: 2.25rem; /* 36px */
    }
    
    h2, .h2 { 
        font-size: 1.875rem; /* 30px */
    }
}

/* Extra large devices (≥ 992px) */
@media (min-width: 992px) {
    body {
        font-size: 1rem; /* 16px */
    }
}

/* Ultra wide (≥ 1920px) */
@media (min-width: 1920px) {
    body {
        font-size: 1.0625rem; /* 17px */
    }
    
    h1, .h1 { 
        font-size: 2.75rem; /* 44px */
    }
    
    h2, .h2 { 
        font-size: 2.25rem; /* 36px */
    }
}

/* =================================================================
   4. TEXT UTILITIES - Professional Scale
================================================================= */

/* Size Utilities */
.text-xs { font-size: 0.75rem; line-height: 1.5; }      /* 12px */
.text-sm { font-size: 0.875rem; line-height: 1.5; }     /* 14px */
.text-base { font-size: 1rem; line-height: 1.6; }       /* 16px */
.text-lg { font-size: 1.125rem; line-height: 1.6; }     /* 18px */
.text-xl { font-size: 1.25rem; line-height: 1.5; }      /* 20px */
.text-2xl { font-size: 1.5rem; line-height: 1.4; }      /* 24px */
.text-3xl { font-size: 1.875rem; line-height: 1.3; }    /* 30px */
.text-4xl { font-size: 2.25rem; line-height: 1.2; }     /* 36px */

/* Weight Utilities */
.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; }

/* Line Height Utilities */
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }
.leading-loose { line-height: 2; }

/* Letter Spacing Utilities */
.tracking-tighter { letter-spacing: -0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

/* =================================================================
   5. PARAGRAPH & TEXT ELEMENTS
================================================================= */

p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}

p.lead {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-text);
}

small, .text-small {
    font-size: 0.875rem;
    line-height: 1.5;
}

.text-muted {
    color: var(--text-light, #777);
}

/* =================================================================
   6. LINKS
================================================================= */

a {
    color: var(--wm-red, #A52A2A);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--wm-red-dark, #7A1F1F);
    text-decoration: underline;
}

/* =================================================================
   7. LISTS
================================================================= */

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

li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* =================================================================
   8. BLOCKQUOTE
================================================================= */

blockquote {
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--wm-red);
    background-color: var(--color-light-gray);
    font-size: 1.125rem;
    line-height: 1.7;
    font-style: italic;
}

/* =================================================================
   9. CODE & PRE
================================================================= */

code {
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    padding: 0.125rem 0.375rem;
    background-color: #f4f4f4;
    border-radius: 4px;
    color: #d63384;
}

pre {
    padding: 1rem;
    background-color: #f4f4f4;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* =================================================================
   10. SECTION-SPECIFIC TYPOGRAPHY
================================================================= */

/* Hero Sections */
.hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    line-height: 1.6;
}

/* Section Titles */
.section-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: clamp(0.9375rem, 1.5vw, 1.125rem);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Card Titles */
.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.card-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text);
}

/* =================================================================
   11. BUTTON TYPOGRAPHY
================================================================= */

.btn {
    font-size: 0.9375rem; /* 15px */
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
}

.btn-sm {
    font-size: 0.875rem; /* 14px */
}

.btn-lg {
    font-size: 1rem; /* 16px */
}

/* =================================================================
   12. FORM TYPOGRAPHY
================================================================= */

label {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    display: block;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem; /* Always 16px to prevent iOS zoom */
    line-height: 1.5;
}

@media (max-width: 575.98px) {
    input, textarea, select {
        font-size: 1rem !important; /* Prevent iOS zoom */
    }
}

/* =================================================================
   13. DARK MODE ADJUSTMENTS
================================================================= */

[data-theme="dark"] {
    h1, h2, h3, h4, h5, h6,
    .h1, .h2, .h3, .h4, .h5, .h6 {
        color: var(--dm-text-primary);
    }
    
    body, p {
        color: var(--dm-text-secondary);
    }
    
    .text-muted {
        color: #888;
    }
    
    blockquote {
        background-color: var(--dm-surface);
        border-left-color: var(--wm-red);
    }
    
    code {
        background-color: rgba(255, 255, 255, 0.05);
        color: #e685b5;
    }
    
    pre {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

/* =================================================================
   14. ACCESSIBILITY & READABILITY
================================================================= */

/* Optimal line length for readability */
.text-content {
    max-width: 65ch; /* 65 characters */
    margin-left: auto;
    margin-right: auto;
}

/* Selection colors */
::selection {
    background-color: var(--wm-red);
    color: white;
}

::-moz-selection {
    background-color: var(--wm-red);
    color: white;
}

/* =================================================================
   15. PRINT STYLES
================================================================= */

@media print {
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    h1 { font-size: 24pt; }
    h2 { font-size: 20pt; }
    h3 { font-size: 16pt; }
    h4 { font-size: 14pt; }
    h5 { font-size: 12pt; }
    h6 { font-size: 10pt; }
}

