body {
    margin: 0;
    background: #f1f1f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10vh 0;
}

.postcard {
    width: 700px;
    height: 500px;
    margin: 80px 0;
    perspective: none;
    cursor: pointer;
}

.postcard-inner {
    width: 100%;
    height: 100%;
    perspective: 1200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s ease-in-out;
}

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

.face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


.postcard.vertical {
    margin: 180px 0;
}

.face.back {
    transform: rotateY(180deg);
}


.postcard.vertical .face.front img {
    width: 500px;
    height: auto;
    object-fit: contain;
    transform-origin: center;
    transition: transform 0.5s ease;
}

.postcard.vertical .face.back img {
    object-fit: contain;
}



/* -----------------------
   MOBILE
------------------------ */
@media (max-width: 768px) {
    .postcard {
        width: 90vw;
        height: calc(90vw * 500 / 700);
        margin: 60px 0;
    }

    /* Vertical Cards */
    .postcard.vertical {
        width: calc(90vw * 500 / 700); /* Höhe der normalen Karte */
        height: auto;
        margin: 220px 0;
    }

    .postcard.vertical .face.front img {
        width: 100%;
        height: auto;
    }

    .postcard.vertical .face.back img {
        width: 140%; /* Backbild größer */
        height: auto;
    }

    /* Front & Back für horizontale Karten */
    .postcard:not(.vertical) .face.front img,
    .postcard:not(.vertical) .face.back img {
        width: 100%;
        height: auto;
    }
}


