/**
 * This variable sets the amount of lines of text that should become visible when hovering on a card
 * It is also used to calculate the value of the translates dynamically
 */

.at-cards {
    --_lines: 3;
    --scale: 1.02;
}

.Article.at-cards + .Article.at-cards.--noMarginTop {
    margin-top: calc(-1 * var(--articlePadding) + var(--gridGutter));
}

/**
 * Intro
 */

.at-cards.--light .articleTitle,
.at-cards__itemList.--light > * {
    color: var(--baseLight100);
}

.at-cards__itemList.--dark > * {
    color: var(--baseDark900);
}

/**
 * Items
 */

.at-cards__itemList {
    margin: 0;
    padding: 0;
    list-style: none;
}

.at-cards__item {
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    overflow: clip;
    padding: var(--marginMedium);
    min-height: 300px;
    border-radius: var(--borderRadiusSmall);
    box-shadow: var(--boxShadow);
}

.at-cards__item.--hasBgImg::after {
    display: block;
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85%;
    content: '';
    background: linear-gradient(to bottom, rgba(15,15,15,0), rgba(15,15,15,.85) 100%);
}

.at-cards__itemContent {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.at-cards__itemList.--txtOver .at-cards__item.--hasText .at-cards__itemContent {
    transform: translateY(calc(var(--_lines) * 1lh));
    transition: transform .3s ease-out;
}

.at-cards__itemText {
    display: -webkit-box;
    -webkit-line-clamp: var(--_lines);
    -webkit-box-orient: vertical;
    overflow: clip;
    margin-block: var(--marginExtraSmall) 0;
    transition: opacity .5s ease-out, transform .5s ease-out;
}

.at-cards__itemList.--txtOver .at-cards__itemText {
    min-height: calc(var(--_lines) * 1lh);
}

.at-cards__itemList.--txtOver .at-cards__item.--hasText .at-cards__itemText {
    opacity: 0;
}

.at-cards__item.--hasLink:not(.--hasBgImg):hover {
    box-shadow: var(--boxShadowLargeHover);
}

.at-cards__itemList.--txtOver .at-cards__item.--hasText:hover .at-cards__itemContent,
.at-cards__itemList.--txtOver .at-cards__item.--hasText:hover .at-cards__itemText,
.has-touch .at-cards__itemList.--txtOver .at-cards__item.--hasText .at-cards__itemContent,
.has-touch .at-cards__itemList.--txtOver .at-cards__item.--hasText .at-cards__itemText {
    transform: translateY(0);
}

.at-cards__itemList.--txtOver .at-cards__item.--hasText:hover .at-cards__itemText,
.has-touch .at-cards__itemList.--txtOver .at-cards__item.--hasText .at-cards__itemText {
    opacity: 1;
}

.at-cards__itemIcon {
    width: var(--h4Size);
    height: var(--h4Size);
    object-fit: contain;
    order: -1;
    margin-bottom: var(--marginSmall);
}

.at-cards__itemList.--light .at-cards__itemIcon {
    filter: invert(1) brightness(1);
}

.at-cards__imageWrapper {
    overflow: hidden;
}

.at-cards__itemImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale var(--timingFlash);
}

.at-cards__itemList:not(.--txtOver) .at-cards__item.--hasLink:hover .at-cards__itemImage {
    scale: var(--imageScale);
}
