@import url('https://fonts.googleapis.com/css2?family=Sora:wght@100..800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Sora', sans-serif;
}

body {
    background-color: #A9A9A9;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 100px;
    padding: 50px;
    justify-content: space-evenly;
}

.card {
    width: 300px;
    height: 400px;
    border: 4px solid black;
    border-radius: 10px;
    box-shadow: -10px 14px black;
    position: relative;
    background-color: white;
    perspective: 1000px;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

.card:hover {
    z-index: 100;
}

/* Fade out sibling cards when one is active */
.card-container.has-active .card {
    opacity: 0;
}

.card-container.has-active .card.active {
    opacity: 1;
}

/* Disable transition when snapping back */
.card.no-transition {
    transition: transform 0.5s ease !important;
}

.card-cover {
    position: absolute;
    top: -4px;
    left: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);

    background-size: cover;
    background-position: center;
    background-color: #333;
    /* fallback if image missing */

    border: 4px solid black;
    border-radius: 10px;
    z-index: 2;

    transform-origin: right center;
    transition: transform 0.8s ease-in-out;
}

.card.active .card-cover {
    transform: rotateY(160deg);
}

/* THE INSIDE CONTENT */
.card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
}