/* RJ WP Projekte – Bilder-Slider (1:1 aus dem bisherigen Kit-CSS übernommen) */
/* =========================================
   2. SLIDER GRUNDGERÜST & SPUREN
   ========================================= */
.custom-slider {
    position: relative;
    width: 100% !important;
    max-width: 100% !important; /* FIX: Verhindert den Scrollbalken auf der gesamten Seite */
    box-sizing: border-box !important;
    overflow: hidden !important; 
}

.custom-slider-track {
    display: flex !important;
    flex-wrap: nowrap !important; /* Zwingt die Bilder strikt nebeneinander */
    align-items: stretch !important;
    overflow-x: auto !important;
    width: 100% !important; 
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    box-sizing: border-box !important;
}

.custom-slider-track::-webkit-scrollbar {
    display: none;
}

.custom-slide {
    min-width: 0 !important; 
    scroll-snap-align: start !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

.custom-slide img {
    width: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block;
    border-radius: 5px 5px 0 0;
}

.custom-slide-caption {
    background: linear-gradient(90deg, #AD0B36 0%, #DA053A 100%);
    color: #ffffff;
    font-family: Arial, sans-serif;
    padding: 15px;
    border-radius: 0 0 5px 5px;
    box-sizing: border-box;
    height: 110px;
    line-height: 26px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis; 
    hyphens: auto;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important; 
}

/* =========================================
   3. BREAKPOINTS FÜR DEN SLIDER (1, 2 oder 3 Spalten)
   ========================================= */

/* --- MOBILE (bis 767px): 1 Spalte --- */
@media (max-width: 767px) {
    .custom-slider { padding: 0 35px !important; }
    .custom-slider-track { gap: 20px !important; }
    .custom-slide {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .custom-slide img { height: 280px !important; }
}

/* --- TABLET HOCHFORMAT (768px bis 1024px): 2 Spalten --- */
@media (min-width: 768px) and (max-width: 1024px) {
    .custom-slider { padding: 0 35px !important; } 
    .custom-slider-track { gap: 30px !important; }
    .custom-slide {
        /* Sichere Rechnung: 100% Breite abzüglich einer Lücke (30px), geteilt durch 2 */
        flex: 0 0 calc((100% - 30px) / 2) !important;
        width: calc((100% - 30px) / 2) !important;
        max-width: calc((100% - 30px) / 2) !important;
    }
    .custom-slide img { height: 300px !important; }
}

/* --- DESKTOP (ab 1025px): 3 Spalten --- */
@media (min-width: 1025px) {
    .custom-slider { padding: 0 40px !important; }
    .custom-slider-track { gap: 60px !important; }
    .custom-slide {
        /* Sichere Rechnung: 100% Breite abzüglich zwei Lücken (120px), geteilt durch 3 */
        flex: 0 0 calc((100% - 120px) / 3) !important;
        width: calc((100% - 120px) / 3) !important;
        max-width: calc((100% - 120px) / 3) !important;
    }
    .custom-slide img { height: 350px !important; }
}

/* =========================================
   4. PFEILE
   ========================================= */
.custom-slider-prev, .custom-slider-next {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #AD0B36 0%, #DA053A 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: auto !important; 
    height: auto !important;
    cursor: pointer;
    font-size: 45px;
    line-height: 1 !important; 
    display: inline-block !important; 
    z-index: 2;
    padding: 0;
    transition: opacity 0.3s ease;
}

.custom-slider-prev { left: 0; padding-left: 5px; }
.custom-slider-next { right: 0; padding-right: 5px; }

.custom-slider-prev:hover, .custom-slider-next:hover { 
    opacity: 0.6; 
    color: #7a082640 !important;
}

.custom-slider-prev.disabled, .custom-slider-next.disabled,
.custom-slider-prev[disabled], .custom-slider-next[disabled] {
    background: #999999 !important; 
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    opacity: 0.3 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}
