/*
 * [starcap_testimonials] — sizes follow the landing page testimonial section
 * in the StarCap CMS Figma file (cards 384 x 508, 24px apart, on a black
 * section built in Elementor).
 */

.starcap-testimonials {
    --starcap-testimonials-card: 384px;
    --starcap-testimonials-height: 508px;
    --starcap-testimonials-gap: 24px;
    --starcap-testimonials-surface: rgba(255, 255, 255, 0.24);
    --starcap-testimonials-muted: rgba(255, 255, 255, 0.64);
    --starcap-testimonials-arrow-offset: -88px;
    --starcap-testimonials-arrow-size: 60px;
    position: relative !important;
    width: 100% !important;
    color: #ffffff !important;
}

.starcap-testimonials,
.starcap-testimonials * {
    box-sizing: border-box !important;
}

/*
 * Elementor's kit styles (e.g. ".elementor-kit-6 button", "blockquote") are
 * more specific than these classes, so every declaration in this file is
 * !important to keep the component looking the same wherever it's placed.
 */
.starcap-testimonials p,
.starcap-testimonials blockquote,
.starcap-testimonials figcaption {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    font-family: inherit !important;
    font-style: normal !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.starcap-testimonials button {
    font-family: inherit !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    min-height: 0 !important;
    box-shadow: none !important;
}

/* Track */

.starcap-testimonials__track {
    display: flex !important;
    gap: var(--starcap-testimonials-gap) !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch;
}

.starcap-testimonials__track::-webkit-scrollbar {
    display: none !important;
}

/* Cards */

.starcap-testimonials__card {
    position: relative !important;
    flex: 0 0 var(--starcap-testimonials-card) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 24px !important;
    height: var(--starcap-testimonials-height) !important;
    margin: 0 !important;
    padding: 24px !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: var(--starcap-testimonials-surface) !important;
    color: #ffffff !important;
    text-align: left !important;
    scroll-snap-align: start !important;
}

.starcap-testimonials__media {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

/* YouTube's hqdefault thumbnail has black bars built in; zoom past them. */
.starcap-testimonials__media--youtube {
    transform: scale(1.34) !important;
}

/* Quote + author (photo, text, admin) */

.starcap-testimonials__quote {
    position: relative !important;
    background: none !important;
}

.starcap-testimonials__quote p {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 13 !important;
    overflow: hidden !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 27px !important;
    color: var(--starcap-testimonials-muted) !important;
}

.starcap-testimonials__author {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    /* Stays at the bottom of the card when there's no caption above it. */
    margin-top: auto !important;
}

.starcap-testimonials__logo {
    flex-shrink: 0 !important;
    width: auto !important;
    height: 24px !important;
}

.starcap-testimonials__avatar {
    flex-shrink: 0 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 4px !important;
    object-fit: cover !important;
}

.starcap-testimonials__avatar--initials {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.16) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    color: #ffffff !important;
}

.starcap-testimonials__author-text {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    font-size: 12px !important;
    line-height: 18px !important;
}

.starcap-testimonials__name {
    color: var(--starcap-testimonials-muted) !important;
}

.starcap-testimonials__label {
    font-weight: 500 !important;
    color: #ffffff !important;
}

/* Photo: the photo fills the card, darkened behind the text. */
.starcap-testimonials__card--photo::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.12) 45%, rgba(0, 0, 0, 0.72) 100%) !important;
}

.starcap-testimonials__card--photo .starcap-testimonials__quote,
.starcap-testimonials__card--photo .starcap-testimonials__author {
    z-index: 2 !important;
}

.starcap-testimonials__card--photo .starcap-testimonials__quote p,
.starcap-testimonials__card--photo .starcap-testimonials__name {
    color: rgba(255, 255, 255, 0.88) !important;
}

/* Video: cover image, heading on top, play button, quote at the bottom. */
.starcap-testimonials__card--video {
    padding: 0 !important;
    background: #1f1f1f !important;
}

/* The whole card is the play button. */
.starcap-testimonials__video-button {
    position: absolute !important;
    inset: 0 !important;
    z-index: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 24px !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 40px 36px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    text-align: center !important;
    /* Elementor's button styles keep text on one line; the quote must wrap. */
    white-space: normal !important;
    cursor: pointer !important;
}

.starcap-testimonials__video-button:hover,
.starcap-testimonials__video-button:focus,
.starcap-testimonials__video-button:active {
    background: transparent !important;
    color: #ffffff !important;
}

.starcap-testimonials__card--video::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    transition: background-color 0.2s ease !important;
}

.starcap-testimonials__card--video:hover::before,
.starcap-testimonials__card--video:focus-within::before {
    background: rgba(0, 0, 0, 0.5) !important;
}

.starcap-testimonials__heading,
.starcap-testimonials__play,
.starcap-testimonials__video-quote {
    position: relative !important;
    z-index: 2 !important;
}

.starcap-testimonials__heading {
    min-height: 24px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 24px !important;
    color: #ffffff !important;
}

.starcap-testimonials__play {
    display: flex !important;
    transition: transform 0.2s ease !important;
}

.starcap-testimonials__card--video:hover .starcap-testimonials__play {
    transform: scale(1.08) !important;
}

.starcap-testimonials__heading,
.starcap-testimonials__video-quote {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
}

.starcap-testimonials__video-quote {
    min-height: 27px !important;
    font-size: 18px !important;
    font-weight: 400 !important;
    line-height: 27px !important;
    color: #ffffff !important;
}

/* Arrows: outside the cards, as in the design. */

.starcap-testimonials__arrow {
    position: absolute !important;
    top: 50% !important;
    z-index: 3 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--starcap-testimonials-arrow-size) !important;
    height: var(--starcap-testimonials-arrow-size) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #111729 !important;
    cursor: pointer !important;
    transform: translateY(-50%) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24) !important;
    transition: opacity 0.2s ease !important;
}

.starcap-testimonials__arrow:hover,
.starcap-testimonials__arrow:focus,
.starcap-testimonials__arrow:active {
    background: #ffffff !important;
    color: #111729 !important;
}

.starcap-testimonials__arrow--prev {
    left: var(--starcap-testimonials-arrow-offset) !important;
}

.starcap-testimonials__arrow--next {
    right: var(--starcap-testimonials-arrow-offset) !important;
}

.starcap-testimonials.is-static .starcap-testimonials__arrow {
    display: none !important;
}

.starcap-testimonials__arrow:focus-visible,
.starcap-testimonials__close:focus-visible {
    outline: 3px solid rgba(1, 254, 145, 0.6) !important;
    outline-offset: 2px !important;
}

.starcap-testimonials__video-button:focus-visible {
    outline: 3px solid rgba(1, 254, 145, 0.6) !important;
    outline-offset: -3px !important;
    border-radius: 16px !important;
}

/* Video popup */

.starcap-testimonials__dialog {
    width: min(960px, calc(100vw - 32px)) !important;
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
}

/* Shorts are vertical; keep them inside the viewport height. */
.starcap-testimonials__dialog.is-short {
    width: min(400px, calc(100vw - 32px), calc((100vh - 120px) * 9 / 16)) !important;
}

.starcap-testimonials__dialog::backdrop {
    background: rgba(0, 0, 0, 0.8) !important;
}

.starcap-testimonials__close {
    display: flex !important;
    margin: 0 0 12px auto !important;
    padding: 4px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    color: #ffffff !important;
    cursor: pointer !important;
}

.starcap-testimonials__close:hover,
.starcap-testimonials__close:focus,
.starcap-testimonials__close:active {
    background: transparent !important;
    color: #ffffff !important;
}

.starcap-testimonials__player {
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #000000 !important;
}

.starcap-testimonials__dialog.is-short .starcap-testimonials__player {
    aspect-ratio: 9 / 16 !important;
}

.starcap-testimonials__player iframe {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
}

/*
 * Narrower screens: arrows follow the Elementor testimonial slider above it.
 * Tablet: just outside the cards, shrinking with the screen.
 * Phone: small arrows overlapping the card edges.
 */

@media (max-width: 1400px) {
    .starcap-testimonials {
        --starcap-testimonials-arrow-offset: -30px;
    }
}

@media (max-width: 1024px) {
    .starcap-testimonials {
        --starcap-testimonials-arrow-size: clamp(40px, 5.5vw, 56px);
        --starcap-testimonials-arrow-offset: calc(4px - var(--starcap-testimonials-arrow-size));
    }

    .starcap-testimonials__arrow svg {
        width: 50% !important;
        height: 50% !important;
    }
}

@media (max-width: 767px) {
    .starcap-testimonials {
        --starcap-testimonials-card: min(320px, 85vw);
        --starcap-testimonials-height: 440px;
        --starcap-testimonials-gap: 16px;
        --starcap-testimonials-arrow-size: 36px;
        --starcap-testimonials-arrow-offset: -12px;
    }

    .starcap-testimonials__quote p,
    .starcap-testimonials__video-quote {
        font-size: 16px !important;
        line-height: 24px !important;
    }
}
