/**
 * Typography System - Dennis Gutjahr Tiernahrungsberatung
 * Kombiniertes Font-Set: Nunito Sans (Headlines) + Merriweather (Body)
 * DSGVO-konform mit lokalen Font-Dateien
 */

/* ===== FONT-FACE DEFINITIONS ===== */

/* Nunito Sans - für Überschriften */
@font-face {
    font-family: 'Nunito Sans';
    src: url('../fonts/nunito-sans-400.woff2') format('woff2'),
         url('../fonts/nunito-sans-400.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Nunito Sans';
    src: url('../fonts/nunito-sans-700.woff2') format('woff2'),
         url('../fonts/nunito-sans-700.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Merriweather - für Fließtext */
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/merriweather-300.woff2') format('woff2'),
         url('../fonts/merriweather-300.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/merriweather-400.woff2') format('woff2'),
         url('../fonts/merriweather-400.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ===== FONT STACKS MIT FALLBACKS ===== */

:root {
    /* Nunito Sans Stack für Headlines */
    --font-headlines: 'Nunito Sans', 
                      'Segoe UI', 
                      'Helvetica Neue', 
                      'Arial', 
                      sans-serif;
    
    /* Merriweather Stack für Body */
    --font-body: 'Merriweather', 
                 'Georgia', 
                 'Times New Roman', 
                 'Times', 
                 serif;
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.3;
    --line-height-normal: 1.6;
    --line-height-loose: 1.7;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    --font-size-5xl: 3rem;      /* 48px */
    --font-size-6xl: 3.75rem;   /* 60px */
}

/* ===== GLOBAL TYPOGRAPHY RESET ===== */

/* Body - Merriweather für Fließtext */
body {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: #333333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== HEADLINES - NUNITO SANS ===== */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: #2c3e50;
    margin-bottom: 0.5em;
    margin-top: 0;
}

h1, .h1 {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.025em;
}

h2, .h2 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
}

h3, .h3 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.015em;
}

h4, .h4 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
}

h5, .h5 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
}

h6, .h6 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== BODY TEXT - MERRIWEATHER ===== */

p, li, td, th, dd, dt {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
    margin-bottom: 1em;
}

/* Lead Text - größerer Fließtext */
.lead {
    font-family: var(--font-body);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-loose);
    color: #555555;
    margin-bottom: 1.5em;
}

/* ===== SPEZIELLE TYPOGRAFIE-KLASSEN ===== */

/* Display Headlines - extra große Überschriften */
.display-1 {
    font-family: var(--font-headlines);
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.display-2 {
    font-family: var(--font-headlines);
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.display-3 {
    font-family: var(--font-headlines);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.display-4 {
    font-family: var(--font-headlines);
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.3;
    letter-spacing: -0.015em;
}

/* Small Text */
.small, small {
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
}

/* Text Utilities */
.text-light {
    font-weight: var(--font-weight-light) !important;
}

.text-regular {
    font-weight: var(--font-weight-regular) !important;
}

.text-bold {
    font-weight: var(--font-weight-bold) !important;
}

/* ===== BUTTONS & UI ELEMENTS ===== */

.btn {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.025em;
    text-transform: none;
}

.btn-lg {
    font-size: var(--font-size-lg);
}

.btn-sm {
    font-size: var(--font-size-sm);
}

/* ===== NAVIGATION ===== */

.navbar-brand {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-2xl);
}

.nav-link {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-base);
}

/* ===== CARDS & COMPONENTS ===== */

.card-title {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

.card-text {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
}

/* ===== FORMS ===== */

.form-label {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control, .form-select {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-base);
}

/* ===== ALERTS & NOTIFICATIONS ===== */

.alert {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
}

.alert-heading {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-bold);
}

/* ===== BLOCKQUOTES ===== */

blockquote {
    font-family: var(--font-body);
    font-weight: var(--font-weight-light);
    font-size: var(--font-size-xl);
    line-height: var(--line-height-loose);
    font-style: italic;
    color: #666666;
    border-left: 4px solid #4a7c59;
    padding-left: 1.5rem;
    margin: 2rem 0;
}

blockquote cite {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-sm);
    font-style: normal;
    color: #888888;
    display: block;
    margin-top: 0.5rem;
}

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

ul, ol {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-normal);
}

li {
    margin-bottom: 0.5em;
}

/* ===== TABLES ===== */

.table th {
    font-family: var(--font-headlines);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    font-family: var(--font-body);
    font-weight: var(--font-weight-regular);
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */

/* Mobile Optimierungen */
@media (max-width: 768px) {
    :root {
        --font-size-6xl: 2.5rem;    /* 40px */
        --font-size-5xl: 2rem;      /* 32px */
        --font-size-4xl: 1.75rem;   /* 28px */
        --font-size-3xl: 1.5rem;    /* 24px */
    }
    
    body {
        font-size: var(--font-size-base);
        line-height: var(--line-height-loose);
    }
    
    .lead {
        font-size: var(--font-size-lg);
    }
    
    h1, .h1, .display-1, .display-2 {
        line-height: 1.2;
        margin-bottom: 0.75em;
    }
}

/* Tablet Optimierungen */
@media (min-width: 769px) and (max-width: 1024px) {
    .lead {
        font-size: var(--font-size-xl);
    }
}

/* Desktop Optimierungen */
@media (min-width: 1200px) {
    body {
        font-size: var(--font-size-lg);
    }
    
    .lead {
        font-size: var(--font-size-2xl);
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    body {
        font-family: 'Times New Roman', Times, serif;
        font-size: 12pt;
        line-height: 1.4;
        color: #000000;
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-family: 'Arial', sans-serif;
        color: #000000;
        page-break-after: avoid;
    }
    
    p, li {
        orphans: 3;
        widows: 3;
    }
}

/* ===== ACCESSIBILITY ===== */

/* Hochkontrast-Modus */
@media (prefers-contrast: high) {
    body {
        color: #000000;
    }
    
    h1, h2, h3, h4, h5, h6 {
        color: #000000;
    }
}

/* Reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== FONT LOADING OPTIMIZATION ===== */

/* Font Loading States */
.fonts-loading body {
    visibility: hidden;
}

.fonts-loaded body {
    visibility: visible;
}

/* Fallback für nicht geladene Fonts */
.no-js body {
    font-family: 'Georgia', 'Times New Roman', Times, serif;
}

.no-js h1, .no-js h2, .no-js h3, .no-js h4, .no-js h5, .no-js h6 {
    font-family: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
}

/* ===== PERFORMANCE OPTIMIERUNGEN ===== */

/* Font-Display für bessere Performance */
@supports (font-display: swap) {
    @font-face {
        font-display: swap;
    }
}

/* Preload wichtiger Fonts (wird im HTML-Head eingebunden) */
/*
<link rel="preload" href="/assets/fonts/nunito-sans-700.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/merriweather-400.woff2" as="font" type="font/woff2" crossorigin>
*/

