﻿/* ==========================================================================
   FID.Compass HERO SECTION – Wiederverwendbare Komponente
   ==========================================================================
   
   Nutzt Design-System-Tokens aus design-system.css / colors-only.css.
   
   Verwendung (Template-Include):
     {% include 'includes/hero_section.html' with title='Dashboard' subtitle='...' icon='bi-speedometer2' %}
   
   Version: 2026.02.18
   ========================================================================== */

/*
 * Bezugsbreite für randfüllende Hero-Bereiche. Container-Einheiten verwenden
 * die tatsächlich verfügbare Seitenbreite und schließen die Scrollleiste aus.
 */
html {
    container-type: inline-size;
}

.hero-section {
    --hero-grid-cell-size: 32px;
    --hero-logo-share: 0.7;
    --hero-logo-reference-size: clamp(5rem, 7vw, 6rem);
    background: var(--primary-color) !important;
    color: #ffffff;
    padding: 2rem 0;
    margin-bottom: 1.25rem;
    margin-top: -20px;
    margin-left: calc(-50cqi + 50%);
    margin-right: calc(-50cqi + 50%);
    width: 100cqi;
    position: relative;
    overflow: hidden;
}

/* Keep header color but re-add subtle grid lines. */
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: var(--hero-grid-cell-size) var(--hero-grid-cell-size);
    background-position: 0 0;
    opacity: 0.3;
    pointer-events: none;
}

.hero-section::after {
    display: none;
}

/* Inner Container */
.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6, 1.5rem);
    position: relative;
    z-index: 2;
}

.hero-main {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.hero-text {
    flex: 1;
    min-width: 0;
}

.hero-breadcrumb-nav {
    margin-bottom: 0.65rem;
}

.hero-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: 0.92rem;
    font-weight: var(--font-weight-medium, 500);
    color: #ffffff;
}

.hero-breadcrumb,
.hero-breadcrumb * {
    color: #ffffff !important;
}

.hero-breadcrumb__item {
    display: inline-flex;
    align-items: center;
}

.hero-breadcrumb__separator {
    flex: 0 0 auto;
    margin: 0 0.35rem;
    color: #ffffff;
    font-size: 0.72em;
    line-height: 1;
}

.hero-breadcrumb__item a {
    color: #ffffff;
    text-decoration: none;
    border-bottom: none;
    transition: opacity 0.2s ease;
}

.hero-breadcrumb__item a:hover {
    color: #ffffff !important;
    border-bottom: none;
    opacity: 1;
}

.hero-breadcrumb__item--current {
    color: #ffffff;
    font-weight: var(--font-weight-semibold, 600);
}

/* Title */
.hero-title {
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: 2rem;
    font-weight: var(--font-weight-semibold, 600);
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #ffffff;
    line-height: 1.3;
}

.hero-title i {
    font-size: 1.5rem;
    opacity: 0.85;
}

.hero-main--with-logo {
    align-items: flex-start;
}

.hero-side-logo-wrap {
    --hero-logo-wrap-size: calc(var(--hero-logo-reference-size) * var(--hero-logo-share));
    width: var(--hero-logo-wrap-size);
    height: var(--hero-logo-wrap-size);
    aspect-ratio: 1 / 1;
    max-width: 4.2rem;
    max-height: 4.2rem;
    border-radius: 0.28rem;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.58);
    box-shadow: 0 10px 22px rgba(7, 31, 49, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.hero-side-logo {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 0.18rem;
    background: transparent;
    display: block;
    margin: auto;
}

.hero-title-text {
    min-width: 0;
}

/* Subtitle */
.hero-subtitle {
    font-family: var(--font-family-primary, 'Inter', 'Segoe UI', sans-serif);
    font-size: var(--font-size-base, 1rem);
    opacity: 0.85;
    margin: 0;
    font-weight: var(--font-weight-normal, 400);
    color: #ffffff;
    line-height: 1.5;
}

.hero-subtitle a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hero-subtitle a:hover {
    opacity: 1;
}

/* Modifier: kein Abstand unten (für Formulare die direkt an Wizard anschließen) */
.hero-section--flush {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section {
        --hero-grid-cell-size: 24px;
        --hero-logo-reference-size: clamp(4.2rem, 11vw, 4.8rem);
        padding: 1.5rem 0;
    }
    .hero-main {
        gap: 0.75rem;
    }


    .hero-section::before {
        background-size: var(--hero-grid-cell-size) var(--hero-grid-cell-size);
    }

    .hero-title {
        font-size: 1.5rem;
        gap: 0.7rem;
    }

    .hero-title i {
        font-size: 1.25rem;
    }

    .hero-side-logo-wrap {
        --hero-logo-wrap-size: calc(var(--hero-logo-reference-size) * var(--hero-logo-share));
        width: var(--hero-logo-wrap-size);
        height: var(--hero-logo-wrap-size);
        max-width: 3.35rem;
        max-height: 3.35rem;
        border-radius: 0.24rem;
        padding: 0;
    }

    .hero-subtitle {
        font-size: var(--font-size-sm, 0.875rem);
    }

    .hero-breadcrumb {
        font-size: 0.82rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-section::before {
        animation: none;
    }
}

/* Print */
@media print {
    .hero-section {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0;
        width: auto;
        padding: 1rem 0;
        border-bottom: 2px solid #000;
    }

    .hero-section::before,
    .hero-section::after {
        display: none;
    }

    .hero-title,
    .hero-subtitle {
        color: #000000 !important;
    }

    .hero-breadcrumb,
    .hero-breadcrumb__item,
    .hero-breadcrumb__item a,
    .hero-breadcrumb__separator {
        color: #000000 !important;
    }
}

