/* =================================================================
   HERO – Unified Component Styles
   Light background · Design-system tokens · Mobile-first
   ================================================================= */

/* Background is opt-in via bg modifier (section--alt, section--hero, section--bold).
   Default = white. Position/overflow only set when a modifier needs them — handled
   globally in style.css for .section--hero. */
.hero-section {
    padding: 0 0 var(--space-7);
}
.hero-section > .container {
    position: relative;
    padding-top: var(--space-7);
}

/* --- Grid --- */
.hero__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: center;
}
@media (min-width: 992px) {
    /* Engpass-Breakpoint (992-1199): Content leicht breiter als Bild,
       weil hier Platz knapp ist und der Title sonst gequetscht wirkt. */
    .hero__grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: clamp(2rem, 4vw, 3.5rem);
    }
    .hero__grid.hero__grid--solo {
        grid-template-columns: 1fr;
        max-width: 780px;
    }
    .hero__title { max-width: 18ch; }
    .hero__grid.hero__grid--solo .hero__title { max-width: none; }
}
@media (min-width: 1200px) {
    /* Großer Desktop: Bild darf wieder dominieren, aber dezenter als vorher (1:1.15 statt 1:1.3). */
    .hero__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    }
}

.hero__content { min-width: 0; }

/* --- Label (section_title / eyebrow) --- */
.hero__label {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: color-mix(in oklch, var(--color-primary) 12%, transparent);
    color: var(--color-primary);
    display: inline-block;
    padding: 6px 14px;
    border-radius: calc(var(--border-radius) * 0.8);
    margin-bottom: var(--space-4);
}

/* --- Title --- */
.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.08;
    color: var(--color-text);
    margin: 0 0 var(--space-4);
    text-wrap: balance;
    /* Lange deutsche Composita ("Sehenswuerdigkeiten") sprengen sonst die schmale
       Title-Spalte. hyphens nutzt das lang-Attribut aus <html>;
       overflow-wrap fängt extreme Strings (URLs, fehlende Wörterbuchtrennung) ab. */
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
}

/* --- Rating (editorial position, between title and subtitle) --- */
.hero__rating {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin: 0 0 var(--space-5);
    font-size: 0.95rem;
}
.hero__stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}
.hero__star { color: #f5a623; }
.hero__star--empty { color: var(--color-border, #ddd); }
.hero__rating-score {
    font-weight: 700;
    color: var(--color-text);
}
.hero__rating-source {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

/* --- Subtitle / excerpt --- */
.hero__subtitle {
    font-size: 1.15rem;
    line-height: 1.5;
    color: var(--color-text-body);
    max-width: 58ch;
    margin: 0 0 var(--space-4);
}
.hero__excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-body);
    max-width: 62ch;
    margin: 0 0 var(--space-4);
}
.hero__excerpt-list {
    margin: 0 0 var(--space-4);
    padding-left: 1.2rem;
    max-width: 62ch;
    color: var(--color-text-body);
}
.hero__excerpt-list li { margin-bottom: var(--space-2); }

/* --- Features --- */
.hero__features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 62ch;
}
/* Wenn Features direkt von einem CTA gefolgt werden, schrumpft der Abstand —
   Features beschreiben den Button, sollen visuell zusammengehören. */
.hero__features:has(~ .hero__cta) { margin-bottom: var(--space-4); }
.hero__feature-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--color-text-body);
}
.hero__feature-item svg {
    flex-shrink: 0;
    color: var(--color-primary);
    position: relative;
    top: 0.15em;
    width: 18px;
    height: 18px;
}

/* --- Price --- */
.hero__price-block { min-width: 0; }
.hero__price-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: 0.1rem;
}
.hero__price {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-primary);
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
}
.hero__price-amount { font: inherit; }
.hero__price-unit,
.hero__price small {
    font-size: 0.45em;
    font-weight: 400;
    font-family: var(--font-body);
    color: var(--color-text-muted);
}

/* --- CTA grid: Preis + Buttons in einer Zeile, Rating + Badges darunter.
       Grid-areas erlauben semantische Reihenfolge ohne wrap-Tricks. --- */
.hero__cta {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "price buttons"
        "rating rating"
        "badges badges";
    column-gap: var(--space-5);
    row-gap: var(--space-3);
    align-items: center;
    margin-top: var(--space-4);
}
.hero__cta:not(:has(.hero__price-block, .hero__price-tag)) {
    grid-template-columns: 1fr;
    grid-template-areas:
        "buttons"
        "rating"
        "badges";
}
.hero__price-block { grid-area: price; }
.hero__buttons {
    grid-area: buttons;
    justify-self: start;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}
.hero__cta-rating {
    grid-area: rating;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--color-text-body);
}
.hero__cta-rating .hero__stars { gap: 1px; }
.hero__cta-rating .hero__rating-score { font-weight: 700; color: var(--color-text); }
.hero__cta-rating .hero__rating-source { font-size: 0.85rem; color: var(--color-text-muted); }

/* --- Badges (under CTA) --- */
.hero__badges {
    grid-area: badges;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: 0;
    margin: 0;
}
.hero__badges li {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    background: color-mix(in oklch, var(--color-primary) 10%, transparent);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border-radius: var(--border-radius);
}
.hero__badges li::before { content: "✓"; font-weight: 700; }

/* --- Trust-Bar (Conversion-Garantien unter den CTAs) ---
   Anders als .hero__features (USPs zum Produkt, vertikal gestapelt am Subtitle) sitzt
   .hero__trust direkt unter der CTA, horizontal, dezent, durch border-top abgesetzt. */
.hero__trust {
    list-style: none;
    margin: var(--space-4) 0 0;
    padding: var(--space-4) 0 0;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-5);
    font-size: 0.825rem;
    color: var(--color-text-muted);
}
.hero__trust-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.4;
}
.hero__trust-icon {
    flex-shrink: 0;
    color: var(--color-success);
    width: 14px;
    height: 14px;
}

/* --- Inline Price-Tag (priceStyle = "inline") ---
   Sitzt als kleiner Hinweis NEBEN den Buttons in derselben Grid-Zeile. Spezifitaet
   per doppelter Klasse, damit die :not(:has(...))-Regel oben nicht ueberschreibt. */
.hero__cta.hero__cta--inline-price {
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "buttons price"
        "rating  rating"
        "badges  badges";
    column-gap: var(--space-4);
}
.hero__cta--inline-price .hero__buttons { justify-self: start; }
.hero__cta--inline-price .hero__price-tag {
    grid-area: price;
    justify-self: start;
    align-self: center;
}
.hero__price-tag {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}
.hero__price-tag strong {
    color: var(--color-text);
    font-weight: 600;
    font-size: 1rem;
}
.hero__price-tag-unit { color: var(--color-text-muted); }

/* --- Single image --- */
.hero__figure { margin: 0; position: relative; }
.hero__image-wrap {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* --- KPI-Overlay auf dem Hero-Bild (imageOverlay) ---
   Glasscheiben-Karte unten im .hero__image-wrap. Nur Single-Image, nicht Mosaik.
   Auf Mobile ausgeblendet (Banner ist 120px hoch -> kein Platz fuer lesbare KPIs). */
.hero__overlay {
    position: absolute;
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    background: color-mix(in oklch, var(--color-bg) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: calc(var(--border-radius) * 0.85);
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 4px 24px color-mix(in oklch, var(--color-text) 12%, transparent);
}
.hero__overlay-tile {
    min-width: 0;
    flex: 1;
    text-align: left;
}
.hero__overlay-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-text-muted);
    margin-bottom: 0.1rem;
    line-height: 1.2;
}
.hero__overlay-value {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hero__overlay-divider {
    width: 1px;
    align-self: stretch;
    background: var(--color-border);
    flex-shrink: 0;
}
.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.hero__image-wrap:hover .hero__image { transform: scale(1.03); }
.hero__caption {
    margin-top: var(--space-3);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-muted);
}
.hero__credit {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.hero__credit a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 2px;
}

/* --- Mosaic (3 images) --- */
.hero__mosaic {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--space-2);
    height: clamp(380px, 38vw, 500px);
}
.hero__mosaic-main {
    grid-row: 1 / -1;
    overflow: hidden;
    border-radius: var(--border-radius);
}
.hero__mosaic-tile {
    overflow: hidden;
    border-radius: var(--border-radius);
}
.hero__mosaic-main :is(img, picture),
.hero__mosaic-tile :is(img, picture) {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.hero__mosaic-main:hover img { transform: scale(1.03); }
.hero__mosaic-tile:hover img { transform: scale(1.05); }

/* --- Animations --- */
.hero-anim { opacity: 0; animation: heroFadeUp 0.6s ease forwards; }
.hero-anim--1   { animation-delay: 0.05s; }
.hero-anim--2   { animation-delay: 0.15s; }
.hero-anim--3   { animation-delay: 0.25s; }
.hero-anim--4   { animation-delay: 0.35s; }
.hero-anim--img { animation-delay: 0.15s; animation-name: heroFadeIn; }
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroFadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

/* --- Mobile --- */
@media (max-width: 991.98px) {
    .hero-section { padding: 0 0 var(--space-7); }
    /* Container padding-top kommt nur wenn KEIN Bild oben sitzt (Solo).
       Bei transactional/editorial schiebt das Bild den Inhalt selbst. */
    .hero-section > .container { padding-top: 0; }
    .hero-section--solo > .container { padding-top: var(--space-6); }
    .hero__grid { gap: 0; }

    /* Tiles auf Mobile generell aus — als 110px-Mini-Tiles bringen sie keine Information,
       fressen aber Platz. Hauptbild fuellt die Mosaik-Spur allein. */
    .hero__mosaic-tile { display: none; }
    .hero__mosaic {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        height: auto;
        gap: 0;
    }
    .hero__mosaic-main { grid-column: 1; grid-row: auto; border-radius: 0; }
    .hero__image-wrap { border-radius: 0; }

    /* Variant: transactional (mit CTA-Button) — Bild als kompakter Banner OBEN,
       als visueller Trenner zwischen Nav und Title. Kompakt genug, dass
       Title + Preis + CTA above-the-fold bleiben. Höhe per --hero-img-h pro Page überschreibbar.
       Höhe wird am WRAPPER gesetzt, damit object-fit: cover am <img> greift — height am img
       direkt verträgt sich nicht zuverlässig mit <picture> + intrinsic sizing. */
    .hero-section--transactional .hero__media {
        order: -1;
        margin-inline: calc(var(--container-padding) * -1);
        margin-bottom: var(--space-5);
    }
    .hero-section--transactional .hero__image-wrap,
    .hero-section--transactional .hero__mosaic-main {
        height: var(--hero-img-h, 120px);
    }
    .hero-section--transactional .hero__image,
    .hero-section--transactional .hero__mosaic-main img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        object-position: center 35%;
    }

    /* Variant: editorial (kein Button, Lesemodus) — Bild gross oben fuer Stimmung. */
    .hero-section--editorial .hero__media {
        order: -1;
        margin-inline: calc(var(--container-padding) * -1);
        margin-bottom: var(--space-4);
    }
    .hero-section--editorial .hero__image-wrap,
    .hero-section--editorial .hero__mosaic-main {
        height: var(--hero-img-h, 240px);
    }
    .hero-section--editorial .hero__image,
    .hero-section--editorial .hero__mosaic-main img {
        height: 100%;
        width: 100%;
        object-fit: cover;
        object-position: center 35%;
    }

    /* Typografie + CTA-Stack */
    .hero__title {
        font-size: clamp(1.75rem, 7vw, 2.4rem);
        margin-bottom: var(--space-2);
    }
    .hero__subtitle { font-size: 1rem; margin-bottom: var(--space-3); }
    .hero__excerpt  { font-size: 0.95rem; }
    .hero__features { margin-bottom: var(--space-4); gap: var(--space-2); }
    .hero__feature-item { font-size: 0.875rem; }
    .hero__cta {
        grid-template-columns: 1fr;
        grid-template-areas:
            "price"
            "buttons"
            "rating"
            "badges";
        row-gap: var(--space-3);
    }
    .hero__cta.hero__cta--inline-price {
        grid-template-columns: 1fr;
        grid-template-areas:
            "buttons"
            "price"
            "rating"
            "badges";
        column-gap: 0;
    }
    /* Mobile: Buttons voll-breit (Conversion-Best-Practice). Verhindert auch das
       Text-Wrap-Problem ("Jetzt buchen" auf zwei Zeilen), weil .hero__buttons
       sonst auf Content-Breite schrumpft (justify-self: start). */
    .hero__buttons {
        justify-self: stretch;
        width: 100%;
    }
    .hero__cta .btn {
        flex: 1 1 auto;
        min-width: 0;
        text-align: center;
        justify-content: center;
        white-space: nowrap;
    }
    /* Trust auf Mobile enger und centriert unter den (vollbreiten) Buttons. */
    .hero__trust {
        gap: var(--space-2);
        font-size: 0.8rem;
        margin-top: var(--space-3);
        padding-top: var(--space-3);
    }
    .hero__trust-item { width: 100%; }
    /* KPI-Overlay auf Mobile aus -- Banner ist nur 120px hoch (transactional)
       bzw. 240px (editorial), KPIs werden unleserlich klein. */
    .hero__overlay { display: none; }
}

/* --- Sticky CTA bar --- */
.hero__sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: color-mix(in oklch, var(--color-bg) 95%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 20px color-mix(in oklch, var(--color-text) 8%, transparent);
    transform: translateY(100%);
    transition: transform 0.35s ease;
    pointer-events: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.hero__sticky.is-visible {
    transform: translateY(0);
    pointer-events: auto;
}
.hero__sticky-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}
.hero__sticky-price {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
    line-height: 1.2;
}
.hero__sticky-price-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-body);
}
.hero__sticky-price small {
    font-size: 0.55em;
    font-weight: 400;
    font-family: var(--font-body);
    color: var(--color-text-body);
}
@media (max-width: 991.98px) {
    .hero__sticky-inner {
        gap: var(--space-3);
        padding-top: var(--space-2);
        padding-bottom: var(--space-2);
    }
    .hero__sticky-inner .btn { flex: 1; justify-content: center; text-align: center; }
    .hero__sticky-price { font-size: 1.05rem; display: inline-flex; align-items: baseline; gap: 0.3rem; }
    .hero__sticky-price-label { display: inline; font-size: 0.7rem; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .hero-anim { animation: none !important; opacity: 1 !important; }
    .hero__sticky { transition: none; }
    .hero__image,
    .hero__mosaic-main img,
    .hero__mosaic-tile img { transition: none; }
}
