/*
 * Step 14B - customer references carousel.
 * Shared homepage palette; one reference at a time, no database limit.
 * The markup degrades to one readable static reference without JavaScript.
 */

.home-testimonials .home-section-heading {
    position: relative;
    padding-right: 100px;
}

.home-testimonials .home-section-heading::after {
    content: "?";
    position: absolute;
    right: 16px;
    top: 2px;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    color: rgba(10, 153, 122, 0.3);
    background: #e5f7f1;
    font-family: 'Manrope', sans-serif;
    font-size: 45px;
    font-weight: 800;
}

.home-references-carousel {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
}

.home-references-carousel__viewport {
    position: relative;
    padding: 8px 30px 12px;
    touch-action: pan-y;
}

.home-reference,
.home-reference * {
    box-sizing: border-box;
}

.home-reference {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    width: 100%;
    /* Identical outer height for a photo, logo, or both. */
    height: 350px;
    min-height: 0;
    border: 1px solid #dfebf4;
    border-radius: 18px;
    background: linear-gradient(115deg, #f5fbff 0%, #ecf8f4 100%);
    box-shadow: 0 10px 32px rgba(16, 63, 131, .055);
}

/* Always honor hidden, including when the author style sets display:grid. */
.home-reference[hidden] {
    display: none !important;
}

.home-reference__visual {
    grid-area: 1 / 1;
    position: relative;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 55%;
    height: 100%;
    min-height: 0;
    padding: 26px;
    border-radius: 0 17px 17px 0;
    background: linear-gradient(135deg, #deebf8 0%, #d0f0e7 100%);
}

.home-reference__visual--photo {
    padding: 0;
}

.home-reference__photo {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center;
}

/* Logo's staan in een eigen wit vlak. Dit voorkomt dat witte logo's
   verdwijnen in de achtergrond en dat brede logo's worden afgesneden. */
.home-reference__visual--logo {
    justify-content: flex-end;
}

.home-reference__logo-frame {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: min(66%, 330px);
    height: 192px;
    min-width: 0;
    padding: 20px 18px;
    border: 1px solid rgba(219, 230, 242, .9);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 25px rgba(18, 49, 78, .12);
}

.home-reference__logo {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Bij foto + logo blijft het logo in een kleinere witte badge
   in de zichtbare rechterzone, niet onder de citaatkaart. */
.home-reference__visual--both .home-reference__logo-frame {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: min(58%, 250px);
    height: 95px;
    padding: 12px 14px;
    border-radius: 12px;
    box-shadow: 0 6px 17px rgba(18, 49, 78, .18);
}

.home-reference__letter {
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .65);
    color: #159f83;
    font-family: 'Manrope', sans-serif;
    font-size: 52px;
    font-weight: 800;
}

/* White quote card overlaps the photograph, as in the approved concept. */
.home-reference__body {
    grid-area: 1 / 1;
    position: relative;
    z-index: 2;
    justify-self: start;
    display: flex;
    flex-direction: column;
    width: 59%;
    height: calc(100% - 56px);
    min-height: 0;
    margin: 28px 0 28px 28px;
    padding: 26px 30px;
    border: 1px solid #e1eaf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(23, 58, 100, .12);
    /* Legacy citations over 220 characters remain reachable by scrolling.
       Content does not increase the outer slide height. */
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #cbddec transparent;
}

.home-reference__quote-mark {
    display: block;
    height: 30px;
    color: #16a083;
    font-family: Georgia, serif;
    font-size: 58px;
    font-weight: 800;
    line-height: 1;
}

.home-reference blockquote {
    flex: 0 0 auto;
    margin: 9px 0 17px;
    color: #395674;
    font-size: 14px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.home-reference__footer {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: auto;
}

.home-reference__person-name {
    color: #0d3478;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
}

.home-reference__company {
    color: #60758f;
    font-size: 13px;
    line-height: 1.6;
}

.home-references-carousel__arrow {
    position: absolute;
    z-index: 5;
    top: calc(50% - 21px);
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #dde8f3;
    border-radius: 50%;
    background: #fff;
    color: #2456a5;
    box-shadow: 0 5px 18px rgba(19, 67, 112, .11);
    cursor: pointer;
    transition: background-color .2s, transform .2s;
}

.home-references-carousel__arrow:hover {
    background: #f0f7fd;
    transform: translateY(-1px);
}

.home-references-carousel__arrow:focus-visible,
.home-references-carousel__dot:focus-visible {
    outline: 3px solid #159f83;
    outline-offset: 3px;
}

.home-references-carousel__arrow--prev {
    left: 6px;
}

.home-references-carousel__arrow--next {
    right: 6px;
}

.home-references-carousel__arrow svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-references-carousel__navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    min-height: 31px;
    margin-top: 12px;
}

.home-references-carousel__counter {
    color: #647994;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.home-references-carousel__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.home-references-carousel__dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: #c8d9e9;
    cursor: pointer;
    transition: width .2s, background-color .2s;
}

.home-references-carousel__dot.is-active {
    width: 26px;
    background: #159f83;
}

@media (max-width: 767px) {
    .home-testimonials .home-section-heading {
        padding-right: 62px;
    }

    .home-testimonials .home-section-heading::after {
        right: 0;
        width: 50px;
        height: 50px;
        font-size: 32px;
    }

    .home-references-carousel__viewport {
        padding: 6px 8px 12px;
    }

    .home-reference {
        display: flex;
        flex-direction: column;
        height: 510px;
        min-height: 0;
    }

    .home-reference__visual {
        width: 100%;
        height: 210px;
        min-height: 0;
        flex: 0 0 210px;
        border-radius: 17px 17px 0 0;
    }

    .home-reference__photo {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .home-reference__body {
        width: auto;
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
        align-self: stretch;
        margin: -24px 14px 18px;
        padding: 21px 22px;
        overflow-y: auto;
    }

    .home-reference__visual--logo {
        justify-content: center;
    }

    .home-reference__visual--logo .home-reference__logo-frame {
        width: min(82%, 380px);
        height: 145px;
        padding: 16px;
    }

    .home-reference__visual--both .home-reference__logo-frame {
        right: 14px;
        bottom: 38px;
        width: min(58%, 225px);
        height: 75px;
        padding: 9px 12px;
    }

    .home-reference blockquote {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .home-references-carousel__arrow {
        top: 90px;
        width: 42px;
        height: 42px;
    }

    .home-references-carousel__arrow--prev {
        left: -4px;
    }

    .home-references-carousel__arrow--next {
        right: -4px;
    }
}

/* On very small phones, keep the same height for every slide but give
   the quote sufficient reading room. The container can scroll if needed. */
@media (max-width: 390px) {
    .home-reference {
        height: 550px;
    }

    .home-reference__body {
        margin-inline: 11px;
        padding: 18px;
    }

    .home-reference blockquote {
        font-size: 13px;
        line-height: 1.6;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-references-carousel__arrow,
    .home-references-carousel__dot {
        transition: none;
    }
}
