/* =========================================================================
   Custom Testimonials – Frontend Styles (unified card design)
   ========================================================================= */

.ct-wrapper { box-sizing: border-box; position: relative; }
.ct-wrapper *,
.ct-wrapper *::before,
.ct-wrapper *::after { box-sizing: border-box; }

/* ---------- Layouts ---------- */
.ct-items { display: grid; gap: 30px; }

.ct-layout-grid.ct-cols-1 .ct-items { grid-template-columns: repeat(1, 1fr); }
.ct-layout-grid.ct-cols-2 .ct-items { grid-template-columns: repeat(2, 1fr); }
.ct-layout-grid.ct-cols-3 .ct-items { grid-template-columns: repeat(3, 1fr); }
.ct-layout-grid.ct-cols-4 .ct-items { grid-template-columns: repeat(4, 1fr); }

.ct-layout-list .ct-items { grid-template-columns: 1fr; }
.ct-layout-list .ct-card { max-width: 100%; }

/* Tablet */
@media (max-width: 1024px) {
    .ct-cols-t-1 .ct-items { grid-template-columns: repeat(1, 1fr) !important; }
    .ct-cols-t-2 .ct-items { grid-template-columns: repeat(2, 1fr) !important; }
    .ct-cols-t-3 .ct-items { grid-template-columns: repeat(3, 1fr) !important; }
    .ct-cols-t-4 .ct-items { grid-template-columns: repeat(4, 1fr) !important; }
}

/* Mobile */
@media (max-width: 600px) {
    .ct-cols-m-1 .ct-items { grid-template-columns: repeat(1, 1fr) !important; }
    .ct-cols-m-2 .ct-items { grid-template-columns: repeat(2, 1fr) !important; }
    .ct-cols-m-3 .ct-items { grid-template-columns: repeat(3, 1fr) !important; }
    .ct-cols-m-4 .ct-items { grid-template-columns: repeat(4, 1fr) !important; }
}

/* =========================================================================
   Unified Card
   ========================================================================= */
.ct-card {
    position: relative;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.04);
    transition: transform .25s ease, box-shadow .25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.ct-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,.09), 0 4px 10px rgba(0,0,0,.05);
}

/* ---------- Media block (top of card) ---------- */
.ct-card-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1a2332;
    overflow: hidden;
    text-decoration: none;
}
.ct-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.ct-card-media::after {
    /* subtle gradient at bottom for play-button contrast & polish */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 55%, rgba(0,0,0,.18) 100%);
    pointer-events: none;
}

/* Video preview hover */
.ct-video-trigger { cursor: pointer; }
.ct-video-trigger:hover img { transform: scale(1.04); }

/* Quote bubble — corner of media for both card types */
.ct-quote-bubble {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff4444;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(255,68,68,.35);
    z-index: 1;
}
.ct-quote-bubble svg { display: block; }

/* Centered play button (video only) */
.ct-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #ff4444;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    transition: transform .2s ease;
    z-index: 1;
}
.ct-play-icon svg { margin-left: 4px; }   /* optically center the triangle */
.ct-video-trigger:hover .ct-play-icon { transform: translate(-50%, -50%) scale(1.08); }

/* ---------- Body ---------- */
.ct-body {
    padding: 24px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.ct-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a2332;
}

.ct-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #ff4444;
    margin-top: -4px;
}

.ct-text {
    color: #666;
    font-size: 15px;
    line-height: 1.65;
    margin: 4px 0 4px;
}
.ct-text p { margin: 0 0 8px; }
.ct-text p:last-child { margin-bottom: 0; }

.ct-meta { margin-top: 4px; }
.ct-name {
    font-weight: 700;
    font-size: 18px;
    color: #1a2332;
    margin-bottom: 2px;
}
.ct-role {
    font-size: 14px;
    color: #888;
}

/* =========================================================================
   List layout (horizontal: media left, body right)
   ========================================================================= */
.ct-layout-list .ct-card {
    flex-direction: row;
    align-items: stretch;
}
.ct-layout-list .ct-card-media {
    width: 38%;
    flex-shrink: 0;
    aspect-ratio: auto;
    min-height: 260px;
}

/* =========================================================================
   Carousel
   ========================================================================= */
.ct-layout-carousel .swiper { padding: 20px 4px 50px; }
.ct-layout-carousel .swiper-pagination { bottom: 10px !important; }
.ct-layout-carousel .swiper-button-prev,
.ct-layout-carousel .swiper-button-next {
    width: 40px; height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    top: 50%;
    transform: translateY(-50%);
}
.ct-layout-carousel .swiper-button-prev::after,
.ct-layout-carousel .swiper-button-next::after {
    font-size: 16px;
    font-weight: 700;
}

/* =========================================================================
   Video lightbox
   ========================================================================= */
.ct-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.85);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ct-lightbox.is-open { display: flex; }
.ct-lightbox-inner {
    width: min(960px, 100%);
    aspect-ratio: 16/9;
    background: #000;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}
.ct-lightbox-inner iframe,
.ct-lightbox-inner video {
    width: 100%; height: 100%; border: 0; display: block;
}
.ct-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    border: 0;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================================================
   Empty state
   ========================================================================= */
.ct-empty {
    padding: 30px;
    text-align: center;
    color: #888;
    background: #f7f7f7;
    border-radius: 10px;
}

/* =========================================================================
   Mobile
   ========================================================================= */
@media (max-width: 600px) {
    .ct-body { padding: 20px 22px 22px; }
    .ct-title { font-size: 20px; }
    .ct-play-icon { width: 56px; height: 56px; }

    /* List layout collapses to stacked on mobile */
    .ct-layout-list .ct-card { flex-direction: column; }
    .ct-layout-list .ct-card-media {
        width: 100%;
        aspect-ratio: 16/9;
        min-height: 0;
    }
}
