/* Testimonial Slider - Frontend Styles */

.bs-sec-testimonial-slider {
    padding: 40px 0px 60px 0px;
    color: #FFFFFF;
}

.bs-testimonial-slider--wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.bs-testimonial-slider {
    position: relative;
}

.bs-testimonial-slider--track {
    position: relative;
    width: 100%;
    height: min(40.5vw, 583px);
    overflow: visible;
    display: flex;
    align-items: center;
}

.bs-testimonial-slider--slide {
    height: 100%;
    transition: filter .35s ease, opacity .35s ease, transform .35s ease;
    display: flex;
    align-items: center;
}

.bs-testimonial-slider { overflow: visible; }
.bs-testimonial-slider--track { display: flex; }
.bs-testimonial-slider--slide { flex: 0 0 100%; }
@media (min-width: 1024px) {
    .bs-testimonial-slider--slide { flex-basis: 90%; }
}
@media (min-width: 1440px) {
    .bs-testimonial-slider--slide { flex-basis: 83.8889vw; }
}
.bs-testimonial-slider--slide.active {
    filter: none;
    opacity: 1;
}

.bs-testimonial-slider--slide-content {
    display: grid;
    width: 100%;
    height: 100%;
    align-items: stretch;
    gap: 2%;
}

@media (min-width: 821px) {
    .bs-testimonial-slider--slide-content {
        column-gap: 1.66%;
        grid-template-columns: 35.35% 63%;
    }
}

.bs-testimonial-slider--content {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bs-testimonial-slider--image {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.bs-testimonial-slider--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bs-testimonial-slider--slide:not(.active) .bs-testimonial-slider--image {
    height: 40%;
}
/* Blur the image itself for non-active slides (backdrop-filter does not blur content) */
.bs-testimonial-slider--slide:not(.active) .bs-testimonial-slider--image img {
    filter: blur(5px);
    transform: scale(1.04); 
}
.bs-testimonial-slider--slide.active .bs-testimonial-slider--image img {
    filter: none;
    transform: none;
}

/* Special layout for the immediate next (right) slide while inactive */
.bs-testimonial-slider--slide.active + .bs-testimonial-slider--slide .bs-testimonial-slider--image {
    order: -1;           /* move image to the first (left) column */
    align-self: end; 
    margin-left: 20px;    /* anchor image to bottom of its column */
}
.bs-testimonial-slider--slide.active + .bs-testimonial-slider--slide .bs-testimonial-slider--content {
    order: 2;            /* ensure text is the second (right) column */
}
.bs-testimonial-slider--slide.active + .bs-testimonial-slider--slide .bs-testimonial-slider--label {
    display: none;       /* hide label on the next, inactive slide */
}

.bs-testimonial-slider--label {
    background: var(--benefits-main);
    color: var(--cl-white);
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    width: fit-content;
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
}

.bs-testimonial-slider--text {
    color: var(--cl-main);
    margin-bottom: 12px;
}

.bs-testimonial-slider--author {
    color: var(--cl-main);
}

/* Navigation */
.bs-testimonial-slider--nav {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 10;
}

.bs-testimonial-slider--nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
    position: absolute;
}

.bs-testimonial-slider--nav-btn svg path {
    fill: var(--cl-muted);
}

.bs-testimonial-slider--nav-btn svg rect {
    stroke: var(--cl-muted);
}

.bs-testimonial-slider--nav-btn:hover svg rect {
    stroke: var(--benefits-main);
}
.bs-testimonial-slider--nav-btn:hover svg {
    fill: var(--benefits-main);
}

.bs-testimonial-slider--nav-btn:hover svg path {
    fill: var(--cl-white);
}

.bs-testimonial-slider--nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.bs-testimonial-slider--slide { position: relative; }
.bs-testimonial-slider--slide .bs-testimonial-slider--nav-btn.prev {
    left: -48px;
    right: auto;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}
.bs-testimonial-slider--slide .bs-testimonial-slider--nav-btn.next {
    right: -48px;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

/* Progress Bar */
.bs-testimonial-slider--progress {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cl-white);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.bs-testimonial-slider--progress-bar {
    width: 100%;
    height: 3px;
    background: var(--cl-border-light);
    border-radius: 12px;
    overflow: visible; 
    position: relative;
}

.bs-testimonial-slider--progress-fill {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 12px; 
    background: #BEC0CB;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.bs-testimonial-slider--counter {
    color: var(--cl-main);
}

/* Responsive Design */
@media (max-width: 820px) {
    .bs-sec-testimonial-slider {
        padding: 24px 0;
    }
    
    .bs-testimonial-slider--wrapper {
        max-width: 100%;
        padding: 0px;
    }
    
    .bs-testimonial-slider--track {
        min-height: 520px;
    }

    .bs-testimonial-slider--slide-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .bs-testimonial-slider--image { order: 1; }
    .bs-testimonial-slider--content { order: 2; }


    .bs-testimonial-slider--nav {
        position: static !important; 
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0;
        pointer-events: auto;
        margin-top: 8px;
        z-index: 5
    }
    .bs-testimonial-slider--progress {
        display: none !important; 
    }

    .bs-testimonial-slider--image {
        min-height: 276px; 
        height: auto;
        aspect-ratio: 361 / 276; 
    }
    
    .bs-testimonial-slider--slide {
        padding: 0px 8px;
    }
    
    .bs-testimonial-slider--slide-content {
        gap: 20px;
    }
    
    .bs-testimonial-slider--label {
        border-radius: 8px;
        font-size: 10px;
        top: 8px;
        left: 8px;
    }

    .bs-testimonial-slider--slide:not(.active) .bs-testimonial-slider--image {
        height: 25%;
        min-height: 138px; 
        height: 138px;
    }

    .bs-testimonial-slider--slide:not(.active) .bs-testimonial-slider--content {
        display: none;
    }
    
}

/* Block alignment */
.wp-block-symphony-testimonial-slider.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.wp-block-symphony-testimonial-slider.alignfull {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}
