/* ========================================
   CAMPUS CAROUSEL COMPONENT
   Modern, interactive image carousel
   ======================================== */

/* Carousel Section Container */
.campus-carousel-section {
    padding: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.campus-carousel-section:nth-child(even) {
    background-color: var(--color-bg-light);
}

/* Section Header */
.campus-carousel-section .section-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.campus-carousel-section .section-header h2 {
    color: var(--color-primary);
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-md);
    font-weight: var(--font-weight-bold);
}

.campus-carousel-section .section-header p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    max-width: 700px;
    margin: 0 auto;
}

/* Carousel Wrapper */
.carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    /* Reduced from 20px */
}

/* Carousel Track Container - Adjusted for compact layout */
.carousel-track-container {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    /* dynamic height based on width */
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: transform 0.6s ease-in-out;
    height: 100%;
    will-change: transform;
}

/* Carousel Slide */
.carousel-slide {
    position: relative;
    flex-shrink: 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.6s ease-in-out;
    cursor: pointer;
    background: var(--color-bg-white);
}

/* Default slide (hidden) */
.carousel-slide {
    width: 0;
    height: 0;
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
}

/* Previous slide (left) - Slightly smaller for better balance */
.carousel-slide.prev {
    width: 440px;
    height: auto;
    aspect-ratio: 16 / 9;
    opacity: 0.6;
    transform: scale(0.85);
    pointer-events: auto;
    z-index: 5;
}

/* Active slide (center) - Slightly reduced for visial balance */
.carousel-slide.active {
    width: 680px;
    height: auto;
    aspect-ratio: 16 / 9;
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    z-index: 10;
}

/* Next slide (right) - Slightly smaller for better balance */
.carousel-slide.next {
    width: 440px;
    height: auto;
    aspect-ratio: 16 / 9;
    opacity: 0.6;
    transform: scale(0.85);
    pointer-events: auto;
    z-index: 5;
}

/* Slide Image */
.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.4s ease;
    /* Fix image orientation from EXIF data */
    image-orientation: from-image;
    /* Ensure consistent rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.carousel-slide:hover img {
    transform: scale(1.05);
}

/* Gradient Overlay (Active Slide Only) */
.carousel-slide.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top,
            rgba(10, 22, 40, 0.85) 0%,
            rgba(10, 22, 40, 0.5) 40%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Carousel Caption */
.carousel-caption {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 2;
    padding: 0 var(--space-xl);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.carousel-slide.active .carousel-caption {
    opacity: 1;
    transform: translateY(0);
}

.carousel-caption h3 {
    color: white;
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-nav:hover {
    background: #E1D5BF;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-nav i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

.carousel-prev {
    left: -10px;
}

.carousel-next {
    right: -10px;
}

/* Carousel Indicators (Dots) */
.carousel-indicators {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: var(--space-lg);
    /* Reduced margin */
    z-index: 10;
}

.carousel-indicators .indicator {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(10, 22, 40, 0.2);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
}

.carousel-indicators .indicator:hover {
    background: rgba(10, 22, 40, 0.4);
    transform: scale(1.2);
}

.carousel-indicators .indicator.active {
    background: var(--color-primary);
    width: 32px;
    border-radius: 10px;
    transform: none;
    box-shadow: 0 4px 10px rgba(10, 22, 40, 0.2);
}

/* Hover Effects */
.carousel-slide.prev:hover,
.carousel-slide.next:hover {
    opacity: 0.8;
    transform: scale(0.9);
}

/* Loading State */
.carousel-slide.loading {
    background: linear-gradient(90deg,
            #f0f0f0 25%,
            #e0e0e0 50%,
            #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        transition: none;
    }

    .carousel-slide {
        transition: none;
    }

    .carousel-slide img {
        transition: none;
    }

    .carousel-caption {
        transition: none;
    }

    .carousel-nav {
        transition: none;
    }
}