/*
 * Testimonials slider (homepage + landing pages).
 * Markup: web/functions/testimonials-lib.php  Behaviour: web/assets/js/wva-testimonials.js
 *
 * Fits fully inside its container (like the gallery slider): the track is
 * clipped to the container width, and the arrows sit in reserved space at the
 * sides on desktop (below the cards on small screens), so no card is ever cut
 * off at the right edge.
 */
.wva-tslider {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 52px 44px;
    margin: 0 auto;
}

.wva-tslider-track.swiper {
    width: 100%;
    overflow: hidden;
    padding: 8px 2px 14px;
    margin: 0;
}

.wva-tslider .swiper-wrapper {
    align-items: stretch;
}

/* Every card in a row is the same height. */
.wva-tslider .swiper-slide {
    height: auto;
    display: flex;
    box-sizing: border-box;
}

.wva-tcard {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 26px 24px 22px;
    box-sizing: border-box;
    background: #fff;
    color: #2d3748;
    border: 1px solid #e6e9ef;
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(15, 32, 67, 0.07);
    text-align: left;
}

.wva-tcard-stars {
    color: #f5a623;
    font-size: 17px;
    letter-spacing: 2px;
    line-height: 1;
    margin-bottom: 14px;
}

.wva-tcard-stars-off {
    color: #d9dde5;
}

/* The theme styles every <blockquote> (background box, padding, icon): reset it here. */
.wva-tslider .wva-tcard .wva-tcard-quote {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-style: normal;
    flex: 0 0 auto;
}

.wva-tslider .wva-tcard .wva-tcard-quote::before,
.wva-tslider .wva-tcard .wva-tcard-quote::after {
    content: none;
    display: none;
}

/* About 6 lines, then "Read more". */
.wva-tcard-text {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.65;
    color: #3c4556;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.wva-tcard.is-expanded .wva-tcard-text {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: none;
    overflow: visible;
}

.wva-tcard-more {
    align-self: flex-start;
    margin: 8px 0 18px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-primary, #1d3a70);
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.wva-tcard-more[hidden] {
    display: none;
}

.wva-tcard-quote {
    margin-bottom: 18px !important;
}

.wva-tcard-quote + .wva-tcard-more:not([hidden]) {
    margin-top: -10px;
}

/* Pinned to the bottom so names line up across a row of cards. */
.wva-tcard-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #eef0f4;
}

.wva-tcard-avatar {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8eefb;
    color: var(--color-primary, #1d3a70);
    font-weight: 700;
    font-size: 15px;
}

.wva-tcard-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wva-tcard-who {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wva-tcard-name {
    font-weight: 700;
    font-size: 16px;
    color: #1a2233;
    line-height: 1.3;
}

.wva-tcard-sub {
    font-size: 13px;
    color: #6b7485;
    line-height: 1.4;
    margin-top: 2px;
}

/* Arrows: inside the reserved side space, vertically centred on the cards. */
.wva-tslider-arrow {
    position: absolute;
    top: calc(50% - 22px);
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #d8dde6;
    background: #fff;
    color: #1d3a70;
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(15, 32, 67, 0.08);
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 2;
}

.wva-tslider-arrow:hover,
.wva-tslider-arrow:focus-visible {
    background: var(--color-primary, #1d3a70);
    color: #fff;
}

.wva-tslider-arrow span {
    margin-top: -3px;
}

.wva-tslider-prev {
    left: 4px;
}

.wva-tslider-next {
    right: 4px;
}

.wva-tslider-arrow.swiper-button-disabled,
.wva-tslider.is-static .wva-tslider-arrow {
    opacity: 0.35;
    cursor: default;
}

.wva-tslider.is-static .wva-tslider-arrow,
.wva-tslider.is-static .wva-tslider-dots {
    display: none;
}

/* Dots: Swiper "dynamic bullets" (a short moving window of dots; Swiper sets
   the container width and each dot's position inline). */
.wva-tslider-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    overflow: hidden;
    font-size: 0;
    line-height: 0;
    text-align: left;
    z-index: 1;
}

.wva-tslider-dots .swiper-pagination-bullet {
    display: inline-block;
    position: relative;
    width: 9px;
    height: 9px;
    margin: 0 4px;
    border-radius: 50%;
    background: #c9d0db;
    opacity: 1;
    transform: scale(0.33);
    transition: transform 0.2s ease, left 0.2s ease, background 0.2s ease;
}

.wva-tslider-dots .swiper-pagination-bullet-active-main,
.wva-tslider-dots .swiper-pagination-bullet-active {
    transform: scale(1);
}

.wva-tslider-dots .swiper-pagination-bullet-active-prev,
.wva-tslider-dots .swiper-pagination-bullet-active-next {
    transform: scale(0.66);
}

.wva-tslider-dots .swiper-pagination-bullet-active {
    background: var(--color-primary, #1d3a70);
}

/* Before the script runs (or without JS): a 3 / 2 / 1 grid, never wider than the container. */
.wva-tslider:not(.is-ready) .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    transform: none !important;
}

.wva-tslider:not(.is-ready) .swiper-slide:nth-child(n + 4) {
    display: none;
}

@media (max-width: 991.98px) {
    .wva-tslider:not(.is-ready) .swiper-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wva-tslider:not(.is-ready) .swiper-slide:nth-child(n + 3) {
        display: none;
    }
}

/* Small screens: full width cards, arrows move below next to the dots. */
@media (max-width: 767.98px) {
    .wva-tslider {
        padding: 0 0 56px;
    }

    .wva-tslider:not(.is-ready) .swiper-wrapper {
        grid-template-columns: minmax(0, 1fr);
    }

    .wva-tslider:not(.is-ready) .swiper-slide:nth-child(n + 2) {
        display: none;
    }

    .wva-tslider-arrow {
        top: auto;
        bottom: 0;
        transform: none;
        width: 36px;
        height: 36px;
    }

    .wva-tslider-prev {
        left: 0;
    }

    .wva-tslider-next {
        right: 0;
    }

    .wva-tslider-dots {
        bottom: 14px;
    }

    .wva-tcard {
        padding: 22px 18px 18px;
    }
}
