/**
 * DORA Design System - Typography
 * Version: 3.0 — Unified on Sora + Plus Jakarta Sans
 *
 * Fonts are loaded via design-v2-head.php (Google Fonts link).
 * No @import here to avoid render-blocking duplication.
 */

/* ========================================
   BASE TYPOGRAPHY
   ======================================== */
body {
    font-family: var(--font-primary, 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    font-size: var(--text-base, 1rem);
    line-height: 1.7;
    color: var(--color-neutral-800, #1e293b);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ========================================
   HEADINGS - Modern Style
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading, 'Sora', 'Plus Jakarta Sans', sans-serif);
    font-weight: var(--font-bold, 700);
    line-height: 1.2;
    color: var(--color-neutral-900, #0f172a);
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

/* H1 - Hero & Page Titles */
h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: var(--font-extrabold, 800);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* H1 sur fond sombre */
.dark-bg h1,
.hero-modern h1,
.strategy h1,
[class*="hero"]:not(.hp-hero) h1 {
    color: var(--text-on-dark-primary, #f1f5f9);
}

/* H1 avec accent gradient (optionnel) */
h1 .text-gradient,
.heading-gradient {
    background: linear-gradient(135deg, var(--color-primary-500, #3b82f6) 0%, var(--color-accent-500, #8b5cf6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 .text-accent {
    background: linear-gradient(135deg, var(--color-warning-500, #f59e0b) 0%, var(--color-cta-500, #f59e0b) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* H2 - Section Titles */
h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: var(--font-bold, 700);
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 1rem;
    position: relative;
}

/* H2 avec ligne décorative */
h2.with-line::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--gradient-cta, linear-gradient(135deg, #f59e0b 0%, #d97706 100%));
    border-radius: 2px;
    margin-top: 1rem;
}

h2.with-line.center::after {
    margin-left: auto;
    margin-right: auto;
}

/* H2 sur fond sombre */
.dark-bg h2,
.strategy h2,
.deliverables h2,
[class*="hero"]:not(.hp-hero) h2 {
    color: var(--text-on-dark-primary, #f1f5f9);
}

/* H3 - Subsection Titles */
h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: var(--font-semibold, 600);
    line-height: 1.3;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

/* H3 sur fond sombre */
.dark-bg h3,
.strategy h3,
.deliverables h3 {
    color: var(--text-on-dark-primary, #f1f5f9);
}

/* H3 avec icône */
h3 .icon,
h3 i {
    color: var(--color-primary-600, #2563eb);
    margin-right: 0.5rem;
}

/* H4 - Card Titles */
h4 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    font-weight: var(--font-semibold, 600);
    line-height: 1.4;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* H5 & H6 */
h5 {
    font-size: var(--text-lg, 1.125rem);
    font-weight: var(--font-semibold, 600);
}

h6 {
    font-size: var(--text-base, 1rem);
    font-weight: var(--font-semibold, 600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-neutral-500, #64748b);
}

/* ========================================
   SPECIAL HEADING STYLES
   ======================================== */

/* Section Title - Centré avec badge */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    margin-bottom: 1rem;
}

.section-title p {
    font-size: var(--text-lg, 1.125rem);
    color: var(--color-neutral-600, #475569);
    max-width: 600px;
    margin: 0 auto;
}

/* Badge au-dessus du titre */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--color-primary-100, #dbeafe);
    color: var(--color-primary-700, #1d4ed8);
    border-radius: var(--radius-full, 9999px);
    font-size: var(--text-sm, 0.875rem);
    font-weight: var(--font-semibold, 600);
    margin-bottom: 1rem;
    letter-spacing: 0.02em;
}

.dark-bg .section-badge {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-white, #ffffff);
}

/* Hero Title Style */
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
}

/* Feature Title */
.feature-title {
    font-size: var(--text-xl, 1.25rem);
    font-weight: var(--font-bold, 700);
    color: var(--color-neutral-900, #0f172a);
    margin-bottom: 0.5rem;
}

/* Card Title */
.card-title {
    font-size: var(--text-xl, 1.25rem);
    font-weight: var(--font-bold, 700);
    color: var(--color-neutral-900, #0f172a);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* ========================================
   PARAGRAPHS & TEXT
   ======================================== */
p {
    margin: 0 0 1rem 0;
    line-height: 1.8;
    color: var(--color-neutral-700, #334155);
}

.lead {
    font-size: var(--text-xl, 1.25rem);
    line-height: 1.7;
    color: var(--color-neutral-600, #475569);
}

.dark-bg .lead,
.dark-bg p {
    color: var(--text-on-dark-secondary, #e2e8f0);
}

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

.text-xs {
    font-size: var(--text-xs, 0.75rem);
}

/* Muted text */
.text-muted {
    color: var(--color-neutral-500, #64748b);
}

.dark-bg .text-muted {
    color: var(--text-on-dark-muted, #cbd5e1);
}

/* ========================================
   TEXT COLORS
   ======================================== */
.text-primary { color: var(--color-primary-600, #2563eb); }
.text-accent { color: var(--color-accent-500, #8b5cf6); }
.text-cta { color: var(--color-cta-500, #f59e0b); }
.text-success { color: var(--color-success-500, #10b981); }
.text-warning { color: var(--color-warning-500, #f59e0b); }
.text-error { color: var(--color-error-500, #ef4444); }
.text-white { color: var(--color-white, #ffffff); }

/* ========================================
   TEXT ALIGNMENT
   ======================================== */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ========================================
   FONT WEIGHTS
   ======================================== */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* ========================================
   LISTS
   ======================================== */
ul, ol {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    color: var(--color-neutral-700, #334155);
}

/* Custom list with check icons */
.list-check {
    list-style: none;
    padding-left: 0;
}

.list-check li {
    position: relative;
    padding-left: 1.75rem;
}

.list-check li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: var(--color-success-500, #10b981);
    font-weight: bold;
}

/* ========================================
   LINKS
   ======================================== */
a {
    color: var(--color-primary-600, #2563eb);
    text-decoration: none;
    transition: color var(--duration-fast, 150ms) ease;
}

a:hover {
    color: var(--color-primary-700, #1d4ed8);
}

.dark-bg a {
    color: var(--color-primary-300, #93c5fd);
}

.dark-bg a:hover {
    color: var(--color-primary-200, #bfdbfe);
}

/* ========================================
   BLOCKQUOTES
   ======================================== */
blockquote {
    margin: 1.5rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--color-primary-600, #2563eb);
    background: var(--color-neutral-50, #f8fafc);
    border-radius: 0 var(--radius-lg, 0.5rem) var(--radius-lg, 0.5rem) 0;
    font-style: italic;
    color: var(--color-neutral-700, #334155);
}

blockquote cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: var(--font-semibold, 600);
    color: var(--color-neutral-500, #64748b);
}

/* ========================================
   CODE
   ======================================== */
code {
    font-family: var(--font-mono, 'JetBrains Mono', Consolas, monospace);
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: var(--color-neutral-100, #f1f5f9);
    border-radius: var(--radius-sm, 0.25rem);
    color: var(--color-accent-600, #7c3aed);
}

pre {
    font-family: var(--font-mono, 'JetBrains Mono', Consolas, monospace);
    font-size: var(--text-sm, 0.875rem);
    padding: 1.5rem;
    background: var(--color-neutral-900, #0f172a);
    color: var(--color-neutral-100, #f1f5f9);
    border-radius: var(--radius-xl, 0.75rem);
    overflow-x: auto;
    margin: 1.5rem 0;
}

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

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */
@media (max-width: 768px) {
    h1 {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    h2 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    h3 {
        font-size: clamp(1.125rem, 4vw, 1.5rem);
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .lead {
        font-size: var(--text-lg, 1.125rem);
    }
}
