/* =============================================================
   HERO SLIDER – hero-slider.css
   Ablegen unter: child-theme/assets/hero-slider.css
   ============================================================= */

/* Volle Breite – Theme-Container aufbrechen */
.tvs-hero-slider {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
    background: #1a1a1a;
    height: 60dvh;
}

/* Track */
.tvs-slider-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Einzelner Slide */
.tvs-slide {
    position: relative;
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

/* Hintergrundbild – kein Overlay */
.tvs-slide__bg {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 50% 50% !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* Overlay: Stärke wird per Inline-Style gesetzt (ACF range 0-80%) */
.tvs-slide__overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Kapsel-Box für Titel/Untertitel/Bilder */
.tvs-slide__content {
    position: absolute;
    top: calc(50% - 4dvh);
    left: 50%;
    transform: translate(-50%, -50%);
    width: fit-content;
    max-width: 88%;
    white-space: nowrap;
    text-align: center;
    z-index: 2;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 40px;
    /* Grosszügiges padding: gibt Text mehr Luft, umschliesst Bilder eng */
    padding: 24px 36px;
    box-sizing: border-box;
}

.tvs-hero-slider .tvs-slide__title {
    font-size: clamp(1.1rem, 2.5vw, 2rem) !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    margin: 0 0 0.2em !important;
    color: #333 !important;
    letter-spacing: 0.02em !important;
    white-space: normal !important;
    min-width: 200px !important;
}

.tvs-slide__subtitle {
    font-family: inherit;
    font-size: clamp(1rem, 1.8vw, 1.8rem);
    margin: 0;
    color: #333;
    font-weight: 500;
    white-space: normal;
}

/* Overlay-Bilder */
.tvs-overlay-images {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 12px;
}

.tvs-overlay-images--one {
    justify-content: center;
}

.tvs-overlay-images--two {
    justify-content: center;
    max-width: calc(88vw - 72px); /* Slider max-width minus padding */
}

.tvs-overlay-images--two .tvs-overlay-img {
    max-width: calc(44vw - 48px);
}

.tvs-overlay-img {
    display: block;
    max-height: 32dvh;
    width: auto;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
}

/* Kapsel-Box: kein Hintergrund wenn Bilder-only Modus */
.tvs-slide__content--no-bg {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* Text unter Bildern bleibt in eigenem Pill */
.tvs-slide__content--no-bg .tvs-slide__text-box {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 40px;
    padding: 12px 32px;
    margin-top: 12px;
}

/* Wenn nur Text vorhanden, kein margin oben nötig */
.tvs-slide__title:first-child {
    margin-top: 0;
}

/* Mobile-only Text: auf Desktop verstecken */
.tvs-bar__mobile-only {
    display: none;
}

/* ---- Zweifarbiger Balken ---- */
.tvs-slide__bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8dvh;
    overflow: hidden;
    z-index: 5;
    display: flex;
    background: #d0102e; /* Rot als Hintergrund – füllt den Spalt nach der Schräge */
}

/* SVG nicht mehr gebraucht */
.tvs-slide__bar svg.tvs-bar__svg {
    display: none;
}

/* Linker blauer Bereich – Schräge via clip-path mit fixen px */
.tvs-bar__left {
    flex: 1;
    background: #1e56b0;
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 2;
    /* 2px oben/unten über Container → verhindert Sub-Pixel-Blitzer */
    margin-top: -1px;
    margin-bottom: -1px;
    /* clip-path angepasst: 54px statt 52px wegen 2px extra Höhe */
    clip-path: polygon(0 0, 100% 0, calc(100% - 54px) 100%, 0 100%);
    margin-right: -26px;
}

.tvs-bar__left-label {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Innerer Wrapper für max-width auf Text */
.tvs-bar__inner {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.tvs-bar__inner > * {
    pointer-events: all;
}

/* Rechter roter Bereich */
.tvs-bar__right {
    flex: 1;
    background: #d0102e;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    z-index: 1;
}

/* Rechts: Text mit Pfeil-Icon, kein Button-Rahmen */
.tvs-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: gap 0.2s;
}

.tvs-bar__btn::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.tvs-bar__btn:hover {
    color: #fff;
    gap: 12px;
}

.tvs-bar__btn:hover::after {
    transform: translateX(3px);
}

.tvs-bar__right-label {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 500;
    white-space: nowrap;
}


/* ---- Split-Ansicht: zwei Bilder nebeneinander ---- */
.tvs-slide__split {
    position: absolute;
    inset: 0;
    display: flex;
}

.tvs-slide__bg--left,
.tvs-slide__bg--right {
    width: 50% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: 50% 50% !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
}
/* Pfeil-Navigation */
.tvs-slider-nav {
    position: absolute;
    top: calc(50% - 26px); /* Pfeil mittig im Bild, nicht im Balken */
    transform: translateY(-50%);
    background: rgba(0,0,0,0.30);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tvs-slider-nav:hover {
    background: rgba(0,0,0,0.60);
}

.tvs-slider-nav--prev { left: 16px; }
.tvs-slider-nav--next { right: 16px; }

/* Responsive */
@media (max-width: 768px) {
    .tvs-hero-slider {
        height: 320px;
    }

    .tvs-slide__content {
        max-width: 85%;
        padding: 14px 24px;
        border-radius: 28px;
    }

    .tvs-slider-nav {
        width: 34px;
        height: 34px;
    }

    /* Bild auf Tablet begrenzen */
    .tvs-overlay-img {
        max-height: 16dvh;
        max-width: none;
    }

    .tvs-overlay-images--two .tvs-overlay-img {
        max-height: 16dvh;
        max-width: calc(40vw - 48px);
    }
}

@media (max-width: 480px) {
    .tvs-hero-slider {
        /* Bildbereich + 2 Balken à 46px = 92px */
        height: 360px;
    }

    /* Vertikale Zentrierung im Bildbereich ohne Balken (2x46px = 92px) */
    .tvs-slide__content {
        top: calc(50% - 46px); /* px bleibt – Mobile hat fixe Höhe */
        width: auto;
        max-width: 85%;
        padding: 12px 20px;
        border-radius: 20px;
        white-space: normal;
    }

    /* Mobile: zwei Balken übereinander, keine Schräge */
    .tvs-slide__bar {
        flex-direction: column;
        height: auto;
    }

    .tvs-bar__left {
        clip-path: none;
        margin-right: 0;
        height: 46px;
        padding: 0 16px;
        flex: none;
    }

    .tvs-bar__right {
        height: 46px;
        padding: 0 16px;
        flex: none;
        justify-content: flex-end;
    }

    /* Mobile-spezifische Text-Divs */
    /* Inner-Wrapper auf Mobile deaktivieren */
    .tvs-bar__inner {
        display: none;
    }

    /* Mobile-only Text einblenden */
    .tvs-bar__mobile-only {
        display: inline-flex;
        align-items: center;
    }

    /* Overlay-Bilder auf Mobile */
    .tvs-overlay-images {
        gap: 10px;
        max-width: 100%;
    }

    .tvs-overlay-img {
        max-height: 22dvh; /* relativ wie Desktop, aber Mobile-angepasst */
        max-width: none;
        width: auto;
        height: auto;
        flex: 0 0 auto;
    }

    /* Zwei Bilder auf Mobile: kleiner damit beide rein passen */
    .tvs-overlay-images--two .tvs-overlay-img {
        max-height: 14dvh;
        max-width: calc(40vw - 24px);
    }
}

/* iPhone quer (landscape): Höhe sehr begrenzt */
@media (max-height: 500px) and (orientation: landscape) {

    .tvs-slide__bar {
        height: 12dvh;
    }

    .tvs-hero-slider {
        height: 40vw;
    }

    .tvs-slide__content {
        top: calc(50% - 5dvh);
        transform: translate(-50%, -50%);
    }

    /* Bild: Slider 40vw minus Balken 12dvh minus Padding x2 */
    .tvs-overlay-img {
        max-height: calc(40vw - 12dvh - 96px);
    }

    .tvs-overlay-images--two .tvs-overlay-img {
        max-height: calc(40vw - 12dvh - 96px);
        max-width: calc(44vw - 48px);
    }
}

/* Safari iOS: URL-Bar Korrektur via env() */
@supports (padding-top: env(safe-area-inset-top)) {
    .tvs-slide__content {
        top: calc(50% - 4dvh + env(safe-area-inset-bottom) / 2);
    }
}

/* Sehr grosse Monitore (Höhe > 900px): Schrift vergrössern */
@media (min-height: 900px) {
    .tvs-bar__left-label,
    .tvs-bar__btn,
    .tvs-bar__right-label {
        font-size: 1.8em;
    }
}
