// CARD
.cards{

    // colors
    .col:nth-of-type(3n+1) .card{
        color: white;
        background: $grey--dark;
    }

    @include desktop{
        // positions
        .col:nth-of-type(4n+2){
            transform: translateY(7.5rem);
        }
        .col:nth-of-type(4n+3){
            transform: translateY(4.5rem);
        }
        .col:nth-of-type(4n+4){
            transform: translateY(1.5rem);
        }
    }
}

// for js tilt (add parallax effect)
@include desktop{

    .card{
        transform-style: preserve-3d;
    }
    .card__more{
        transform: translateZ(1.5rem);
    }
}
.card{
    position: relative;
    background: $grey--light;

    &:hover .card__more{
        // show
        opacity: 1;
    }
    &:hover .card__more-background{
        opacity: 1;
    }
    &:hover .card__more-background:after{
        transform: translate3d(0, 0, 0);
    }

    @include desktop{
        height: 100%;
    }
}

.card__image{
    display: block;
    width: 100%;
    height: 15rem;
    object-fit: cover;
}
.card__content{
    padding: 3rem;
    padding-bottom: 6rem;

    h3{
        margin-top: 0;
    }
}
.card__more{
    overflow-y: auto;
    z-index: 3; // high
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3rem;
    color: white;
    // hide
    opacity: 0;
    @include transition(opacity);

    // custom scrollbar
    &::-webkit-scrollbar {
        width: 0.75rem;
    }
    &::-webkit-scrollbar-track {
        background: darken($secondary, 10%);
    }
    &::-webkit-scrollbar-thumb {
        background: lighten($secondary, 10%);
    }

    // hug first element
    & > *:first-child{
        margin-top: 0 !important;
    }
}
.card__more-background{
    overflow: hidden;
    z-index: 2; // medium
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(-45deg, $secondary, mix($main, $secondary, 50%));
    // hide
    opacity: 0;
    @include transition(opacity);

    // title
    &:after{
        content: attr(data-text);
        position: absolute;
        bottom: -3rem;
        left: -1.5rem;
        font-family: $font-family--heading;
        font-weight: 700;
        font-size: 6 * $font-scale * 1rem; // double h1
        line-height: 6 * $font-leading; // double h1
        color: $secondary;
        // hide
        transform: translate3d(0, 1.5rem, 0);
        @include transition(transform);
    }
}
.card__icon{
    position: absolute;
    bottom: 0;
    right: 0;
    width: 4.5rem;
    height: 4.5rem;
    padding: 1.5rem;
    background: $secondary;

    svg{
        display: block;
        width: 1.5rem;
        height: 1.5rem;
        fill: white;
    }
}
