/* 
 * Testimonial Template Styles
 */



/* Grid Section */
.testimonial-grid-section {
    padding: 80px 0;
    background-color: #f9fafb;
    /* Light subtle background for cards to pop */
}

.theme-dark .testimonial-grid-section {
    background-color: var(--thm-black);
}

/* Fallback page content */
.testimonial-page-content {
    padding: 60px 0;
}

/* Override Bootstrap row gutters with our custom gap */
.testimonial-grid-row {
    margin-left: calc(var(--testimonial-gap, 30px) / -2);
    margin-right: calc(var(--testimonial-gap, 30px) / -2);
}

/* Testimonial Cards */
.testimonial-item {
    padding-left: calc(var(--testimonial-gap, 30px) / 2);
    padding-right: calc(var(--testimonial-gap, 30px) / 2);
    padding-bottom: var(--testimonial-gap, 30px);
    margin-bottom: 0;
}

.testimonial-card {
    background: #ffffff;
    border-radius: var(--thm-card-radius, 16px);
    padding: 36px 36px 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.theme-dark .testimonial-card {
    background: var(--thm-gray-rgb);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.testimonial-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(123, 64, 192, 0.15);
}

.theme-dark .testimonial-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

/* Quote Icon Watermark */
.testimonial-card .wt-content {
    position: relative;
    flex-grow: 1;
}

.testimonial-card .icon-quote {
    position: absolute;
    top: -15px;
    right: -10px;
    opacity: 0.05;
    width: 60px;
    pointer-events: none;
}

.theme-dark .testimonial-card .icon-quote {
    opacity: 0.1;
    filter: invert(1);
}

.testimonial-card .icon-quote img {
    width: 100%;
    height: auto;
}

.testimonial-content {
    font-size: 16px;
    line-height: 1.8;
    color: #4b5563;
    font-style: italic;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
}

.theme-dark .testimonial-content {
    color: #9ca3af;
}

/* Client Info Bottom */
.testimonial-card .client-info {
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 20px;
    margin-top: auto;
}

.theme-dark .testimonial-card .client-info {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.testimonial-card .client-thumbnail {
    width: 50px;
    height: 50px;
    margin: 0 15px 0 0;
    flex-shrink: 0;
    /* Removed overflow:hidden to allow badge to overflow */
}

.testimonial-card .client-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--thm-primary);
}

.testimonial-card .client-details {
    display: flex;
    flex-direction: column;
}

.testimonial-card .client-name {
    font-style: normal;
    font-weight: 700;
    font-size: 17px;
    color: #111827;
    margin-bottom: 3px;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.testimonial-verified-badge {
    color: #10b981;
    font-size: 14px;
    margin-left: 6px;
    display: inline-flex;
}

.theme-dark .testimonial-card .client-name {
    color: #f9fafb;
}

.testimonial-card .client-designation {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.4;
}

.theme-dark .testimonial-card .client-designation {
    color: #9ca3af;
}

/* Premium Features: Star Rating */
.testimonial-rating {
    margin-bottom: 15px;
    color: #f59e0b;
    /* Golden stars */
    font-size: 14px;
}

.testimonial-rating i.empty {
    color: #e5e7eb;
}

.theme-dark .testimonial-rating i.empty {
    color: #374151;
}

/* Premium Features: Video Play Button */
.client-thumbnail.has-video {
    position: relative;
    cursor: pointer;
}

.testimonial-video-play {
    position: absolute;
    bottom: -2px;
    right: -5px;
    background: var(--thm-primary);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    padding-left: 2px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid #fff;
}

.theme-dark .testimonial-video-play {
    border-color: var(--thm-gray-rgb);
}

.client-thumbnail.has-video:hover .testimonial-video-play,
.testimonial-video-play:hover {
    background: #000;
    transform: scale(1.15);
    color: #fff;
}

/* Premium Features: Company Link & Logo */
.client-website-link {
    line-height: 1;
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    color: #9ca3af;
    text-decoration: underline;
    letter-spacing: 0.5px;
    text-transform: lowercase;
}

.client-designation a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.client-designation a:hover {
    color: var(--thm-primary);
    text-decoration-color: var(--thm-primary);
}

.theme-dark .client-designation a {
    text-decoration-color: rgba(255, 255, 255, 0.2);
}

.client-company-logo {
    margin-left: auto;
    max-width: 120px;
    max-height: 45px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.client-company-logo img {
    max-width: 80%;
    max-height: 100%;
    object-fit: contain;
    float: right;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.client-company-logo a:hover img {
    opacity: 1;
}

/* Dynamic sizing based on column layouts */
.grid-cols-1 .client-company-logo {
    max-width: 160px;
}

.grid-cols-2 .client-company-logo {
    max-width: 130px;
}

.grid-cols-3 .client-company-logo {
    max-width: 110px;
}

/* Prevent text squeezing in 4-column layout by stacking the logo below info */
.grid-cols-4 .testimonial-card .client-info {
    flex-wrap: wrap;
}

.grid-cols-4 .client-company-logo {
    margin-left: 65px;
    /* Align perfectly with text start (50px thumb + 15px margin) */
    margin-top: 12px;
    max-width: 100px;
    justify-content: flex-start;
}

/* Responsive mobile wrap fallback */
@media (max-width: 767px) {
    .testimonial-card .client-info {
        flex-wrap: wrap;
    }

    .client-company-logo {
        margin-left: 65px !important;
        margin-top: 12px;
        max-width: 100px;
        justify-content: flex-start;
    }
}

/* Masonry adjustments */
.testimonial-masonry-grid {
    /* Prevent flexbox from stretching items to equal heights, which breaks Masonry's vertical calculations */
    align-items: flex-start !important;
    position: relative;
    /* Critical for absolute positioned flex items to calculate correct width% */
}

.testimonial-masonry-grid .testimonial-item {
    margin-bottom: 0;
}

/* Explicit widths for Masonry layout to bypass Bootstrap responsive bugs in Customizer */
@media (min-width: 768px) {
    .testimonial-masonry-grid.grid-cols-2 .testimonial-item {
        width: 50% !important;
    }

    .testimonial-masonry-grid.grid-cols-3 .testimonial-item {
        width: 50% !important;
    }

    .testimonial-masonry-grid.grid-cols-4 .testimonial-item {
        width: 33.333333% !important;
    }
}

@media (min-width: 992px) {
    .testimonial-masonry-grid.grid-cols-3 .testimonial-item {
        width: 33.333333% !important;
    }

    .testimonial-masonry-grid.grid-cols-4 .testimonial-item {
        width: 25% !important;
    }
}

.testimonial-masonry-grid .testimonial-card {
    height: auto;
    margin-bottom: 0;
}

/* ==========================================================================
   Dual Tone Default Overrides (when section has .theme-dark)
   ========================================================================== */
.testimonial-grid-section.theme-dark {
    background-color: var(--thm-black);
}

.testimonial-grid-section.theme-dark .testimonial-card {
    background: var(--thm-gray-rgb);
    border-color: rgba(255, 255, 255, 0.08);
}

.testimonial-grid-section.theme-dark .testimonial-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.testimonial-grid-section.theme-dark .testimonial-card .icon-quote {
    opacity: 0.1;
    filter: invert(1);
}

.testimonial-grid-section.theme-dark .testimonial-content {
    color: #9ca3af;
}

.testimonial-grid-section.theme-dark .testimonial-card .client-info {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.testimonial-grid-section.theme-dark .testimonial-card .client-name {
    color: #f9fafb;
}

.testimonial-grid-section.theme-dark .testimonial-card .client-designation {
    color: #9ca3af;
}

.testimonial-grid-section.theme-dark .testimonial-rating i.empty {
    color: #374151;
}

.testimonial-grid-section.theme-dark .testimonial-video-play {
    border-color: var(--thm-gray-rgb);
}

.testimonial-grid-section.theme-dark .client-designation a {
    text-decoration-color: rgba(255, 255, 255, 0.2);
}