.cards-banner {
    padding: 120px 0;
}

.cards-banner-card {
    /* Fixed flex-basis (3 columns, 2 gaps of 16px) instead of a 1fr grid column, since CSS Grid can't justify-content a short last row but flex-wrap can. */
    flex: 0 1 calc((100% - 32px) / 3);
    max-width: 413px;
    aspect-ratio: 413 / 302;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.6s ease-in-out;
}

.cards-banner-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    align-items: start;
    overflow: hidden;
}

.cards-banner-image {
    margin: 0;
    height: 100%;
    width: 100%;
    display: block;
}

.cards-banner-image img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
}

.cards-banner-card-title {
    font-size: 18px;
    font-style: normal;
    font-weight: 800;
    line-height: 22px;
}

.cards-banner-content {
    padding: 24px;
    justify-content: space-between;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(0);
    transition:
        opacity 0.5s ease-in-out,
        max-height 0.6s ease-in-out,
        transform 0.5s ease-in-out;
}

.cards-banner-card-desc {
    margin-top: 8px;
    margin-bottom: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(0);
    transition:
        opacity 0.5s ease-in-out,
        max-height 0.6s ease-in-out,
        transform 0.5s ease-in-out;
}

.intro-wrapper {
    justify-content: center;
    align-items: center;
}

.cards-banner-breadcrumb {
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 4.8px;
    margin-bottom: 16px;
}

/* .text-main-500 on this dark background only hits a 4.3:1 contrast ratio, just under the 4.5:1 minimum — override with the lighter --bs-main-200 here instead of changing the shared utility class. */
.cards-banner-breadcrumb.text-main-500 {
    color: var(--bs-main-200) !important;
}

.cards-banner-title {
    font-size: 32px;
    font-style: normal;
    font-weight: 800;
    line-height: 40px;
    margin-bottom: 16px;
    width: 50%;
    text-align: center;
}

.cards-banner-desc {
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    width: 75%;
    text-align: center;
    margin-bottom: 40px;
}

.cards-banner-bottom-text {
    width: 75%;
    max-width: 900px;
    margin: 40px auto 0;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    text-align: center;
}

.cards-banner-bottom-text p:last-child {
    margin-bottom: 0;
}

.cards-banr-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.cards-banner-card-title {
    width: 85%;
}

.cards-banner-icon {
    opacity: 0;
    flex-shrink: 0;
    transform: translateY(10px);
    transition: 
        opacity 0.5s ease-in-out,
        transform 0.5s ease-in-out;
}

.cards-banner-card:hover .cards-banner-icon {
    opacity: 1;
    transform: translateY(0);
}

.cards-banner-card:hover .cards-banner-card-desc {
    display: block;
    opacity: 1;
    max-height: 200px;
    transform: translateY(0);
}

/* On hover, grow the content box to the card's full height so justify-content: space-between pins the title+icon row to the top and the description to the bottom. */
.cards-banner-card:hover .cards-banner-content {
    height: 100%;
    justify-content: space-between;
}

@media screen and (max-width: 1200px) {
    .cards-banner-card-title {
        font-size: 15px;
        line-height: 18px;
    }
    
    .cards-banner-card-desc {
        font-size: 14px;
        line-height: 20px;
        margin-bottom: 0;
    }

    .cards-banner-icon img {
        width: 24px;
        height: 24px;
    }
}

.cards-swiper .swiper-pagination {
    position: static;
    display: flex;
    padding-top: 16px;
    width: 100%;
    justify-content: space-between;
}

.cards-swiper .swiper-pagination-bullet {
    width: 100%;
    height: 3px;
    border-radius: 0px;
    background-color: var(--bs-secondary-700);
    opacity: 1;
}

/* The active bullet has the same specificity as the base rule above, so this must come after it in source order to actually win. */
.cards-swiper .swiper-pagination-bullet-active {
    background-color: var(--bs-white);
}

@media screen and (max-width: 992px) {

    .cards-banner-card-title {
        font-size: 14px;
        line-height: 18px;
    }

    .cards-banner-card:hover .cards-banner-content {
        height: initial;
    }

    .intro-wrapper {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .cards-banner {
        padding: 40px 0;
        overflow-x: hidden;
    }

    .cards-banner-breadcrumb {
        text-align: left;
        width: 100%;
    }

    .cards-banner-title {
        width: 90%;
        text-align: left;
        font-size: 20px;
        line-height: 24px;
    }

    .cards-banner-desc {
        width: 90%;
        text-align: left;
    }

    .cards-banner-bottom-text {
        width: 90%;
        text-align: left;
        margin-top: 24px;
    }

    .cards-banner-grid {
        display: flex;
        width: 100%;
        overflow: hidden;
    }

    .cards-banner-card {
        /* Resets the desktop flex-basis (which takes priority over width in flex layout), so the mobile swiper-cards.js conversion can apply this 327px width to each slide. */
        flex: 0 0 auto;
        width: 327px;
        height: auto;
    }

    .cards-wrapper {
        overflow: hidden;
    }

    .cards-banner-indicators {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 24px;
    }

    .cards-banner-indicators .indicator {
        width: 100%;
        height: 4px;
        background-color: var(--bs-secondary-700);
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.3s ease;
    }

    .cards-banner-indicators .indicator.active {
        background-color: var(--bs-white);
    }

}

@media screen and (max-width: 992px) {
    .cards-banner-content {
        top: 0;
    }

    .cards-banner-card-desc {
        opacity: 1;
        max-height: 220px;
    }

    .cards-wrapper {
        padding-inline: 0;
    }

    .intro-wrapper {
        padding-inline: 24px;
    }

    .cards-swiper {
        padding-inline: 24px;
    }
}
