.testimonials-block * { box-sizing: border-box; }

.testimonials-block .testimonials-inner {
    display: flex;
    gap: 32px;
    height: min(320px, 40vh);
    height: min(320px, 40dvh);
}

/* =========================
   DESKTOP (33/66)
========================= */
.testimonials-block .testimonials-authors-desktop {
    flex: 0 0 33%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 260px;
}

.testimonials-block .testimonials-authors-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 4px;
}

.testimonials-block .author-tile {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;

    background: #1919360D;
    border-radius: 20px;
    padding: 24px;

    display: flex;
    align-items: center;
    gap: 24px;

    transition: background-color 0.2s ease, color 0.2s ease;
}

.testimonials-block.is-fast-nav .author-tile {
  transition: none;
}

.testimonials-block .author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    object-fit: cover;
    flex: 0 0 72px;
}

.testimonials-block .author-avatar--placeholder {
    background: rgba(44, 53, 66, 0.12);
    display: none;
}

.testimonials-block .author-text {display: flex;flex-direction: column;gap: 8px;}

.testimonials-block .author-name {
    color: var(--wp--preset--color--dark-blue);
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    font-family: var(--wp--preset--font-family--nunito);
}

.testimonials-block .author-company {
    color: var(--wp--preset--color--medium-grey);
    font-size: 16px;
    line-height: 1.2;
    font-family: var(--wp--preset--font-family--nunito);
}

.testimonials-block .author-tile .author-company:empty{display: none;}

.testimonials-block .author-tile.is-active {
    background: var(--wp--preset--color--secondary-color);
}

.testimonials-block .author-tile.is-active .author-name { color: #fff; }
.testimonials-block .author-tile.is-active .author-company { color: var(--wp--preset--color--light-gray); }
.testimonials-block .testimonials-authors-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.testimonials-block .authors-nav-btn {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

.testimonials-block .authors-nav-btn svg { display: block; }

/* =========================
   OPINIA (66%) â€” jedna aktywna opinia
========================= */
.testimonials-block .testimonials-opinions {
    flex: 1 1 66%;
    padding-right: 4px;

    position: relative;
    overflow: hidden;
    min-height: 0;
}

.testimonials-block .testimonial-opinion {
    background: #1919360D;
    padding: 32px 16px 32px 32px;
    border-radius: 40px;

    display: flex;
    flex-direction: column;
    gap: 32px;

    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    overflow: hidden;
}

.testimonials-block.is-fast-nav .testimonial-opinion {
    transition: none;
}

.testimonials-block .testimonial-opinion .opinion-inner{
    display: flex;
    flex-direction: column;
    gap: 32px;
    overflow-y: auto;
    padding-right: 12px;
}

.testimonials-block .testimonial-opinion.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
    display: flex;
}

.testimonials-block .opinion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex: 0 0 auto;
}

.testimonials-block .opinion-author {
    display: flex;
    align-items: center;
    gap: 24px;
}

.testimonials-block .opinion-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    justify-content: space-between;
    height: 100%;
}

.testimonials-block .opinion-flag {
    height: auto;
    display: block;
}

.testimonials-block .opinion-date {
    font-size: 14px;
    color: var(--wp--preset--color--medium-grey);
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.testimonials-block .opinion-realizacja {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    overflow: hidden;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none;

    flex: 0 0 auto;
}

.testimonials-block .opinion-realizacja::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, #2C3542 100%);
}

.testimonials-block .opinion-realizacja .wp-block-button {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
}

.testimonials-block .opinion-mobile-button{
    display: none;
}

.testimonials-block .opinion-content {
    color: var(--wp--preset--color--dark-blue);

    flex: 1 0 auto;
    min-height: 0;
    padding-right: 4px;
}

/* =========================
   MOBILE (<782px)
========================= */
.testimonials-block .testimonials-authors-mobile { display: none; }

@media (max-width: 781px) {
    .testimonials-block .testimonials-inner {
        flex-direction: column;
      gap: 20px;

      height: auto;
      max-height: 820px;

      overflow: visible;
    }

    .testimonials-block .testimonials-authors-desktop { display: none; }
    .testimonials-block .testimonials-authors-mobile { display: block; }

    .testimonials-block .testimonials-opinions {
      overflow: visible;
      max-height: none;
      padding-right: 0;
    }

    .testimonials-block .testimonial-opinion{
        position: relative;
        inset: auto;
        display: none;
        padding: 16px 8px 16px 16px;
        border-radius: 20px;
        gap: 16px;
        max-height: 820px;
    }

    .testimonials-block .testimonial-opinion.is-active{
        display: flex;
    }

    .testimonials-block .testimonial-opinion .opinion-inner{
        gap: 16px;
    }

    .testimonials-block .testimonial-opinion .opinion-inner > *{
        padding-right: 8px;
    }

    .testimonials-block .opinion-author{
        display: none;
    }

    .testimonials-block .opinion-meta{
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        width: 100%;
    }
    .testimonials-block .opinion-date{
        flex-direction: row-reverse;
    }

    .testimonials-block .opinion-realizacja .wp-block-button{
        display: none;
    }

    .testimonials-block .opinion-mobile-button{
        display: block;
    }
    .testimonials-block .opinion-mobile-button a {
         justify-content: center;
    }

    .testimonials-block .opinion-content {
        padding-right: 0;
        max-height: 100%;
    }

    .testimonials-block .author-slide {
        background: var(--wp--preset--color--secondary-color);
        border-radius: 20px;
        padding: 16px 70px;
        display: flex;
        align-items: center;
        gap: 16px;
        min-height: 80px;
    }

    .testimonials-block .author-avatar--mobile {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }

    .testimonials-block .author-name--mobile {
        color: #fff;
        font-size: 14px;
    }

    .testimonials-block .author-company--mobile {
        color: var(--wp--preset--color--light-gray);
        font-size: 12px;
    }
     .testimonials-block .author-company--mobile:empty {
         display: none;
     }

    .testimonials-block .testimonials-authors-swiper {
        position: relative;
    }

    .testimonials-block .testimonials-authors-swiper .swiper-button-prev,
    .testimonials-block .testimonials-authors-swiper .swiper-button-next {
        width: 48px;
        height: 48px;
        margin-top: -24px;
        display: flex;
        align-items: center;
        justify-content: center;
        --swiper-navigation-sides-offset: 8px;
    }

    .testimonials-block .testimonials-authors-swiper .swiper-button-prev::after,
    .testimonials-block .testimonials-authors-swiper .swiper-button-next::after {
        display: none;
    }
}

@media (max-width: 1000px) {
    .testimonials-block .author-avatar {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
    }
}
