/* Auto Carousel Base Styles */
.auto-carousel {
    position: relative;
    margin: 1rem auto !important;
    max-width: 900px;
    border-radius: 8px;
    overflow: hidden;
}

.auto-carousel ul {
    overflow: auto;
    display: flex;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    scroll-snap-points-y: repeat(100%);
    scroll-behavior: smooth;
    background: #1a1a1a;
    -ms-overflow-style: none;
    scrollbar-width: none;
    margin: 0 !important;
    padding: 0;
    cursor: grab;
    user-select: none;
}

.auto-carousel ul.grabbing {
    cursor: grabbing;
    scroll-snap-type: none;
}

.auto-carousel ul::-webkit-scrollbar {
    display: none;
}

/* Default: Full-width slides (mobile/tablet) */
.auto-carousel ul li {
    position: relative;
    min-width: 100%;
    list-style: none;
    background: url() center center / cover no-repeat;
    scroll-snap-align: start;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auto-carousel ul li > img {
    border-radius: 0;
    width: 100%;
    height: auto;
    display: block;
}

.auto-carousel ul li > div {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
}

/* Navigation dots */
.auto-carousel ol {
    position: absolute;
    bottom: 15px;
    display: flex;
    justify-content: center;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9;
    margin: 0 !important;
    padding: 0;
}

.auto-carousel ol li {
    list-style: none;
    padding: 0 5px;
}

.auto-carousel ol li a {
    display: block;
    height: 10px;
    width: 10px;
    border: 2px solid white;
    background: transparent;
    border-radius: 100%;
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.auto-carousel ol li.selected a {
    background: white;
}

/* Arrow navigation */
.auto-carousel .prev,
.auto-carousel .next {
    display: none;
    user-select: none;
    cursor: pointer;
    font-size: 50px;
    color: white;
    position: absolute;
    left: 0;
    padding: 25px 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9;
    line-height: 0;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.auto-carousel .next {
    left: auto;
    right: 0;
}

.auto-carousel .prev:hover,
.auto-carousel .next:hover {
    color: #ddd;
}

/* ===========================================
   PEEK EFFECT: Show prev/next slides at edges
   Only on screens wider than 1200px
   =========================================== */
@media (min-width: 1200px) {
    .auto-carousel {
        max-width: 1100px;
        overflow: visible;
    }

    /* Container for the peek effect */
    .auto-carousel ul {
        padding: 0 10%;
        background: transparent;
    }

    /* Slides take 80% width, showing 10% of prev/next */
    .auto-carousel ul li {
        min-width: 80%;
        scroll-snap-align: center;
        border-radius: 8px;
        overflow: hidden;
        margin: 0 1%;
        box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    }

    /* Dim non-selected slides */
    .auto-carousel ul li {
        opacity: 0.4;
    }

    .auto-carousel ul li.selected {
        opacity: 1;
    }

    /* Adjust arrow positions for peek layout */
    .auto-carousel .prev {
        left: 2%;
    }

    .auto-carousel .next {
        right: 2%;
    }
}

/* Medium screens: subtle peek */
@media (min-width: 992px) and (max-width: 1199px) {
    .auto-carousel {
        max-width: 800px;
    }

    .auto-carousel ul {
        padding: 0 5%;
    }

    .auto-carousel ul li {
        min-width: 90%;
        scroll-snap-align: center;
        margin: 0 0.5%;
        border-radius: 6px;
        overflow: hidden;
    }
}

/* Small screens: no peek, full width slides */
@media (max-width: 991px) {
    .auto-carousel {
        max-width: 100%;
        border-radius: 0;
    }

    .auto-carousel ul li {
        min-width: 100%;
        scroll-snap-align: start;
    }
}

/* ===========================================
   SLIDE LINKS & CAPTIONS
   Two styles: caption-bar and clickable-slide
   =========================================== */

/* Enable pointer events on slides with links */
.auto-carousel ul li:has(a),
.auto-carousel ul li:has(.caption) {
    pointer-events: auto;
}

/* --- STYLE 1: Caption Bar Overlay --- */
.auto-carousel .caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    padding: 2rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
}

.auto-carousel .caption-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.auto-carousel .caption-subtitle {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

.auto-carousel .caption-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--bs-primary, #007bff);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.auto-carousel .caption-btn:hover {
    background: var(--bs-primary-dark, #0056b3);
    transform: translateY(-2px);
    color: white;
}

/* --- STYLE 2: Clickable Slide with Title Overlay --- */
.auto-carousel .slide-link {
    display: block;
    position: relative;
    text-decoration: none;
}

.auto-carousel .slide-link img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.auto-carousel .slide-link:hover img {
    transform: scale(1.02);
}

.auto-carousel .slide-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 3rem 1.5rem 1rem;
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    transition: padding 0.3s ease;
}

.auto-carousel .slide-link:hover .slide-title {
    padding-bottom: 1.25rem;
}

/* Move navigation dots up when captions are present */
.auto-carousel:has(.caption) ol,
.auto-carousel:has(.slide-title) ol {
    bottom: 70px;
}

@media (max-width: 991px) {
    .auto-carousel .caption {
        padding: 1.5rem 1rem 0.75rem;
    }

    .auto-carousel .caption-title {
        font-size: 1rem;
    }

    .auto-carousel .caption-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .auto-carousel .slide-title {
        font-size: 0.95rem;
        padding: 2rem 1rem 0.75rem;
    }

    .auto-carousel:has(.caption) ol,
    .auto-carousel:has(.slide-title) ol {
        bottom: 55px;
    }
}
