/* Testimonial Grid Layout Styles */
.testimonial-cards--grid .testimonial-grid {
    margin-top: 40px;
    padding: 0px 40px;
}

.testimonial-cards--grid .testimonial-grid > [class*="col-"] {
    margin-bottom: 40px;
}

.testimonial-card-grid {
    height: 100%;
}

.testimonial-card-grid-item {
    background: var(--white);
    box-shadow: 0px 3px 15px rgba(1, 22, 39, 0.15);
    border-radius: var(--border-radius);
    padding: 30px 30px 44px;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.testimonial-card-grid-item:after {
    content: "";
    position: absolute;
    left: -8px;
    top: -20px;
    background: url(../../../img/quote-icon.svg) 0 0 no-repeat;
    width: 75px;
    height: 55px;
    background-size: 55px;
}

.testimonial-card-grid-item h5 {
    font-size: 12px;
    font-weight: 900;
    color: var(--dark-blue);
    text-transform: uppercase;
    text-align: right;
    margin: 0;
    font-family: "Raleway", sans-serif;
    letter-spacing: 0.07em;
    position: absolute;
    right: 30px;
    bottom: 15px; /* Reduced from 30px to bring name closer to content */
}

.testimonial-card-grid-item .testimonial-card-slide__description {
    flex: 1;
    margin-bottom: 0px; /* Minimal gap between content and name */
}

/* Remove default paragraph margins within testimonial content */
.testimonial-card-grid-item .testimonial-card-slide__description p {
    margin-bottom: 0 !important;
    line-height: 1.5;
}

.testimonial-card-grid-item .testimonial-card-slide__description p:last-child {
    margin-bottom: 0 !important;
}

/* Clean testimonial scroll styling for grid page */
.testimonial-cards--grid .testimonial-card-slide__description.has-scroll {
    height: 176px !important;
    max-height: 176px !important;
    overflow: hidden !important;
    overflow-y: auto !important; /* Changed to auto so scrollbars only show when needed */
    padding-right: 8px !important;
    margin-right: 2px !important;
    box-sizing: border-box !important;
}

/* Scrollbar styling for testimonial grid */
.testimonial-cards--grid .testimonial-card-slide__description.has-scroll::-webkit-scrollbar {
    width: 8px !important;
    background: #D9E4ED !important;
}

.testimonial-cards--grid .testimonial-card-slide__description.has-scroll::-webkit-scrollbar-track {
    border-radius: 8px !important;
    background-color: #D9E4ED !important;
}

.testimonial-cards--grid .testimonial-card-slide__description.has-scroll::-webkit-scrollbar-thumb {
    border-radius: 8px !important;
    background-color: #364A5B !important;
    border: 1px solid #D9E4ED !important;
}

.testimonial-cards--grid .testimonial-card-slide__description.has-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #2a3a47 !important;
}

/* Grid pagination styles */
.testimonial-cards--grid .blog-listing__pagination {
    margin-top: 0;
}

@media (min-width: 768px) {
    .testimonial-card-grid-item:after {
        left: -17px;
        width: 50px;
        background-size: 50px;
    }

    .testimonial-card-grid-item {
        padding: 55px 33px 49px;
    }

    .testimonial-cards--grid .testimonial-card-slide__description.has-scroll {
        height: 120px;
    }

    .testimonial-card-grid-item h5 {
        font-size: 16px;
        right: 33px;
        bottom: 30px;
    }

    .testimonial-cards--grid .testimonial-grid > [class*="col-"] {
        margin-bottom: 50px;
    }
}

@media (min-width: 1200px) {
    .testimonial-card-grid-item .testimonial-card-slide__description {
        padding: 20px 20px 40px 0;
        margin: 0;
    }

    .testimonial-cards--grid .testimonial-card-slide__description.has-scroll {
        position: relative;
        height: 240px;
        padding-right: 15px;
    }

    .testimonial-cards--grid .testimonial-scroll {
        position: relative;
    }

    .testimonial-cards--grid .testimonial-scroll::before {
        content: "";
        position: absolute;
        width: calc(100% - 30px);
        height: 100px;
        left: 0;
        bottom: 48px;
        z-index: 2;
        background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);
    }

    .testimonial-card-grid-item {
        /* padding: 26px 13px 29px 30px; */
        min-height: 354px;
    }

    .testimonial-card-grid-item h5 {
        bottom: 55px;
        z-index: 4;
    }

    .testimonial-cards--grid .testimonial-grid > [class*="col-"] {
        margin-bottom: 60px;
    }
}