/* =========================================
   Testimonials Carousel Component
   ========================================= */

/* ---- Container ---- */

.e2g-testimonials-carousel {
    position: relative;
    color: #fff;
    text-align: center;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(1rem, 3vw, 2rem);
    padding-right: clamp(1rem, 3vw, 2rem);
    box-sizing: border-box;
}

/* ---- No-JS fallback: horizontal scroll list ---- */
/* Replaced by JS with the structured viewport/track below */

.e2g-testimonials-carousel .wp-block-post-template {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    list-style: none;
    margin: 0;
    padding: 0;
}

.e2g-testimonials-carousel .wp-block-post-template > * {
    flex: 0 0 min(100%, 680px);
    scroll-snap-align: start;
}

/* ---- Viewport: clips the sliding track ---- */

.e2g-testimonials-viewport {
    overflow: hidden;
    width: 100%;
    user-select: none;
    transition: height 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Track: flex row of all slides ---- */

.e2g-testimonials-track {
    display: flex;
    align-items: flex-start;
    will-change: transform;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Individual slides ---- */

.e2g-testimonials-slide {
    flex: 0 0 calc(100% / var(--e2g-slides-visible, 1));
    min-width: 0;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* Remove list-item bullet from the WP post element */
.e2g-testimonials-slide li.wp-block-post {
    list-style: none;
}

/* ---- White text for post content and title ---- */

.e2g-testimonials-carousel .wp-block-post-content {
    color: #fff;
    font-size: var(--wp--preset--font-size--base, 1.13rem);
}

.e2g-testimonials-carousel .wp-block-post-content * {
    color: #fff;
}

.e2g-testimonials-carousel .wp-block-post-title {
    color: #fff;
    font-size: var(--wp--preset--font-size--base, 0.875rem);
    font-weight: 600;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* ---- Controls: prev / dots / next ---- */

.e2g-testimonials-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

/* ---- Arrow buttons ---- */

.e2g-testimonials-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.e2g-testimonials-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.e2g-testimonials-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.e2g-testimonials-btn svg {
    display: block;
    pointer-events: none;
}

/* ---- Dot indicators ---- */

.e2g-testimonials-dots {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.e2g-testimonials-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.2s ease, width 0.25s ease;
}

.e2g-testimonials-dot.is-active {
    width: 18px;
    background: #fff;
}

.e2g-testimonials-dot:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
    .e2g-testimonials-slide {
        padding: 0 0.75rem;
    }
}
