html, body {
    overflow-y: visible;
    height: 100%;
}

.family-jewels-section {
    background: url("../../assets/jewels-background.jpg") no-repeat center center;
    background-size: cover;
    height: auto;
    min-height: calc(100vh - 81px);
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

h1 {
    font-family: "TS Block Bold", serif;
    font-size: 48px;
    text-align: center;
    padding-top: 100px;
    margin-top: 0;
    margin-bottom: 16px;
    color: white;
    text-shadow: 0 0 4px white;
}

h3 {
    font-family: "Alegreya Sans SC", serif;
    font-size: 24px;
    padding-bottom: 36px;
    color: white;
    text-shadow: 0 0 3px white;
    text-align: center;
}

.card-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 100px;
}

.card {
    width: 20vw;
    height: 28vw;
    perspective: 1000px;
    cursor: pointer;
    border-radius: 15px;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.8s;
}

.card-container .card:nth-child(1) {
    animation-duration: 3s;
    animation-delay: 0s;
}

.card-container .card:nth-child(2) {
    animation-duration: 4s;
    animation-delay: 0.4s;
}

.card-container .card:nth-child(3) {
    animation-duration: 2.5s;
    animation-delay: 0.2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(-180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-front {
    transform: rotateY(0deg);
}

.card-back {
    background: #dadbd6;
    padding: 15px;
    box-sizing: border-box;
    transform: rotateY(180deg);
    overflow-y: auto;
    font-family: "Bentham", sans-serif;
    font-size: 1vw;

    a {
        text-decoration: none;
        font-weight: bold;
        color: #0a6636;
    }
}

.button-container {
    display: block;
    justify-content: center;
    text-align: center;
    padding: 100px 0 50px;
}

.button-container p {
    color: white;
    font-family: "Rubik", sans-serif;
    font-size: 20px;
    text-shadow: 0 0 3px white;
}

.fam-button {
    font-family: "Rubik", serif;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 2px white;
    width: auto;
    height: 40px;
    white-space: nowrap;
    padding: 0 24px;
    border: white solid 2px;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

@media (hover: hover) {
    .fam-button:hover {
        cursor: pointer;
    }

    .zoom-out {
        transition: 0.5s;
    }

    .zoom-out:hover {
        transform: scale(1.05);
    }
}

/* Small screens */
@media (max-width: 768px) {
    .family-jewels-section {
        min-height: calc(100vh - 60px);
    }

    h1 {
        font-size: 40px;
        text-shadow: 0 0 3px white;
    }

    h3 {
        font-size: 24px;
        text-shadow: 0 0 2px white;
    }

    .fam-button {
        font-size: 16px;
        text-shadow: 0 0 1px white;
    }

    .button-container p{
        font-size: 16px;
    }

    .card-container {
        display: block;
    }

    .card {
        width: 250px;
        height: 350px;
        margin-bottom: 50px;
    }

    .card-front, .card-back {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    }

    .card-back {
        font-size: 12px;
    }
}