/* ===== CAROUSEL MODULE – Base styles ===== */

.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 0px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
}

.carousel-container::before {
    content: '';
    position: absolute;
    inset: 0;
    backdrop-filter: blur(1px);
    pointer-events: none;
    z-index: 0;
}

/* Background layers for crossfade blur */
.carousel-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.7) saturate(0.8);
    transition: opacity 0.8s ease;
    opacity: 0;
}

.carousel-bg-1 {
    opacity: 1;
}

/* Main carousel layer */
.carousel {
    position: relative;
    z-index: 1;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

.carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 0 30px rgba(0,0,0,0.8));
    border-radius: 4px;
}

/* Gradient overlay */
.carousel-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

/* Caption container */
.carousel-caption {
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 0 20px;
    z-index: 3;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.caption-main {
    color: rgba(255, 255, 255, 0.5);
    text-shadow: 0 4px 12px rgba(0,0,0,0.8);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.2;
}

.caption-description {
    color: rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    font-size: 0.6em;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* Keyframe animations */
@keyframes slide-out-left {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-30px); }
}
@keyframes slide-out-right {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(30px); }
}
@keyframes slide-in-left {
    0% { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes slide-in-right {
    0% { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

.carousel-caption.slide-out-left { animation: slide-out-left 0.4s ease forwards; }
.carousel-caption.slide-out-right { animation: slide-out-right 0.4s ease forwards; }
.carousel-caption.slide-in-left { animation: slide-in-left 0.4s ease forwards; }
.carousel-caption.slide-in-right { animation: slide-in-right 0.4s ease forwards; }

/* Navigation buttons – base styles (full height) */
.carousel-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

.carousel-nav button {
    pointer-events: auto;
    position: absolute;
    top: 0;
    height: 100%;                  /* full height for image carousel */
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 48px;
    width: 80px;                   /* base width */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.carousel-nav .carousel-prev {
    left: 0;
}
.carousel-nav .carousel-next {
    right: 0;
}

.carousel-nav button:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: scale(1.1);          /* scale from center */
}

/* ===== VIDEO MODE – activated by adding class "video-carousel" ===== */

.carousel-container.video-carousel {
    padding: 20px 80px;  /* top/bottom padding added */
}

.carousel-container.video-carousel .carousel-nav button {
    top: 50%;
    transform: translateY(-50%);
    height: 100px;                  /* shorter to avoid video controls */
    width: 80px;
}

.carousel-container.video-carousel .carousel-nav .carousel-prev {
    left: 0;
}
.carousel-container.video-carousel .carousel-nav .carousel-next {
    right: 0;
}

.carousel-container.video-carousel .carousel-nav button:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Inactive video slides should not receive pointer events */
.video-carousel .carousel-slide:not(.video-slide-active) {
    pointer-events: none;
}

/* Responsive adjustments for video mode */
@media (max-width: 768px) {
    .carousel-container.video-carousel {
        padding: 15px 60px;
    }
    .carousel-container.video-carousel .carousel-nav button {
        width: 60px;
        height: 80px;
        font-size: 40px;
    }
}