
/* =========================================================
   GSG Testimonials
   Shared styles for grid and slider layouts
   ========================================================= */

/* ---------------------------------------------------------
   1. Shared layout
   --------------------------------------------------------- */

.gsg-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(
        var(--gsg-testimonial-columns, 3),
        minmax(0, 1fr)
    );
    align-items: stretch;
    gap: 24px;
    width: 100%;
    min-width: 0;
}

.gsg-testimonials-grid *,
.gsg-testimonials-slider * {
    box-sizing: border-box;
}

/* Individual testimonial item */

.gsg-testimonial-grid-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: 100%;
}

/* ---------------------------------------------------------
   2. Testimonial card
   --------------------------------------------------------- */

.gsg-testimonial-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 26px;
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 36px 38px;
    background: #fff;
    border-radius: 26px;
    box-shadow: 0 0 11px 0 rgba(0, 0, 0, 0.18);
}

/* Testimonial quotation */

.gsg-testimonial-quote {
    flex: 1 0 auto;
    min-width: 0;
    color: #687995;
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.gsg-testimonial-quote p:last-child {
    margin-bottom: 0;
}

/* Person information */

.gsg-testimonial-person {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
    margin-top: auto;
}

.gsg-testimonial-avatar {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 50%;
}

.gsg-testimonial-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.gsg-testimonial-person-text {
    flex: 1 1 auto;
    min-width: 0;
}

.gsg-testimonial-name {
    color: #111;
    font-size: 17px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.gsg-testimonial-designation {
    color: #555;
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

/* ---------------------------------------------------------
   3. Slider container
   --------------------------------------------------------- */

.gsg-testimonials-slider {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

/*
 * The track has no horizontal padding or gap.
 * This prevents the slide-width calculation from exceeding
 * the available viewport width.
 */

.gsg-testimonials-slider .gsg-testimonials-track {
    display: flex;
    flex-flow: row nowrap;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 24px 0 28px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.gsg-testimonials-slider .gsg-testimonials-track::-webkit-scrollbar {
    display: none;
}

/*
 * JavaScript sets --gsg-visible-columns according to the
 * configured column count and the current responsive width.
 *
 * Each slide occupies exactly 1 / visible-columns of the
 * track width. Padding creates the visual gap between cards.
 */

.gsg-testimonials-slider .gsg-testimonials-track
> .gsg-testimonial-grid-item {
    display: flex;
    flex: 0 0 calc(
        100% / var(--gsg-visible-columns, 3)
    );
    width: calc(
        100% / var(--gsg-visible-columns, 3)
    );
    min-width: 0;
    max-width: none;
    height: auto;
    padding: 0 12px;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* Slider card fills its slide */

.gsg-testimonials-slider .gsg-testimonial-grid-item
> .gsg-testimonial-card {
    display: flex;
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
}

/* ---------------------------------------------------------
   4. Slider navigation controls
   --------------------------------------------------------- */

.gsg-testimonials-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100%;
    margin-top: 4px;
    margin-bottom: 10px;
}

.gsg-testimonials-controls button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Previous and next arrows */

.gsg-testimonials-prev,
.gsg-testimonials-next {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    font-size: 20px;
    line-height: 1;
    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.gsg-testimonials-prev:hover,
.gsg-testimonials-next:hover {
    background: #dff4ff;
}

.gsg-testimonials-prev:focus-visible,
.gsg-testimonials-next:focus-visible {
    outline: 2px solid #65c5df;
    outline-offset: 3px;
}

/* Pagination container */

.gsg-testimonials-dots {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

/* Individual pagination dot */

.gsg-testimonials-dot {
    display: block;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    min-width: 12px;
    min-height: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #d5dce1;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.gsg-testimonials-dot:hover {
    background: #aebdc7;
}

.gsg-testimonials-dot.is-active {
    background: #65c5df;
    transform: scale(1.1);
}

.gsg-testimonials-dot:focus-visible {
    outline: 2px solid #65c5df;
    outline-offset: 3px;
}

/* Respect hidden attribute */

.gsg-testimonials-controls [hidden] {
    display: none !important;
}

/* ---------------------------------------------------------
   5. Tablet layout
   Maximum width: 1024px
   --------------------------------------------------------- */

@media (max-width: 1024px) {
    /* Static grid: two columns */

    .gsg-testimonials-grid:not(.gsg-testimonials-track) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Card appearance */

    .gsg-testimonial-card {
        padding: 28px;
    }

    .gsg-testimonial-quote {
        font-size: 18px;
    }

    .gsg-testimonial-person {
        gap: 16px;
    }

    .gsg-testimonial-avatar {
        width: 78px;
        height: 78px;
    }

    .gsg-testimonial-name {
        font-size: 20px;
    }

    .gsg-testimonial-designation {
        font-size: 16px;
    }

    /* Slider: up to two visible slides */

    .gsg-testimonials-slider .gsg-testimonials-track {
        padding-top: 20px;
        padding-bottom: 26px;
    }

    .gsg-testimonials-slider .gsg-testimonials-track
    > .gsg-testimonial-grid-item {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* ---------------------------------------------------------
   6. Mobile layout
   Maximum width: 767px
   --------------------------------------------------------- */

@media (max-width: 767px) {
    /* Static grid: one column */

    .gsg-testimonials-grid:not(.gsg-testimonials-track) {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    /* Card appearance */

    .gsg-testimonial-card {
        gap: 22px;
        padding: 24px;
        border-radius: 22px;
    }

    .gsg-testimonial-quote {
        font-size: 17px;
        line-height: 1.65;
    }

    .gsg-testimonial-avatar {
        width: 68px;
        height: 68px;
    }

    .gsg-testimonial-name {
        font-size: 19px;
    }

    .gsg-testimonial-designation {
        font-size: 15px;
    }

    /* Slider: one full-width slide */

    .gsg-testimonials-slider .gsg-testimonials-track {
        gap: 0;
        padding: 20px 0 24px;
    }

    .gsg-testimonials-slider .gsg-testimonials-track
    > .gsg-testimonial-grid-item {
        flex: 0 0 100%;
        width: 100%;
        padding: 0 10px;
    }

    /* Compact navigation */

    .gsg-testimonials-controls {
        gap: 12px;
    }

    .gsg-testimonials-prev,
    .gsg-testimonials-next {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .gsg-testimonials-dots {
        gap: 8px;
    }

    .gsg-testimonials-dot {
        width: 10px;
        height: 10px;
        min-width: 10px;
        min-height: 10px;
    }
}

/* ---------------------------------------------------------
   7. Reduced motion accessibility
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .gsg-testimonials-slider .gsg-testimonials-track {
        scroll-behavior: auto;
        scroll-snap-type: x proximity;
    }

    .gsg-testimonials-prev,
    .gsg-testimonials-next,
    .gsg-testimonials-dot {
        transition: none;
    }
}
