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

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

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

/* Header + hr group sized to the heading so the hr aligns to its first word */
.lp-review-carousel__heading-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 0.75rem;
}

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

/* Center the rule under the heading on mobile */
@media screen and (max-width: 768px) {
    .lp-review-carousel__hr {
        margin-inline: auto;
    }
}

/* Stars Row
--------------------------------------------- */

.lp-review-carousel__stars {
    display: flex;
    flex-direction: row;
    gap: 4px;
    justify-content: center;
}

.lp-review-carousel__star {
    width: 32px;
    height: 32px;
    color: var(--color-secondary-light);
}

/* Review Sources
--------------------------------------------- */

.lp-review-carousel__sources {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;    width: 100%;
    justify-content: space-evenly;
}

.lp-review-carousel__source {
    display: flex;
    align-items: center;
}

.lp-review-carousel__source-img {
    height: 30px;
    width: auto;
    object-fit: contain;
}

/* This ensures that the source image is not set to height: auto
which happens by default in the block editor. */
.editor-styles-wrapper .lp-review-carousel__source-img {
    height: 40px;
}

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

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

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

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

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

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

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

/* Static fallback for the block editor, which loads neither Swiper's script
nor its stylesheet, and for a CDN failure on the front end. Without it the
wrapper is not a flex row and each card image fills the canvas. */
.lp-review-carousel__swiper:not(.swiper-initialized) .swiper-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 24px;
}

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

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

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

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

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

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

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

.editor-styles-wrapper .lp-review-carousel__card-img {
    height: 100%;
}

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

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

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

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

/* Navigation
--------------------------------------------- */

.lp-review-carousel__nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    width: 100%;
    max-width: 460px;
    margin-inline: auto;
}

.lp-review-carousel__nav-prev,
.lp-review-carousel__nav-next {
    width: 48px;
    min-width: 48px;
    height: 48px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lp-review-carousel__nav-prev.swiper-button-disabled,
.lp-review-carousel__nav-next.swiper-button-disabled {
    opacity: 0.4;
    cursor: default;
}

/* Pagination
--------------------------------------------- */

.lp-review-carousel__pagination {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
}

.lp-review-carousel__pagination .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    margin: 0 !important;
    background: #c9d2dc;
    opacity: 1;
    transition: width 0.25s, background-color 0.25s;
}

.lp-review-carousel__pagination .swiper-pagination-bullet-active {
    width: 28px;
    border-radius: 5px;
    background: var(--color-secondary-light);
}

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

.lp-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-review-carousel__cover {
    height: 100%;
}

.lp-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-review-carousel__header {
    color: var(--color-secondary-dark);
    text-align: center;
    font-family: "Cabin";
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.15;
}

.lp-review-carousel__sub-header {
    color: var(--color-secondary-dark);
    text-align: center;
    width: 100%;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
}

.lp-review-carousel__card-text {
    color: #182550;
    font-size: clamp(0.9375rem, 1.4vw, 1rem);
    line-height: 1.5;
}

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

.lp-review-carousel__card-name {
    color: var(--color-secondary-dark);
    font-family: Cabin;
    font-weight: bold;
    font-size: clamp(1rem, 1.6vw, 1.125rem);
}

.lp-review-carousel__card-service {
    color: var(--color-secondary-light);
    font-size: clamp(0.8125rem, 1.2vw, 0.875rem);
    opacity: 1;
}

/* Dark Font Colors
--------------------------------------------- */

/* .no_bg .lp-review-carousel__header {
    color: var(--color-secondary-darker);
} */

/* .no_bg .lp-review-carousel__sub-header {
    color: var(--color-secondary-darker);
} */

/* .no_bg .lp-review-carousel__card-text {
    color: var(--color-secondary-dark);
} */
