/* 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 are
 * configurable per element.
 */

.i2t3-carousel { position: relative; --i2t3-carousel-gap: 1rem; padding: 0 4.5rem; }
/* Ohne Nav-Pfeile keinen 4.5rem Pfeil-Platz reservieren -> volle Breite.
   Ein gewünschter Seitenrand kommt vom Band-Layout (z. B. custom_styles). */
.i2t3-carousel--no-nav { padding-inline: 0; }

.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 (<576px): per-mobile items per view. The "1 (+ peek)" preset shows
   one item plus a peek of the next via the --mobile-peek modifier (85% width). */
.i2t3-carousel__slide {
    scroll-snap-align: start;
    flex: 0 0 calc((100% - (var(--i2t3-carousel-per-mobile, 1) - 1) * var(--i2t3-carousel-gap)) / var(--i2t3-carousel-per-mobile, 1));
}
.i2t3-carousel--mobile-peek .i2t3-carousel__slide { flex: 0 0 85%; }
/* Feste Slide-Breite (i2t3_carousel_item_width): so viele wie passen, responsiv. */
.i2t3-carousel--fixed-width .i2t3-carousel__slide { flex: 0 0 var(--i2t3-carousel-itemw, 200px); }

/* Tablet (>=576px): per-tablet items per view */
@media (min-width: 576px) {
    .i2t3-carousel:not(.i2t3-carousel--fixed-width) .i2t3-carousel__slide {
        flex: 0 0 calc((100% - (var(--i2t3-carousel-per-tablet, 2) - 1) * var(--i2t3-carousel-gap)) / var(--i2t3-carousel-per-tablet, 2));
    }
}

/* Desktop (>=992px): per-view (desktop) items per view */
@media (min-width: 992px) {
    .i2t3-carousel:not(.i2t3-carousel--fixed-width) .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);
}
/* Feste Bildflaeche -> alle Kacheln gleich hoch (kein Streck-Versatz, kein
   weisser Rest unten); Bild fuellt sie randlos. Ratio tunebar per CSS-Var. */
.i2t3-carousel__media { aspect-ratio: var(--i2t3-carousel-ratio, 4 / 3); overflow: hidden; }
.i2t3-carousel__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Marquee: kontinuierlicher, nahtloser Endlos-Durchlauf (Inhalt per JS verdoppelt;
   bei -shift = eine volle Kopie sieht es identisch zum Start aus -> kein Sprung). */
.i2t3-carousel--marquee .i2t3-carousel__viewport { overflow: hidden; }
.i2t3-carousel--marquee .i2t3-carousel__track { width: max-content; animation: i2t3-marquee var(--i2t3-marquee-duration, 30s) linear infinite; }
.i2t3-carousel--marquee:hover .i2t3-carousel__track,
.i2t3-carousel--marquee:focus-within .i2t3-carousel__track { animation-play-state: paused; }
@keyframes i2t3-marquee { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--i2t3-marquee-shift, 50%))); } }
.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); }

/* Nav: inside edges, dark squared with transparency (Karma nav-inside-edge nav-dark) */
.i2t3-carousel--nav-inside-edge-dark .i2t3-carousel__nav {
    border-radius: .25rem;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}
.i2t3-carousel--nav-inside-edge-dark .i2t3-carousel__nav:hover { background: rgba(0, 0, 0, .8); }
.i2t3-carousel--nav-inside-edge-dark .i2t3-carousel__nav--prev { left: 0; }
.i2t3-carousel--nav-inside-edge-dark .i2t3-carousel__nav--next { right: 0; }

/* Nav: reveal on hover (arrows slide in from outside the edge) */
.i2t3-carousel--nav-hover .i2t3-carousel__nav {
    opacity: 0;
    transition: opacity .2s ease, left .2s ease, right .2s ease;
}
.i2t3-carousel--nav-hover .i2t3-carousel__nav--prev { left: -3rem; }
.i2t3-carousel--nav-hover .i2t3-carousel__nav--next { right: -3rem; }
.i2t3-carousel--nav-hover:hover .i2t3-carousel__nav { opacity: 1; }
.i2t3-carousel--nav-hover:hover .i2t3-carousel__nav--prev { left: 0; }
.i2t3-carousel--nav-hover:hover .i2t3-carousel__nav--next { right: 0; }

/* Nav: title style — minimal transparent arrows pinned to the top edge
   (Karma show-nav-title). No background, sits above the track. */
.i2t3-carousel--nav-title { padding: 2.75rem 0 0; }
.i2t3-carousel--nav-title .i2t3-carousel__nav {
    top: 0;
    transform: none;
    width: 2rem;
    height: 2rem;
    background: transparent;
    color: var(--i2t3-carousel-accent, var(--i2t3-primary, #0d6efd));
    font-size: 1.6rem;
}
.i2t3-carousel--nav-title .i2t3-carousel__nav:hover { filter: none; opacity: .7; }
.i2t3-carousel--nav-title .i2t3-carousel__nav--prev { left: auto; right: 2rem; }
.i2t3-carousel--nav-title .i2t3-carousel__nav--next { right: 0; }
/* Both-sides variant: prev on the left edge, next on the right edge */
.i2t3-carousel--nav-title-both-sides { padding: 2.75rem 0 0; }
.i2t3-carousel--nav-title-both-sides .i2t3-carousel__nav {
    top: 0;
    transform: none;
    width: 2rem;
    height: 2rem;
    background: transparent;
    color: var(--i2t3-carousel-accent, var(--i2t3-primary, #0d6efd));
    font-size: 1.6rem;
}
.i2t3-carousel--nav-title-both-sides .i2t3-carousel__nav:hover { filter: none; opacity: .7; }
.i2t3-carousel--nav-title-both-sides .i2t3-carousel__nav--prev { left: 0; }
.i2t3-carousel--nav-title-both-sides .i2t3-carousel__nav--next { right: 0; }

/* Nav: big arrows (Karma nav-style-2) — large transparent chevrons, accent on hover */
.i2t3-carousel--nav-big-arrows .i2t3-carousel__nav {
    width: 3.5rem;
    height: 3.5rem;
    background: transparent;
    color: var(--i2t3-carousel-accent, var(--i2t3-primary, #0d6efd));
    font-size: 3rem;
    border-radius: 0;
}
.i2t3-carousel--nav-big-arrows .i2t3-carousel__nav:hover { filter: none; opacity: .65; }

/* Nav: vertical — arrows stacked on the right edge (Karma vertical) */
.i2t3-carousel--nav-vertical .i2t3-carousel__nav { top: auto; transform: none; right: 0; left: auto; }
.i2t3-carousel--nav-vertical .i2t3-carousel__nav--prev { bottom: calc(50% + .3rem); }
.i2t3-carousel--nav-vertical .i2t3-carousel__nav--next { top: calc(50% + .3rem); }

/* 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); }
