/* ==========================================================================
   Testimonials + "We Are Verified"  (views/index.hbs, section.trust)

   Left: a navy quote card with a big gold quote mark, the author, and arrows +
   timer bars (same idea as the home slider) - slider logic is initTestimonials()
   in js/script.js. Right: the two credential logos on white cards, each with a
   gold check badge. Both sit on a plain white band.
   ========================================================================== */

.trust {
    --navy: #111d42;
    --navy-deep: #0b1332;
    --gold: #d1a24f;
    --gold-text: #8a6217;       /* gold dark enough to read as text on white */
    --gold-soft: #e6c98f;       /* light gold: readable as small text on navy */
    --tsl-delay: 7s;            /* time each testimonial stays */

    position: relative;
    padding: 100px 0 108px;
    background: #fff;
    font-family: 'Raleway', 'PT Sans', Arial, sans-serif;
}

.trust h2,
.trust blockquote,
.trust figure {
    margin: 0;
}

.trust__grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 56px;
    align-items: start;
}

/* only one of the two columns has content (testimonials API down) */
.trust__grid > .verified:only-child {
    grid-column: 1 / -1;
    max-width: 520px;
    margin: 0 auto;
}


/* --------------------------------------------------------------------------
   Shared heading
   -------------------------------------------------------------------------- */

.trust__head {
    margin-bottom: 34px;
}

.trust__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--gold-text);
}

.trust__eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--gold);
    transform: rotate(45deg);
}

.trust__eyebrow::after {
    content: "";
    width: 48px;
    height: 1px;
    background: var(--gold);
}

.trust__title {
    margin-top: 14px !important;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    line-height: 1.16;
    color: var(--navy);
    text-transform: none;
}


/* --------------------------------------------------------------------------
   Testimonials
   -------------------------------------------------------------------------- */

.tsl__card {
    position: relative;
    overflow: hidden;
    padding: 100px 54px 38px;   /* the top is left for the quote mark */
    border-radius: 8px;
    color: #fff;
    background:
        radial-gradient(520px 260px at 0 0, rgba(209, 162, 79, .18), transparent 65%),
        linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
    box-shadow: 0 28px 60px rgba(17, 29, 66, .22);
}

/* faint lattice in the corner */
.tsl__card::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23d1a24f' stroke-opacity='.2'%3E%3Crect x='18' y='18' width='36' height='36'/%3E%3Crect x='18' y='18' width='36' height='36' transform='rotate(45 36 36)'/%3E%3Cpath d='M0 0l18 18M72 0L54 18M0 72l18-18M72 72L54 54'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-image: linear-gradient(to left, #000, transparent);
    mask-image: linear-gradient(to left, #000, transparent);
    pointer-events: none;
}

.tsl__mark {
    position: absolute;
    top: 6px;
    left: 38px;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 150px;
    font-weight: 800;
    line-height: 1;
    color: var(--gold);
    opacity: .5;
    pointer-events: none;
}

.tsl__card > * {
    position: relative;
}

.tsl__card > .tsl__mark {
    position: absolute;
}

/* all slides share one grid cell, so the card keeps the height of the longest quote */
.tsl__slides {
    display: grid;
}

.tsl__slide {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity .6s ease, visibility 0s linear .6s;
}

.tsl__slide.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity .6s ease;
}

.tsl__quote {
    padding: 0;
    border: 0;
    font-size: 21px;
    font-weight: 500;
    line-height: 1.8;
    color: rgba(255, 255, 255, .94);
    overflow-wrap: anywhere;
}

.tsl__author {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 32px;
}

.tsl__avatar {
    display: block;
    flex: none;
    width: 74px;
    height: 74px;
    border: 3px solid var(--gold);
    border-radius: 50%;
    background: #fff;
    object-fit: cover;          /* the avatars are only 82px wide, so they are not shown larger */
}

.tsl__who {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tsl__name {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

.tsl__role {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold-soft);
}

/* controls: timer bars on the left, arrows on the right */
.tsl__controls {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid rgba(209, 162, 79, .28);
}

.tsl.is-ready .tsl__controls {
    display: flex;
}

.tsl__dots {
    display: flex;
    gap: 8px;
}

.tsl__dot {
    position: relative;
    width: 40px;
    height: 22px;               /* generous tap target; the visible bar is 3px */
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.tsl__dot::before,
.tsl__fill {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 2px;
}

.tsl__dot::before {
    background: rgba(255, 255, 255, .25);
}

.tsl__fill {
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
}

.tsl.is-ready .tsl__dot.is-active .tsl__fill {
    animation: tsl-fill var(--tsl-delay) linear forwards;
}

@keyframes tsl-fill {
    to { transform: scaleX(1); }
}

/* pause the timer while the pointer is over the card or focus is inside it */
.tsl:focus-within .tsl__dot.is-active .tsl__fill {
    animation-play-state: paused;
}

@media (hover: hover) {
    .tsl:hover .tsl__dot.is-active .tsl__fill {
        animation-play-state: paused;
    }
}

.tsl__arrows {
    display: flex;
    gap: 10px;
}

.tsl__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(209, 162, 79, .65);
    border-radius: 50%;
    background: transparent;
    color: var(--gold);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.tsl__arrow:hover,
.tsl__arrow:focus {
    background: var(--gold);
    color: var(--navy-deep);
}

.tsl__dot:focus-visible,
.tsl__arrow:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}


/* --------------------------------------------------------------------------
   Verified
   -------------------------------------------------------------------------- */

.verified__list {
    display: grid;
    gap: 24px;
}

.credential {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 30px;
    border: 1px solid #e8ebf3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(17, 29, 66, .08);
    transition: transform .3s ease, box-shadow .3s ease;
}

.credential img {
    display: block;
    width: 100%;
    max-width: 275px;           /* the logos are 275px wide */
    height: auto;
}

/* gold check badge in the corner: "verified" */
.credential__check {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--navy-deep);
    font-size: 14px;
}

@media (hover: hover) {
    .credential:hover {
        transform: translateY(-4px);
        box-shadow: 0 24px 48px rgba(17, 29, 66, .14);
    }
}


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

@media (max-width: 1199px) {
    .trust__grid {
        gap: 40px;
    }

    .tsl__card {
        padding: 96px 40px 34px;
    }
}

/* Tablet and phone: stacked, centred column. */
@media (max-width: 991px) {
    .trust {
        padding: 76px 0 84px;
    }

    .trust__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 60px;
        max-width: 680px;
        margin: 0 auto;
    }

    .trust__head {
        margin-bottom: 28px;
    }
}

@media (max-width: 575px) {
    .trust {
        padding: 60px 0 68px;
    }

    .tsl__card {
        padding: 78px 24px 28px;
    }

    .tsl__mark {
        top: 6px;
        left: 20px;
        font-size: 110px;
    }

    .tsl__quote {
        font-size: 18px;
        line-height: 1.75;
    }

    .tsl__avatar {
        width: 60px;
        height: 60px;
    }

    .tsl__name {
        font-size: 20px;
    }

    .tsl__role {
        font-size: 11px;
        letter-spacing: .12em;
    }

    .tsl__dot {
        width: 30px;
    }

    .credential {
        padding: 24px 22px;
    }
}

/* Reduced motion: no autoplay timer; testimonials change by hand. */
@media (prefers-reduced-motion: reduce) {
    .tsl.is-ready .tsl__dot.is-active .tsl__fill {
        animation: none;
        transform: scaleX(1);
    }

    .tsl__slide,
    .tsl__slide.is-active,
    .credential {
        transition: none;
    }
}
