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

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

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* row */

.spotlight-cards__row {
    display: flex;
    gap: 36px;
    justify-content: space-between;
    align-items: center;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* text side */

.spotlight-cards__text-side {
    flex: 0 0 25%;
}

.spotlight-cards__header.section-header {
    margin-bottom: 15px;
}

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

.spotlight-cards__cards-side {
    flex: 1;
}

.spotlight-cards__cards {
    flex: 0 0 calc(75% - 36px);

    display: flex;
    flex-wrap: wrap;
    gap: 36px;
    justify-content: center;
    align-items: stretch;
}

.spotlight-cards__card {
    position: relative;
    flex: 0 0 calc((100% - (36px * 2)) / 3);
    border-radius: var(--box-border-radius-sm);
    overflow: hidden;
}

.spotlight-cards__card--link {
    display: block;
    text-decoration: none;
}

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

.spotlight-cards__card__gradient.background-gradient {
    top: unset;
    bottom: 0;
    height: 40%;
    background: var(--blue-overlay-gradient);

    transition: all 0.2s ease-in-out;
}

a.spotlight-cards__card.spotlight-cards__card--link:hover .spotlight-cards__card__gradient {
    height: 60%;
}

/*title*/
.spotlight-cards__card__content {
    aspect-ratio: 274 / 350;
    padding: 25px;
    display: flex;
    align-items: end;
}

.spotlight-cards__card__title {
    color: var(--white);
    font-size: 22px;

    transition: all 0.2s ease-in-out;
}

a.spotlight-cards__card.spotlight-cards__card--link:hover .spotlight-cards__card__title {
    margin-bottom: 12px;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* IMAGE ABOVE (Card Style "Photo, Then Text") */
/* photo on its own, title + description below it, so the cards read as information, not buttons */

.spotlight-cards--image-above .spotlight-cards__cards {
    align-items: start;
}

.spotlight-cards--image-above .spotlight-cards__card {
    border-radius: 0;
    overflow: visible;
}

.spotlight-cards--image-above .spotlight-cards__card__image {
    position: relative;
    inset: auto;
    z-index: auto;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: var(--box-border-radius-sm);
    overflow: hidden;
}

/* card photos are mostly portraits with faces up high; a 4:3 crop from the center cuts off heads */
.spotlight-cards--image-above .spotlight-cards__card__image img {
    z-index: auto;
    object-position: center 20%;
}

.spotlight-cards--image-above .spotlight-cards__card__content {
    aspect-ratio: auto;
    display: block;
    padding: 18px 0 0;
}

.spotlight-cards--image-above .spotlight-cards__card__title {
    color: var(--blue-dk);
}

.spotlight-cards__card__description {
    margin: 10px 0 0;
    color: var(--black);
}

/* a linked card in this style: underline the title instead of lifting it */
.spotlight-cards--image-above a.spotlight-cards__card.spotlight-cards__card--link:hover .spotlight-cards__card__title {
    margin-bottom: 0;
    text-decoration: underline;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* TIGHT 3-COLUMNS (SIDEBAR ON DESKTOP) */

@container (max-width: 1100px) {
    .spotlight-cards__cards {
        gap: 22px;
    }

    .spotlight-cards__card {
        flex: 0 0 calc((100% - (22px * 2)) / 3);
    }

    .spotlight-cards__card__content {
        padding: 20px;
    }

    .spotlight-cards__card__title {
        font-size: 20px;
    }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* STACKED VIEW (MOBILE) */

@container (max-width: 915px) {
    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* row */
    .spotlight-cards__row {
        flex-direction: column;
        gap: 32px;
        align-items: start;
    }

    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* text side */
    .spotlight-cards__text-side {
        flex: 0 0 100%;
    }

    /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
    /* cards side */
    .spotlight-cards__cards {
        flex: 0 0 100%;
        justify-content: start;
        gap: 16px;
    }

    .spotlight-cards__card {
        flex: 0 0 calc((100% - 16px) / 2);
    }

    .spotlight-cards__card__content {
        /* height comes from aspect-ratio; keep 25px padding over the 1100px override */
        padding: 25px;
    }

    .spotlight-cards__card__title {
        font-size: 22px;
    }
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
/* NARROW VIEW (SINGLE COLUMN) */

@container (max-width: 576px) {
    .spotlight-cards__card {
        flex: 0 0 100%;
    }
}
