/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* container query */

.hover-cards {
    container-type: inline-size;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* containers */

.hover-cards__inner {
    padding: 52px 30px;
    background: var(--blue-background-gradient);
    border-radius: var(--box-border-radius-lg);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* title */

.hover-cards__header.section-header {
    text-align: center;
}

.hover-cards__title span {
    color: var(--white);
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* cards */

.hover-cards__cards {
    display: flex;
    flex-wrap: wrap;
    column-gap: 36px;
    row-gap: 32px;
    justify-content: center;
    align-items: stretch;
}

/*single card*/
.hover-cards__card {
    position: relative;
    min-height: 290px;

    border-radius: var(--box-border-radius-sm);
    overflow: hidden;

    flex: 0 0 calc((100% - (36px * 2)) / 3);
}

/*background*/
.hover-cards__card__image,
.hover-cards__card__image img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hover-cards__card__gradient.background-gradient {
    z-index: 2;
    top: unset;
    bottom: 0;
    height: 45%;
    background: var(--black-overlay-gradient);
}

/*content*/
.hover-cards__card__content {
    position: relative;
    z-index: 3;
    height: 100%;

    padding: 16px;

    text-align: center;
    color: var(--white);

    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: center;
}

/*flip button wrapper*/
.hover-cards__card__flip-wrapper {
    width: 100%;
    perspective: 1000px;
}

/*flip button*/
.hover-cards__card__flip-button {
    position: relative;
    display: block;
    width: 100%;
    height: 64px; /* Fixed height for 3D rotation */

    transform-style: preserve-3d;
    transition: transform 0.4s ease;
    transform: translateZ(-32px); /* Half of height */
}

.hover-cards__card:hover .hover-cards__card__flip-button {
    transform: translateZ(-32px) rotateX(-90deg);
}

/*faces*/
.flip-button__face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;

    border-radius: var(--box-border-radius-sm);
    backface-visibility: hidden;
}

.flip-button__face--front {
    background: var(--blue-dk);
    color: var(--white);
    transform: rotateX(0deg) translateZ(32px);
}

.flip-button__face--front h3.hover-cards__card__title {
    margin: 0;
    padding: 0;
    background: transparent;
    color: inherit;
}

.flip-button__face--back {
    background: var(--white);
    color: var(--blue-dk);
    transform: rotateX(90deg) translateZ(32px);
}

.flip-button__face--back .hover-cards__card__link {
    margin: 0;
    color: inherit;
}

.flip-button__face--back .icon.triangle-right {
    display: inline;
    font-size: 18px;
    margin-left: 5px;
}

.flip-button__face--back .icon.triangle-right svg {
    margin-bottom: 4px;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* hover states */

/*non-hover*/
.hover-cards__card .hover-cards__card__gradient {
    transform: translateY(100%);
    transition: all 0.4s ease;
}

/*hover*/
.hover-cards__card:hover .hover-cards__card__gradient {
    transform: translateY(0%);
    transition: all 0.2s ease;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* read more */

.hover-cards__read-more-wrapper {
    display: none;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* tablet */

@container (max-width: 805px) {
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* cards */
    .hover-cards__card {
        flex: 0 0 calc((100% - (36px)) / 2);
    }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* mobile */

@media (max-width: 768px) {
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /*containers*/

    .hover-cards__inner {
        padding: 48px 30px;
        border-radius: 0;
    }
    .page-row--has-sidebar .hover-cards__inner {
        margin-right: -30px;
        margin-left: -30px;
    }
}

@container (max-width: 630px) {
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* cards */

    .hover-cards__cards {
        row-gap: 16px;
    }

    .hover-cards__card {
        flex: 0 0 100%;
    }

    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* read more */

    .hover-cards__card--mobile-hidden {
        display: none;
    }

    .hover-cards__read-more-wrapper {
        display: flex;
        justify-content: center;
        margin-top: 24px;
    }
}
