/* ========================================
   GIP Institut - Modern CSS
   ======================================== */

/* CSS Custom Properties (Variables) */
:root {
    /* Farben */
    --primary-color: #F5EC00;
    --headline-color: #012F7B;
    --headline-hover: #011E5E;
    --dark-color: #333;
    --light-color: #f8f9fa;
    --text-muted: #555;
    --border-color: #ddd;

    /* Typografie */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-size-base: 1rem;
    --font-size-lg: 1.1rem;
    --font-size-h1: 2.5rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.6rem;
    --font-size-h4: 1.4rem;
    --line-height-base: 1.6;
    --line-height-heading: 1.2;

    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 40px;
    --spacing-2xl: 60px;
    --spacing-3xl: 100px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Border Radius */
    --radius-sm: 5px;
    --radius-md: 10px;
    --radius-lg: 15px;
}

/* ========================================
   Global Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--dark-color);
    background-color: #ffffff;
    overflow-x: hidden;
}

/* Skip Link für Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--headline-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    line-height: var(--line-height-heading);
    font-weight: bold;
    margin-bottom: 0.5em;
    color: var(--dark-color);
}

h1 {
    font-size: var(--font-size-h1);
}

h2 {
    font-size: var(--font-size-h2);
}

h3 {
    font-size: var(--font-size-h3);
}

h4 {
    font-size: var(--font-size-h4);
}

p {
    margin-bottom: 1em;
}

/* Optimale Zeilenlänge für Lesbarkeit */
.text-start p {
    max-width: 75ch;
}

strong {
    font-weight: 600;
}

/* ========================================
   Links
   ======================================== */

a {
    color: var(--headline-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--headline-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--headline-color);
    outline-offset: 2px;
}

/* ========================================
   Navigation
   ======================================== */

.navbar {
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

/* Desktop Navigation Underline Effect */
@media (min-width: 992px) {
    .navbar-nav .nav-link::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--primary-color);
        transition: all var(--transition-fast);
        transform: translateX(-50%);
    }

    .navbar-nav .nav-link:hover::after,
    .navbar-nav .nav-link.active::after {
        width: 80%;
    }
}

/* Mobile Navigation */
.offcanvas {
    background-color: var(--dark-color);
}

.offcanvas .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.offcanvas .nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.05);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #E5D900 100%);
    padding: 80px 0 var(--spacing-lg) 0;
    color: var(--dark-color);
    min-height: auto;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-top: 56px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero h1 {
    color: #1a1a52;
    font-weight: bold;
    margin-bottom: var(--spacing-lg);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 0.8s ease;
}

.hero h2 {
    color: #1a1a52;
    font-weight: 600;
    animation: fadeInUp 1s ease 0.2s both;
}

.hero h3 {
    color: #1a1a52;
    font-weight: 600;
}

.hero .lead {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

.hero .fw-semibold {
    color: #2a2a6e;
    animation: fadeIn 1.2s ease 0.4s both;
}

.hero p {
    color: #2a2a6e;
}

/* ========================================
   Section Styles
   ======================================== */

article, section {
    padding: var(--spacing-2xl) 0;
    scroll-margin-top: 70px; /* Offset für fixed navbar */
}

.section-title {
    font-size: var(--font-size-h2);
    font-weight: bold;
    color: var(--headline-color);
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.text-center .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ========================================
   Images
   ======================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-fluid {
    border-radius: var(--radius-md);
    transition: transform var(--transition-base);
}

.img-fluid:hover {
    transform: scale(1.02);
}

.shadow {
    box-shadow: var(--shadow-md);
}

.rounded {
    border-radius: var(--radius-md);
}

.image-caption {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
    text-align: center;
}

/* ========================================
   Lists
   ======================================== */

ul, ol {
    margin-bottom: var(--spacing-lg);
    padding-left: 1.5rem;
}

li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.quellen-list {
    list-style-type: none;
    padding: 0;
}

.quellen-list li {
    padding-left: 1.5rem;
    position: relative;
    margin-bottom: var(--spacing-md);
}

.quellen-list li::before {
    content: '📚';
    position: absolute;
    left: 0;
}

/* ========================================
   Footer
   ======================================== */

footer {
    background-color: var(--dark-color);
    color: white;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
}

footer a {
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition-fast);
}

footer a:hover {
    color: white;
    text-decoration: none;
}

/* ========================================
   Back to Top Button
   ======================================== */

#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--headline-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    background-color: var(--headline-hover);
    transform: translateY(-5px);
}

#backToTop:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* ========================================
   Responsive Design - Mobile First
   ======================================== */

/* Mobile Basis (bis 767px) */
.hero {
    padding: 70px 15px var(--spacing-md) 15px;
    min-height: auto;
    margin-top: 56px;
}

.hero h1 {
    font-size: 1.5rem;
    line-height: 1.3;
}

.hero h3 {
    font-size: 0.95rem;
    line-height: 1.4;
}

.section-title {
    font-size: 1.5rem;
}

/* Tablet: 768px+ */
@media (min-width: 768px) {
    :root {
        --font-size-h1: 2rem;
        --font-size-h2: 1.75rem;
        --spacing-2xl: 70px;
    }

    .hero {
        padding: 80px 20px var(--spacing-lg) 20px;
        min-height: auto;
        margin-top: 56px;
    }

    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }

    .hero h3 {
        font-size: 1.15rem;
        line-height: 1.4;
    }

    article, section {
        padding: var(--spacing-2xl) 0;
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    :root {
        --font-size-h1: 2.5rem;
        --font-size-h2: 2rem;
        --spacing-2xl: 100px;
    }

    .hero {
        padding: 80px 0 var(--spacing-xl) 0;
        min-height: auto;
        margin-top: 56px;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    .hero h3 {
        font-size: 1.25rem;
        line-height: 1.4;
    }

    .container {
        max-width: 1140px;
    }
}

/* Large Desktop: 1440px+ */
@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.text-muted {
    color: var(--text-muted);
}

.bg-light {
    background-color: var(--light-color) !important;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .navbar,
    .offcanvas,
    #backToTop,
    footer {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    img {
        max-width: 100% !important;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}

/* ========================================
   Accessibility Improvements
   ======================================== */

/* Focus-Visible Support */
*:focus-visible {
    outline: 2px solid var(--headline-color);
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --headline-color: #000080;
        --dark-color: #000000;
    }

    .hero {
        background: #FFFF00;
    }
}

/* Dark Mode Support (Optional, aber vorbereitet) */
@media (prefers-color-scheme: dark) {
    /* Kann später aktiviert werden wenn gewünscht */
    /*
    body {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    */
}
