/* ========================================
   HENX3 - Global Typography System
   Einheitliche Überschriften & Text-Styles
   ======================================== */

/* ==========================================
   CSS Variables für Typografie
   ========================================== */
:root {
    /* Font Families */
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Space Grotesk', system-ui, sans-serif;

    /* Font Sizes - Fluid Typography */
    --fs-display: clamp(3rem, 10vw, 7rem);      /* Hero Haupttitel */
    --fs-h1: clamp(2.5rem, 6vw, 4.5rem);        /* Seiten-Titel */
    --fs-h2: clamp(2rem, 5vw, 3.5rem);          /* Section-Titel */
    --fs-h3: clamp(1.5rem, 3vw, 2rem);          /* Sub-Section-Titel */
    --fs-h4: clamp(1.125rem, 2vw, 1.5rem);      /* Card-Titel */
    --fs-h5: 1.125rem;                           /* Small Titel */
    --fs-h6: 1rem;                               /* Kleinste Überschrift */

    --fs-body-lg: 1.125rem;                      /* Großer Body Text */
    --fs-body: 1rem;                             /* Standard Body */
    --fs-body-sm: 0.9375rem;                     /* Kleiner Body */
    --fs-caption: 0.875rem;                      /* Captions, Labels */
    --fs-small: 0.8125rem;                       /* Kleine Texte */
    --fs-tiny: 0.75rem;                          /* Badges, Tags */

    /* Line Heights */
    --lh-tight: 0.95;                            /* Display/Hero */
    --lh-heading: 1.1;                           /* Überschriften */
    --lh-body: 1.7;                              /* Fließtext */
    --lh-relaxed: 1.8;                           /* Entspannter Text */

    /* Letter Spacing */
    --ls-tight: -0.03em;                         /* Display */
    --ls-normal: -0.02em;                        /* Überschriften */
    --ls-wide: 0.05em;                           /* Labels */
    --ls-wider: 0.1em;                           /* Uppercase Text */
    --ls-widest: 0.2em;                          /* Hero Labels */
}

/* ==========================================
   Base Heading Styles
   ========================================== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: var(--lh-heading);
    color: var(--text, #fafafa);
    margin: 0;
}

/* H1 - Haupttitel (Seiten-Hero) */
h1, .h1 {
    font-size: var(--fs-h1);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
}

/* H2 - Section Titel */
h2, .h2 {
    font-size: var(--fs-h2);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-normal);
}

/* H3 - Sub-Section / Card Gruppen */
h3, .h3 {
    font-size: var(--fs-h3);
    line-height: var(--lh-heading);
}

/* H4 - Card Titel / Feature Titel */
h4, .h4 {
    font-size: var(--fs-h4);
    line-height: var(--lh-heading);
}

/* H5 - Kleine Titel */
h5, .h5 {
    font-size: var(--fs-h5);
    font-family: var(--font-sans);
    font-weight: 600;
}

/* H6 - Kleinste Überschriften */
h6, .h6 {
    font-size: var(--fs-h6);
    font-family: var(--font-sans);
    font-weight: 600;
}

/* ==========================================
   Akzent-Styling (em in Überschriften)
   ========================================== */
h1 em, h2 em, h3 em, h4 em,
.h1 em, .h2 em, .h3 em, .h4 em {
    font-style: italic;
    color: var(--accent, #3B82F6);
}

/* ==========================================
   Display / Hero Titel
   ========================================== */
.display-title {
    font-family: var(--font-serif);
    font-size: var(--fs-display);
    font-weight: 400;
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
}

.display-title em {
    font-style: italic;
    background: linear-gradient(135deg, var(--accent, #3B82F6), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   Section Headers
   ========================================== */
.section-title {
    font-family: var(--font-serif);
    font-size: var(--fs-h2);
    font-weight: 400;
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-normal);
    margin-bottom: 1rem;
}

.section-title em {
    font-style: italic;
    color: var(--accent, #3B82F6);
}

.section-subtitle {
    font-size: var(--fs-body-lg);
    color: var(--text-dim, #d4d4d8);
    line-height: var(--lh-relaxed);
    max-width: 600px;
}

/* ==========================================
   Section Labels / Badges
   ========================================== */
.section-label {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: var(--fs-tiny);
    font-weight: 600;
    letter-spacing: var(--ls-wider);
    text-transform: uppercase;
    color: var(--accent, #3B82F6);
    margin-bottom: 1.5rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: var(--fs-tiny);
    font-weight: 600;
    letter-spacing: var(--ls-wide);
    text-transform: uppercase;
    color: var(--accent, #3B82F6);
    background: rgba(var(--accent-rgb, 59, 130, 246), 0.1);
    border: 1px solid rgba(var(--accent-rgb, 59, 130, 246), 0.2);
    border-radius: 20px;
    margin-bottom: 1.5rem;
}

/* ==========================================
   Card Titles
   ========================================== */
.card-title {
    font-family: var(--font-serif);
    font-size: var(--fs-h4);
    font-weight: 400;
    line-height: var(--lh-heading);
    margin-bottom: 0.75rem;
}

.card-title-sm {
    font-family: var(--font-serif);
    font-size: var(--fs-h5);
    font-weight: 400;
    line-height: var(--lh-heading);
    margin-bottom: 0.5rem;
}

/* ==========================================
   Body Text Variants
   ========================================== */
.text-lg {
    font-size: var(--fs-body-lg);
    line-height: var(--lh-body);
}

.text-body {
    font-size: var(--fs-body);
    line-height: var(--lh-body);
}

.text-sm {
    font-size: var(--fs-body-sm);
    line-height: var(--lh-body);
}

.text-caption {
    font-size: var(--fs-caption);
    line-height: var(--lh-body);
    color: var(--text-dim, #d4d4d8);
}

.text-small {
    font-size: var(--fs-small);
    line-height: var(--lh-body);
    color: var(--text-muted, #52525b);
}

/* ==========================================
   Text Colors
   ========================================== */
.text-primary {
    color: var(--text, #fafafa);
}

.text-dim {
    color: var(--text-dim, #d4d4d8);
}

.text-muted {
    color: var(--text-muted, #52525b);
}

.text-accent {
    color: var(--accent, #3B82F6);
}

/* ==========================================
   Special Text Styles
   ========================================== */
.text-gradient {
    background: linear-gradient(135deg, var(--accent, #3B82F6), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
}

.text-center {
    text-align: center;
}

.text-balance {
    text-wrap: balance;
}

/* ==========================================
   Responsive Typography Adjustments
   ========================================== */
@media (max-width: 768px) {
    :root {
        --fs-display: clamp(2.5rem, 12vw, 4rem);
        --fs-h1: clamp(2rem, 8vw, 3rem);
        --fs-h2: clamp(1.75rem, 6vw, 2.5rem);
        --fs-h3: clamp(1.25rem, 4vw, 1.75rem);
        --fs-h4: clamp(1rem, 3vw, 1.25rem);
    }

    .section-subtitle {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    :root {
        --fs-display: clamp(2rem, 14vw, 3rem);
        --fs-h1: clamp(1.75rem, 10vw, 2.5rem);
        --fs-h2: clamp(1.5rem, 8vw, 2rem);
        --fs-h3: clamp(1.125rem, 5vw, 1.5rem);
    }

    .section-label,
    .section-badge {
        font-size: 0.6875rem;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    h1, h2, h3, h4, h5, h6 {
        color: #000;
        page-break-after: avoid;
    }

    .text-gradient {
        -webkit-text-fill-color: #3B82F6;
        color: #3B82F6;
    }
}
