/**
 * 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;
}

/**
 * Intro
 */

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

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

.at-cards .--isCenterAligned .at-cards__introWrapper {
    text-align: center;
    margin-inline: auto;
}

.at-cards__introWrapper {
    max-width: 70ch;
    margin-bottom: var(--marginLarge);
}

/**
 * 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::before {
    display: block;
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85%;
    z-index: 30;
    content: '';
    background: linear-gradient(to bottom, rgba(15,15,15,0), rgba(15,15,15,.75) 100%);
}

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

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

.at-cards__itemTitle {
    hyphens: auto;
}

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

.at-cards__item.--hasLink {
    transition: all var(--timingFlash);
}

.at-cards__item.--hasLink:hover {
    transform: translateY(-.25rem);
    box-shadow: var(--boxShadowLargeHover);
}

.at-cards__item:hover .at-cards__itemContent,
.at-cards__item:hover .at-cards__itemText,
.at-cards__item:hover .at-cards__itemText {
    opacity: 1;
    transform: translateY(0);
}

.at-cards__itemIcon {
    order: -1;
    margin-bottom: var(--marginSmall);
    filter: invert(1) brightness(1);
}

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

.at-cards__item.--hasLink:hover .at-cards__itemImage {
    opacity: 1;
    scale: 1;
}
