/* Carousel — i2t3 component styles
 * Multi-item horizontal carousel: several items visible at once, slide through
 * with arrows/dots/autoplay. Built on native CSS scroll-snap; the small own
 * script adds arrows, dots and autoplay (no third-party library).
 * Style variants, nav styles, center mode, RTL and rounded corners mirror the
 * Karma ns-carousels options.
 */

.i2t3-carousel { position: relative; --i2t3-carousel-gap: 1rem; padding: 0 4.5rem; }

.i2t3-carousel__viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.i2t3-carousel__viewport::-webkit-scrollbar { display: none; }

.i2t3-carousel__track {
    display: flex;
    gap: var(--i2t3-carousel-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Mobile: ~1 item per view with a peek of the next */
.i2t3-carousel__slide { scroll-snap-align: start; flex: 0 0 85%; }

@media (min-width: 768px) {
    .i2t3-carousel__slide {
        flex: 0 0 calc((100% - (var(--i2t3-carousel-per) - 1) * var(--i2t3-carousel-gap)) / var(--i2t3-carousel-per));
    }
}

.i2t3-carousel__card {
    position: relative;
    height: 100%;
    background: var(--i2t3-surface, #fff);
    border-radius: .25rem;
    overflow: hidden;
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .08);
}
.i2t3-carousel__media img { width: 100%; height: auto; display: block; }
.i2t3-carousel__body { padding: 1rem; }
.i2t3-carousel__icon { font-size: 1.75rem; color: var(--i2t3-primary, #0d6efd); margin-bottom: .5rem; }
.i2t3-carousel__title { margin: 0 0 .25rem; }
.i2t3-carousel__subtitle { font-size: .9rem; margin: 0 0 .5rem; }
.i2t3-carousel__rating { color: #f5a623; margin-bottom: .5rem; }
.i2t3-carousel__text > :last-child { margin-bottom: 0; }
.i2t3-carousel__link { display: inline-block; margin-top: .5rem; }

/* --- Rounded corners (enableBorderRadius) --- */
.i2t3-carousel--rounded .i2t3-carousel__card { border-radius: 1rem; }

/* --- Style: shadow --- */
.i2t3-carousel--style-shadow .i2t3-carousel__card { box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .18); border: 0; }

/* --- Style: inside-text (caption over image) --- */
.i2t3-carousel--style-inside-text .i2t3-carousel__body {
    position: absolute;
    inset: auto 0 0 0;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
}
.i2t3-carousel--style-inside-text .i2t3-carousel__subtitle,
.i2t3-carousel--style-inside-text .i2t3-carousel__text { color: rgba(255, 255, 255, .85); }

/* --- Style: fullwidth (one large slide) --- */
.i2t3-carousel--style-fullwidth .i2t3-carousel__slide { flex: 0 0 100%; }

/* --- Style: cta (centered text card) --- */
.i2t3-carousel--style-cta .i2t3-carousel__body { text-align: center; padding: 2rem 1.5rem; }

/* --- Style: center-active (active item emphasised) --- */
.i2t3-carousel--center .i2t3-carousel__viewport { scroll-snap-type: x mandatory; }
.i2t3-carousel--center .i2t3-carousel__slide { scroll-snap-align: center; }
.i2t3-carousel--style-center-active .i2t3-carousel__slide { scroll-snap-align: center; transition: transform .3s ease, opacity .3s ease; }

/* Arrows */
.i2t3-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: var(--i2t3-primary, #0d6efd);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.i2t3-carousel__nav--prev { left: 0; }
.i2t3-carousel__nav--next { right: 0; }
.i2t3-carousel__nav:hover { filter: brightness(.92); }

/* Nav styles */
.i2t3-carousel--nav-rounded .i2t3-carousel__nav { border-radius: .4rem; }
.i2t3-carousel--nav-dark .i2t3-carousel__nav { background: rgba(0, 0, 0, .7); }
.i2t3-carousel--nav-inside .i2t3-carousel__nav--prev { left: 1rem; }
.i2t3-carousel--nav-inside .i2t3-carousel__nav--next { right: 1rem; }
.i2t3-carousel--nav-bottom { padding: 0; }
.i2t3-carousel--nav-bottom .i2t3-carousel__nav { top: auto; bottom: 0; transform: none; }
.i2t3-carousel--nav-bottom .i2t3-carousel__nav--prev { left: calc(50% - 3.25rem); }
.i2t3-carousel--nav-bottom .i2t3-carousel__nav--next { right: calc(50% - 3.25rem); }

/* Dots */
.i2t3-carousel__dots {
    display: flex;
    gap: .4rem;
    justify-content: center;
    margin-top: 1rem;
}
.i2t3-carousel__dot {
    width: .6rem;
    height: .6rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .2);
    cursor: pointer;
}
.i2t3-carousel__dot.is-active { background: var(--i2t3-primary, #0d6efd); }
