/*--------------------------------------------------------------
# Block contents
--------------------------------------------------------------*/
.lp-service-review-carousel {
    display: flex;
    padding-block: var(--margin-vertical-wider);
    padding-inline: 4vw;
}

.lp-service-review-carousel .block-contents {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1240px;
    margin-inline: auto;
}

.lp-service-review-carousel__intro {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

/* Header + hr group sized to the heading so the hr centers under it */
.lp-service-review-carousel__heading-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0.75rem;
}

.lp-service-review-carousel__hr {
    width: 80px;
    height: 5px;
    border: none;
    border-radius: 2px;
    background-color: var(--color-secondary-light);
    margin-top: 0.75rem;
    margin-inline: auto;
}

/* Carousel Row
--------------------------------------------- */

.lp-service-review-carousel__carousel-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.lp-service-review-carousel__swiper {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding-block: 0.5rem;
}

.lp-service-review-carousel__swiper .swiper-wrapper {
    align-items: stretch;
    height: auto !important;
    box-sizing: border-box;
}

.lp-service-review-carousel__swiper .swiper-slide {
    height: auto !important;
}

/* Static fallback layout
--------------------------------------------- */

/* Applies wherever Swiper never initializes: the block editor, which loads
neither Swiper's script nor its stylesheet, and the front end if the CDN
fails. Without this the wrapper is not a flex row, so each slide fills the
width and the 16:10 card image balloons. Mirrors the desktop view — one card
on a narrow canvas, three on a wide one, extras clipped by the overflow. */
.lp-service-review-carousel__swiper:not(.swiper-initialized) .swiper-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 24px;
}

.lp-service-review-carousel__swiper:not(.swiper-initialized) .swiper-slide {
    flex: 0 0 100%;
    min-width: 0;
}

@media screen and (min-width: 768px) {
    .lp-service-review-carousel__swiper:not(.swiper-initialized) .swiper-slide {
        flex-basis: calc((100% - 48px) / 3);
    }
}

/* Card Layout
--------------------------------------------- */

.lp-service-review-carousel__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #fff;
    border: 1px solid #e1e4eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.06) 0px 2px 10px;
}

.lp-service-review-carousel__card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.lp-service-review-carousel__card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* This ensures that the card image is not set to height: auto
which happens by default in the block editor. */
.editor-styles-wrapper .lp-service-review-carousel__card-img {
    height: 100%;
}

.lp-service-review-carousel__card-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    padding: 1rem 1.25rem 1.25rem;
}

.lp-service-review-carousel__card-stars {
    display: flex;
    flex-direction: row;
    gap: 2px;
    color: var(--color-secondary-light);
}

.lp-service-review-carousel__card-stars .lp-service-review-carousel__star {
    width: 16px;
    height: 16px;
}

.lp-service-review-carousel__card-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
}

/* Credentials
--------------------------------------------- */

.lp-service-review-carousel__credentials {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Button
--------------------------------------------- */

/* FIXME: selector is temporary, without a.btn there is a specificity issue where style.css
will override any '.lp-service-review-carousel__btn' selector here. */

a.btn.lp-service-review-carousel__btn {
    margin-top: 0.5rem;
    align-self: center;
    background-color: #0092B8;
    color: white;
    border: 2px solid #0092B8;
}

a.btn.lp-service-review-carousel__btn:hover {
    background-color: white;
    color: #0092B8;
}

/*--------------------------------------------------------------
# Background image
--------------------------------------------------------------*/
.lp-service-review-carousel.anchor {
    position: relative;
}

.lp-service-review-carousel__cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* This ensures that the cover image is not set to height: auto
which happens by default in the block editor. */
.editor-styles-wrapper .lp-service-review-carousel__cover {
    height: 100%;
}

.lp-service-review-carousel__tint {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(180deg, rgba(4, 12, 36, 0.9) 0%, rgba(4, 12, 36, 0.7) 100%);
}

/*--------------------------------------------------------------
# Typography
--------------------------------------------------------------*/

/* Default Font Colors
--------------------------------------------- */
.lp-service-review-carousel__header {
    color: var(--color-secondary-dark);
    text-align: center;
    font-family: "Cabin";
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.15;
}

.lp-service-review-carousel__sub-header {
    color: #094873;
    text-align: center;
    width: 100%;
    font-size: clamp(0.875rem, 1.3vw, 0.9375rem);
    font-weight: 400;
}

.lp-service-review-carousel__card-text {
    color: var(--color-secondary-darker);
    font-size: clamp(0.8125rem, 1.2vw, 0.875rem);
    font-style: italic;
    line-height: 1.5;
}

/* FIXME: Temporary fix until standard HTML elements are styled globally */
.lp-service-review-carousel__card-text p {
    margin-block: 0 8px;
}

.lp-service-review-carousel__card-name {
    color: var(--color-secondary-dark);
    font-family: "Cabin";
    font-weight: bold;
    font-size: clamp(0.875rem, 1.3vw, 0.9375rem);
}

/* Em dash prefix lives in CSS so the field value stays clean */
.lp-service-review-carousel__card-name::before {
    content: "— ";
}

.lp-service-review-carousel__card-service {
    color: var(--color-secondary-light);
    font-size: clamp(0.6875rem, 1vw, 0.75rem);
}

.lp-service-review-carousel__credential {
    color: #094873;
    font-size: clamp(0.75rem, 1.1vw, 0.8125rem);
    text-align: center;
}

.lp-service-review-carousel__guarantee {
    color: #094873;
    font-size: clamp(0.75rem, 1.1vw, 0.8125rem);
    text-align: center;
    margin: 0;
}

/* Dark Font Colors
--------------------------------------------- */
.has_bg .lp-service-review-carousel__header,
.has_bg .lp-service-review-carousel__sub-header,
.has_bg .lp-service-review-carousel__credential,
.has_bg .lp-service-review-carousel__guarantee {
    color: var(--color-body-light);
}
