/*
 * Block Name: Global Testimonials
 * Description: A continuously scrolling carousel of testimonial cards pulled from Global Options.
 */


/* ============================================================
   SLIDER OUTER WRAPPER
   This element clips the off-screen cards so only 3 are visible
   at any time. overflow: hidden is essential — without it all
   cards would be visible in a long horizontal row.
============================================================ */

.block-global-testimonials .gt-slider-outer {
    overflow: hidden;
    width: 100%;
    position: relative;
}


/* ============================================================
   SLIDER TRACK
   This is the element that moves left/right via CSS transform.
   display: flex puts all slides in a horizontal row.
   The JS sets transition-duration inline during animated steps
   and removes the transition for instant resets (seamless loop).
============================================================ */

.block-global-testimonials .gt-slider-track {
    display: flex;
    /* transition is set/removed by JS - do not define it here */
    will-change: transform; /* hints to the browser to promote to GPU layer */
}


/* ============================================================
   INDIVIDUAL SLIDE
   The JS sets the width of each slide inline based on the outer
   container width divided by 3 (perView). We don't set a width
   here — that would conflict with the JS calculation.
   flex-shrink: 0 stops slides compressing below the JS width.
============================================================ */

.block-global-testimonials .gt-slide {
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 2rem; /* gap between cards */
}


/* ============================================================
   CARD
   The visible card surface inside each slide.
   box-sizing: border-box ensures padding doesn't add extra width.
============================================================ */

.block-global-testimonials .gt-card {
    background: #fff;
    border-radius: 1rem;
    padding: 3rem;
    box-sizing: border-box;
    height: 100%;
}


/* ============================================================
   CARD CONTENT (WYSIWYG OUTPUT)
   The editor controls all visual content inside the card via
   the WYSIWYG field. These rules style the standard HTML elements
   that a WYSIWYG field typically outputs (p, strong, em, etc.)
   so they look consistent across all testimonial cards.
============================================================ */

/* Remove bottom margin from the very last element in the card */
.block-global-testimonials .gt-card-content > *:last-child {
    margin-bottom: 0;
}

/* ============================================================
   EMPTY STATE NOTICE (admin/editor only)
   Shown in the block editor preview when the Global Options
   testimonials repeater has no rows. Never visible on the
   front end.
============================================================ */

.block-global-testimonials .gt-empty-notice {
    padding: 2rem;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 0.5rem;
    font-size: 1.4rem;
    color: #666;
    text-align: center;
}


/* ============================================================
   RESPONSIVE - TABLET
   Drop to 2 cards visible. The JS reads the --gt-per-view CSS
   custom property to know how many slides to show — set it here
   and the JS picks it up automatically via getComputedStyle().
============================================================ */

@media ( max-width: 900px ) {

    .block-global-testimonials .gt-slider-outer {
        --gt-per-view: 2;
    }

    .block-global-testimonials .gt-card {
        padding: 2rem;
    }
}


/* ============================================================
   RESPONSIVE - MOBILE
   Single card at a time.
============================================================ */

@media ( max-width: 550px ) {

    .block-global-testimonials .gt-slider-outer {
        --gt-per-view: 1;
    }

    .block-global-testimonials .gt-card {
        padding: 1.8rem;
    }
}
