/* =============================================================
   1. CONTAINER BASIS
   ============================================================= */
.ko-slider-container {
    background: var(--button, #222);
    position: relative !important;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 30px auto;
    padding: 0;
    display: block;
    box-sizing: border-box;
    clear: both;
}

/* Mega-Slider: 100vw Breite */
.ko-slider-container.mega-slider {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* =============================================================
   2. BILD-SKALIERUNG & HÖHENBEGRENZUNG
   ============================================================= */
.ko-slider-container img {
    display: block !important;
    padding: 0 !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    max-width: 1920px !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

/* STANDARD (Mega ist NICHT aktiv): Max. 60vh Höhe */
.ko-slider-container:not(.mega-slider) img {
    max-height: 60vh !important;
}

/* MEGA AKTIV: Volle Bildschirmhöhe abzüglich Header */
.ko-slider-container.mega-slider img {
    max-height: calc(90dvh - var(--header-height, 70px)) !important;
}

/* =============================================================
   3. RESPONSIVESLIDES.JS
   ============================================================= */
ul.ko-rslides-slider, ul.rslides {
    position: relative;
    list-style: none !important;
    overflow: hidden;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

ul.ko-rslides-slider li, ul.rslides li {
    position: absolute !important;
    display: none;
    width: 100% !important;
    left: 0 !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.ko-rslides-slider li:first-child, ul.rslides li:first-child {
    position: relative !important;
    display: block !important;
    float: left !important;
}

/* =============================================================
   4. SWIPE.JS
   ============================================================= */
.ko-swipe-slider {
    overflow: hidden;
    position: relative;
    width: 100%;
    visibility: visible !important;
}

.ko-swipe-slider .swipe-wrap {
    overflow: hidden;
    position: relative;
}

.ko-swipe-slider .swipe-wrap > div {
    float: left;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

/* =============================================================
   5. NAVIGATIONSPFEILE
   ============================================================= */
.rslides_nav,
.ko-swipe-nav {
    position: absolute !important;
    z-index: 50 !important;
    color: #fff !important;
    background: rgba(0, 0, 0, 0.55) !important;
    text-decoration: none !important;
    line-height: 1 !important;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.rslides_nav:hover,
.ko-swipe-nav:hover {
    background: rgba(0, 0, 0, 0.85) !important;
    color: #fff !important;
}

.rslides_nav.prev, .ko-swipe-nav.prev { left: 15px !important; }
.rslides_nav.next, .ko-swipe-nav.next { right: 15px !important; }

/* =============================================================
   6. CAPTION & PFEILE: DESKTOP (>= 992px)
   Schwebendes Overlay ÜBER dem Bild
   ============================================================= */
@media screen and (min-width: 992px) {
    .ko-slider-caption {
        position: absolute !important;
        bottom: 30px !important;
        left: 30px !important;
        right: auto !important; /* Hebt das Aufspannen nach rechts auf */
        width: auto !important;
        max-width: min(900px, calc(100% - 60px)) !important; /* Begrenzt auf max. 580px (oder deinen Wunschwert) */
        text-align: left !important; /* Stellt linksbündigen Text sicher */
        background: rgba(0, 0, 0, 0.5) !important;
        -webkit-backdrop-filter: blur(3px);
        backdrop-filter: blur(3px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px !important;
        padding: clamp(10px, 2.0vw, 25px) !important;
        z-index: 40 !important;
        box-sizing: border-box;
    }

    .rslides_nav,
    .ko-swipe-nav {
        top: 50% !important;
        transform: translateY(-50%) !important;
        padding: 8px 16px !important;
        font-size: 30px !important;
    }
}

/* =============================================================
   7. CAPTION & PFEILE: MOBIL & TABLET (< 992px)
   Solide Box UNTER dem Bild
   ============================================================= */
@media screen and (max-width: 991px) {
    .ko-slider-caption {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        background: var(--button, #222) !important;
        border-radius: 0 0 6px 6px !important;
        padding: clamp(14px, 3vw, 22px) !important;
        box-sizing: border-box;
        z-index: 10 !important;
        clear: both;
    }

    .rslides_nav,
    .ko-swipe-nav {
        top: 35% !important;
        transform: translateY(-50%) !important;
        padding: 6px 12px !important;
        font-size: 24px !important;
    }
}

/* =============================================================
   8. FLUIDE TYPOGRAFIE & BUTTONS
   ============================================================= */
.ko-slider-title {
    margin: 0 0 8px 0 !important;
    color: #ffffff !important;
    font-weight: 700;
    line-height: 1.25;
    font-size: clamp(1.2rem, 1.8vw + 0.6rem, 2.2rem) !important;
}

.big .ko-slider-title {
    font-size: clamp(2.05rem, calc(1.68rem + 1.85vw), 2.80rem); !important;
}

.ko-slider-desc {
    color: #e2e8f0;
    line-height: 1.5;
    font-size: clamp(0.9rem, 0.8vw + 0.6rem, 1.15rem) !important;
}

.ko-slider-desc p {
    margin: 0 0 10px 0;
    color: inherit;
}

.big .ko-slider-desc {
    font-size: clamp(1rem, 1vw + 0.7rem, 1.35rem) !important;
}

.ko-slider-btn {
    display: inline-block;
    margin-top: 10px;
    padding: clamp(8px, 0.8vw + 4px, 12px) clamp(16px, 1.2vw + 10px, 24px);
    background: #0073aa;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-weight: 600;
    font-size: clamp(0.85rem, 0.4vw + 0.75rem, 1rem);
    transition: background 0.2s ease;
}

.ko-slider-btn:hover {
    background: #005177;
    color: #ffffff !important;
}
