/* --- Responsive Carousel Columns --- */

/* Default for mobile (1 column) */
.wp-block-broadplace-testimonials-carousel.layout-carousel .testimonial-slide {
    flex: 0 0 99%;
}

/* For 2 columns on medium screens (e.g., tablets) */
@media (min-width: 768px) {
    /* If user set 2, 3, or 4 columns, show 2 on tablet */
    .wp-block-broadplace-testimonials-carousel.layout-carousel[data-columns-to-show="2"] .testimonial-slide,
    .wp-block-broadplace-testimonials-carousel.layout-carousel[data-columns-to-show="3"] .testimonial-slide,
    .wp-block-broadplace-testimonials-carousel.layout-carousel[data-columns-to-show="4"] .testimonial-slide {
        flex: 0 0 49%; /* 2 columns */
    }
}

/* For 3 columns on larger screens (e.g., desktops) */
@media (min-width: 1024px) {
    /* If user set 3 or 4 columns, show 3 on desktop */
    .wp-block-broadplace-testimonials-carousel.layout-carousel[data-columns-to-show="3"] .testimonial-slide,
    .wp-block-broadplace-testimonials-carousel.layout-carousel[data-columns-to-show="4"] .testimonial-slide {
        flex: 0 0 calc(98% / 3); /* 3 columns */
    }
}

/* For 4 columns on even larger screens (if desired and set by user) */
@media (min-width: 1200px) {
    /* If user set 4 columns, show 4 on large desktop */
    .wp-block-broadplace-testimonials-carousel.layout-carousel[data-columns-to-show="4"] .testimonial-slide {
        flex: 0 0 24%; /* 4 columns */
    }
}

/* --- Existing CSS (add the above to the top or appropriate section) --- */

/* Removed .wp-block-broadplace-testimonials-carousel padding and background */
.wp-block-broadplace-testimonials-carousel {
    height: 100%;
    /* padding: var(--wp--preset--spacing--xl, 4rem) 0; */
    /* background: var(--wp--preset--color--background-light, #f8f9fa); */
}

.testimonials-heading {
    text-align: center; /* Changed from center */
    margin: 0; /* Auto margins to center block, not text */
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--wp--preset--color--text-primary, #333);
    padding: 0 1rem; /* Added padding for smaller screens if block is wide/full */

    margin-bottom: 15px;  /* Robust Changes */

}

/* Carousel Container */
.testimonials-container {
    position: relative;
    overflow: hidden;
    max-width: var(--container-max-width);
    height: 100%;
    margin: 0 auto;
    /* No padding here, arrows will be positioned relative to this container */
    /* padding-bottom: 70px; */ /* Space for bottom-positioned arrows and dots */
}

.testimonials-track {
    display: flex;
    gap: 10px;
    transition: transform 0.5s ease;
    height: 100%;
}

/* .testimonial-slide is now controlled by media queries above */
/* Removed:
.testimonial-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
}
*/

/* Testimonial Content */
.testimonial-content {
    /* background: linear-gradient(135deg, #4fd1c7 0%, #1a4f5c 50%, #e91e63 100%);  Default gradient */
    background: linear-gradient(154deg, #000408 0%, #000130 40%, #01bb76 100%);
    color: white;
    height: 100%;
    padding: 3rem 2.5rem; /* Increased padding for "big and sparse" */
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    text-align: left; /* Changed from center */
    margin: 0; /* Reset blockquote margin */
    display: flex; /* Added flex for "sparse" layout */
    flex-direction: column;
    justify-content: flex-end; /* Pushes content and footer apart */
    min-height: 350px; /* Ensure cards are "big" */
}

.testimonial-rating {
    margin-bottom: 0;
    text-align: left; /* Ensure stars are left aligned */
}

.stars {
    color: #ffc107;
    font-size: 1.5rem;
    letter-spacing: 2px;
    display: inline-block; /* To allow text-align on parent */
}

.testimonial-text {
    margin-bottom: 0; /* Reduced margin, as footer will be pushed to bottom */
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    position: relative;
    padding: 0.5rem 0;
    text-align: left; /* Changed from center */
    /* flex-grow: 1; */ /* Allow text to take available space */
}

.testimonial-text p{
    font-size: 1rem;
    margin: 0;
}

/* .testimonial-text::before,
.testimonial-text::after {
    content: '"';
    font-size: 3rem;
    line-height: 0;
    position: relative;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.8;
}

.testimonial-text::before {
    left: -0.5rem;
    top: 1rem;
}

.testimonial-text::after {
    right: -0.5rem;
    bottom: -1rem;
} */

.testimonial-footer {
    margin-top: 0rem;
    align-self: flex-start; /* Ensure footer itself aligns left */
}

.testimonial-author {
    /* display: flex; */
    /* flex-direction: column; */
    align-items: flex-start; /* Changed from center */
    gap: 0.25rem;
    font-style: normal;

}

.testimonial-author strong {
    font-size: 1rem;
    color: white;
    font-weight: 700;
    display: block;
}

.author-position {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.author-company {
    font-size: 1.225rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Carousel Controls - Repositioned to bottom-right of the container */
.carousel-arrow {
    position: absolute;
    bottom: 15px; /* Distance from bottom */
    background: transparent;
    color: white;
    font-size: 25px;
    font-weight: 900;
    outline: none !important;
    border: none;
    /* border-radius: 50%; */
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
    z-index: 10; /* Ensure they are above other content */
    transform: none; /* Remove translateY */
}

/* .carousel-arrow:hover {
    background: var(--wp--preset--color--primary, #e91e63);
    color: white;
} */

/* .carousel-arrow svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
} */

.carousel-arrow.prev {
    right: 78px; /* Position to the left of the next button */
    left: auto; /* Remove left positioning */
}

.carousel-arrow.next {
    right: 30px; /* Position from the right edge of container */
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    position: absolute; /* Position dots within the container */
    bottom: 20px; /* Align with arrows */
    left: 50%;
    transform: translateX(-50%);
    width: fit-content;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--wp--preset--color--border-light, #e0e0e0);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.dot.active {
    background: var(--wp--preset--color--primary, #e91e63);
    width: 30px;
    border-radius: 5px;
}

/* Grid/List Layouts - Ensure consistent styling */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.testimonials-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0 1rem;
}

.testimonials-grid .testimonial-item,
.testimonials-list .testimonial-item {
    background: linear-gradient(135deg, #4fd1c7 0%, #1a4f5c 50%, #e91e63 100%); /* Default gradient */
    color: white;
    padding: 3rem 2.5rem; /* Consistent with carousel */
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 350px;
}

.testimonials-grid .testimonial-item .testimonial-rating,
.testimonials-list .testimonial-item .testimonial-rating {
    text-align: left;
}

.testimonials-grid .testimonial-item .testimonial-text,
.testimonials-list .testimonial-item .testimonial-text {
    text-align: left;
}

.testimonials-grid .testimonial-item .testimonial-author,
.testimonials-list .testimonial-item .testimonial-author {
    align-items: flex-start;
}

/* Mobile styles */
@media (max-width: 782px) {
    .testimonials-heading {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .testimonial-content {
        padding: 2rem 1.5rem; /* Adjusted padding */
        /* min-height: 300px; */
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    .carousel-arrow {
        width: 40px;
        height: 40px;
        bottom: 10px; /* Adjust for smaller screens */
    }    

    .carousel-dots {
        bottom: 10px; /* Align with arrows on mobile */
    }

    .testimonials-grid {
        gap: 1.5rem;
    }

    .testimonials-grid .testimonial-item,
    .testimonials-list .testimonial-item {
        padding: 2rem 1.5rem;
        min-height: 300px;
    }
}
