/* CARD GRID */
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); */

    gap: 40px;
    /* margin-top: 40px; */


    /* max-width: 80vw; */

    /* margin-left: 60px;
    margin-right: 60px; */
    /* justify-content: center; */

    /* max-width: 1200px; */
    /* margin: 0 auto; */
    padding: 0 40px;

}

/* CARD */
.card {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 2/3; 
    border-radius: 20px;
    background: var(--lgrey);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* IMAGE */
.card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/*FIRST IMAGE*/
.card img:first-child {
    z-index: 2;
    transition: transform 0.6s ease;
}

/* SECOND IMAGE (for hover swap) */
.card img:last-child {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: 1;
}

/* HOVER EFFECT */
.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.card:hover img:first-child {
    opacity: 0;
    transform: translateY(-100%);

}

.card:hover img:last-child {
    opacity: 1;
    transform: scale(1.05);
}

/* CONTENT OVERLAY */
.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 20px;
    color: white;
    z-index: 2;
}

/* DARK GRADIENT OVERLAY */
.card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.6),
        rgba(0,0,0,0.1),
        transparent
    );
}

/* TEXT */
.card h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.card p {
    margin: 5px 0 0;
    font-size: 14px;
    opacity: 0.8;
}


@media screen and (max-width: 1100px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        /* margin-left: 40px;
        margin-right: 40px;
        max-width:none; */
        gap: 20px;
    padding: 0 40px;


    }

    
/* 
    .card {
        aspect-ratio: 3 / 4;
    } */
} 

@media screen and (max-width: 800px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .card {
        aspect-ratio: 3 / 2;
    }
}

@media screen and (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .card {
        aspect-ratio: 16 / 9;
    }
}