/* Carousel Section */
.carousel-section {
    padding: 5rem 2rem 0 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.carousel-container {
    position: relative;
    max-width: 1250px;
    /* Increased from 1000px */
    width: 95%;
    /* Responsive width */
    margin: 0 auto;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    /* Subtle relief effect: soft shadow + top highlight */
    box-shadow:
        0 -2px 8px rgba(255, 255, 255, 0.1),
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 8px 40px rgba(0, 0, 0, 0.1);
    /* Make it wider/shorter (Panoramic) to fix "too high" issue */
    aspect-ratio: 21/9;
    max-height: 650px;
    /* Cap the height specifically */
}

/* NEW: Flex track for sliding */
.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    /* Critical for slide transition: don't shrink */
    min-width: 100%;
    flex: 0 0 100%;
    position: relative;
    /* Remove display: none */
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Ensure images fill the slide */
.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Full Width */
    max-width: 100%;
    padding: 6rem 2rem 2rem;
    /* Increased top padding for smoother transition */

    /* Improved Gradient + Blur Effect */
    background: linear-gradient(to top,
            rgba(10, 10, 10, 0.98) 0%,
            rgba(10, 10, 10, 0.8) 30%,
            rgba(10, 10, 10, 0.5) 60%,
            rgba(10, 10, 10, 0.2) 80%,
            transparent 100%);
    backdrop-filter: none !important;
    border-radius: 0 !important;

    color: white;
    text-align: center;
    white-space: normal;

    /* Reset Card Styles */
    transform: none;
    border-radius: 0;
    box-sizing: border-box;
}

.carousel-caption h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    /* Better readability */
}

.carousel-caption p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Navigation Buttons */
.prev,
.next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.prev {
    left: 0;
    /* Align flush left */
    border-radius: 0 3px 3px 0;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Dots - HIDDEN */
.carousel-dots {
    display: none;
}

/* =========================================
   RESPONSIVE: MOBILE LARGE (≤768px)
   Stack the carousel content: Text Above, Image Below
   ========================================= */
@media (max-width: 768px) {
    .carousel-container {
        height: auto !important;
        aspect-ratio: auto !important;
        max-height: none !important;
    }

    .carousel-slide {
        display: block !important;
        position: relative !important;
    }

    .carousel-img {
        height: 250px !important;
        width: 100% !important;
        object-fit: cover !important;
    }

    .carousel-caption {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        /* Darker gradient: almost black at top, fading to transparent */
        background: linear-gradient(to bottom, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.7) 40%, rgba(15, 23, 42, 0) 100%) !important;
        padding: 2rem 1.5rem !important;
        text-align: center;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        backdrop-filter: none !important;
        color: white;

        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        /* Text at top */
        pointer-events: none;
        /* Let clicks pass through */
    }

    .carousel-caption h3 {
        font-size: 1.4rem !important;
        margin-bottom: 0.5rem !important;
    }

    .carousel-caption p {
        font-size: 1rem !important;
    }
}