/**
 * Shoptimised Testimonials Carousel
 *
 * Styles for the Flickity-powered testimonial slider on the Feed Optimisation
 * and Incremental Sales pages. Two-column slide (image + quote), pill-style
 * "See more" button on overflowing cards, and a separate modal that mirrors
 * the team-grid modal visually but lives in its own component.
 */

/* Promote the Oxygen code-block container to full-width when it hosts the carousel. */
.ct-code-block:has(> .shop-testimonials) {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
}

/* ---------- Outer wrapper ---------- */

.shop-testimonials {
    background: #F4F7FB;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
    text-align: left;
}
.shop-testimonials *,
.shop-testimonials *::before,
.shop-testimonials *::after { box-sizing: border-box; }

/* ---------- Slide ---------- */

.shop-testimonials__slide {
    position: relative;
    width: 100%;
    height: 380px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15,31,61,0.08);
    overflow: hidden;
}

.shop-testimonials__body {
    position: relative;
    padding: 80px 48px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-width: 0;
}

/* ---------- Decorative quote icon (top-left, full opacity) ---------- */

.shop-testimonials__quote-mark {
    position: absolute;
    top: 24px;
    left: 32px;
    width: 40px;
    height: 40px;
    color: #29B688;
    opacity: 1;
    pointer-events: none;
}

/* ---------- Quote (line-clamped on overflow, ellipsis only) ---------- */

.shop-testimonials__quote {
    position: relative;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 19px;
    line-height: 1.55;
    color: #0F1F3D;
    margin: 0;
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Attribution (pinned to bottom) ---------- */

.shop-testimonials__attribution {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}
.shop-testimonials__primary {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #0F1F3D;
}
.shop-testimonials__secondary {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #5C6B82;
}
.shop-testimonials__secondary:empty::before { content: "\00a0"; }

/* ---------- Footer (custom dots + arrows + counter) ---------- */

.shop-testimonials__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    padding: 0 8px;
}
.shop-testimonials__nav {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #5C6B82;
}
.shop-testimonials__counter { min-width: 36px; text-align: center; }
.shop-testimonials__prev,
.shop-testimonials__next {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #E9EFF6;
    color: #5C6B82;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.shop-testimonials__prev:hover,
.shop-testimonials__prev:focus-visible { background: #B8C4D6; outline: none; }
.shop-testimonials__next {
    background: #29B688;
    color: #fff;
}
.shop-testimonials__next:hover,
.shop-testimonials__next:focus-visible { background: #1E9470; outline: none; }
.shop-testimonials__prev svg,
.shop-testimonials__next svg { width: 14px; height: 14px; }

/* Hide Flickity's default dots/buttons (we render our own). */
.shop-testimonials .flickity-page-dots,
.shop-testimonials .flickity-prev-next-button { display: none; }

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

@media (max-width: 992px) {
    .shop-testimonials__slide { height: auto; }
    .shop-testimonials__body { height: auto; padding: 80px 40px 40px; }
    .shop-testimonials__quote { -webkit-line-clamp: 8; }
}
@media (max-width: 768px) {
    .shop-testimonials__prev,
    .shop-testimonials__next { width: 44px; height: 44px; }
    .shop-testimonials__quote { font-size: 14px; }
}
@media (max-width: 480px) {
    .shop-testimonials__body { padding: 64px 24px 32px; gap: 12px; }
    .shop-testimonials__quote-mark {
        top: 16px;
        left: 16px;
        width: 32px;
        height: 32px;
    }
    .shop-testimonials__quote { -webkit-line-clamp: 10; }
}

/* ============================================================================
 * --grid modifier: 3 cards visible per view (Results page).
 * Shares all base .shop-testimonials__* styles; only the cell width, internal
 * padding, see-more link, and modal are added.
 * ========================================================================= */

.shop-testimonials--grid .shop-testimonials__slide {
    width: calc(33.333% - 16px);
    margin-right: 24px;
}
.shop-testimonials--grid .shop-testimonials__body {
    padding: 80px 32px 40px;
    gap: 12px;
}
.shop-testimonials--grid .shop-testimonials__quote-mark {
    top: 20px;
    left: 24px;
    width: 32px;
    height: 32px;
}
.shop-testimonials--grid .shop-testimonials__quote {
    font-size: 17px;
    -webkit-line-clamp: 5;
}
.shop-testimonials--grid .shop-testimonials__primary { font-size: 16px; }
.shop-testimonials--grid .shop-testimonials__secondary { font-size: 13px; }

@media (max-width: 992px) {
    .shop-testimonials--grid .shop-testimonials__slide {
        width: calc(50% - 12px);
    }
}
@media (max-width: 768px) {
    .shop-testimonials--grid .shop-testimonials__slide {
        width: 100%;
        margin-right: 0;
    }
    .shop-testimonials--grid .shop-testimonials__quote { font-size: 14px; }
}

/* ---------- See-more link (only on overflowing slides) ---------- */

.shop-testimonials__see-more {
    display: none;
    align-self: flex-start;
    align-items: center;
    background: transparent;
    border: 0;
    padding: 0;
    color: #5C6B82;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.18s ease;
}
.shop-testimonials__slide.has-overflow .shop-testimonials__see-more {
    display: inline-flex;
}
.shop-testimonials__see-more:hover,
.shop-testimonials__see-more:focus-visible {
    color: #0F1F3D;
    outline: none;
}

/* ---------- Modal (text-only, single column) ---------- */

.shoptimised-testimonials-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.shoptimised-testimonials-modal[aria-hidden="false"] { display: flex; }

.shoptimised-testimonials-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 24, 54, 0.85);
    animation: shoptimised-testimonials-fade 0.2s ease;
}
.shoptimised-testimonials-modal__panel {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    animation: shoptimised-testimonials-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
    text-align: left;
}
@keyframes shoptimised-testimonials-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes shoptimised-testimonials-pop {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}
.shoptimised-testimonials-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F4F7FB;
    border: none;
    color: #0F1F3D;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.shoptimised-testimonials-modal__close:hover,
.shoptimised-testimonials-modal__close:focus-visible { background: #E9EFF6; outline: none; }
@media (max-width: 768px) {
    .shoptimised-testimonials-modal__close { width: 44px; height: 44px; top: 8px; right: 8px; }
}
.shoptimised-testimonials-modal__body {
    position: relative;
    padding: 64px 40px 32px;
    color: #0F1F3D;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 85vh;
}
.shoptimised-testimonials-modal__quote-mark {
    position: absolute;
    top: 24px;
    left: 32px;
    width: 36px;
    height: 36px;
    color: #29B688;
}
.shoptimised-testimonials-modal__quote {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #0F1F3D;
}
.shoptimised-testimonials-modal__quote p { margin: 0 0 12px; }
.shoptimised-testimonials-modal__quote p:last-child { margin-bottom: 0; }
.shoptimised-testimonials-modal__attribution {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #E9EFF6;
}
.shoptimised-testimonials-modal__primary {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #0F1F3D;
}
.shoptimised-testimonials-modal__secondary {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: #5C6B82;
}
.shoptimised-testimonials-modal__secondary:empty { display: none; }

@media (max-width: 480px) {
    .shoptimised-testimonials-modal__body { padding: 56px 24px 24px; max-height: 90vh; }
    .shoptimised-testimonials-modal__quote-mark { top: 20px; left: 20px; width: 28px; height: 28px; }
}

body.shoptimised-testimonials-modal-open { overflow: hidden; }

/* ============================================================================
 * --employees variant: avatar + name/role row in the attribution.
 * Used on the Careers page; layered on top of --grid.
 * ========================================================================= */

.shop-testimonials--employees .shop-testimonials__attribution {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}
.shop-testimonials--employees .shop-testimonials__attribution-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.shop-testimonials__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: #081836;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    overflow: hidden;
}

/* Modal avatar mirrors the card avatar. */
.shoptimised-testimonials-modal__attribution {
    flex-direction: row;
    align-items: center;
    gap: 14px;
}
.shoptimised-testimonials-modal__attribution-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.shoptimised-testimonials-modal__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: #081836;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    overflow: hidden;
}
.shoptimised-testimonials-modal__avatar:empty { display: none; }
.shoptimised-testimonials-modal__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

