/* Das Hauptraster (4 Spalten) und die Türchen mit Klapp-Animation */
#kalender-container {
    display: grid;
    height: 100vh;
    grid-template-columns: repeat(4, 100px);
    gap: 10px;
    justify-content: center;
    padding: 20px;
    background-size: cover;
    background-image: url('../bilder/weihnachtsmarkt.jpg');
}

/* Der Rahmen des Türchens */
.tuer-wrapper {
    width: 100px;
    height: 100px;
    perspective: 1000px; /* Ermöglicht den 3D-Effekt */
    position: relative;
}

.tuer {
    width: 100%;
    height: 100%;
    z-index: 10;
    background:
        linear-gradient(90deg, transparent 45%, #f1c40f 45%, #f1c40f 55%, transparent 55%),
        linear-gradient(0deg, transparent 45%, #f1c40f 45%, #f1c40f 55%, transparent 55%),
        #c0392b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(241, 196, 15, 0.3);

    /* Animationseigenschaften */
    transition: transform 0.8s ease-in-out;
    transform-origin: left center; /* Das Scharnier ist links, vertikal zentriert */

    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transform-style: preserve-3d;
}

/* Schleife/Bow auf der Tür */
.tuer::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #f1c40f;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    box-shadow:
        -20px 0 0 -5px #f1c40f,
        20px 0 0 -5px #f1c40f;
}

/* Diese Klassen werden per JS hinzugefügt */
.tuer.offen {
    transform: translateY(-50%) rotateY(-110deg) translateZ(1px); /* Tür schwingt nach links auf */
}

.tuer.geschlossen {
    transform: translateY(-50%) rotateY(0deg) translateZ(1px);
}

/* Das Geschenk/Bild hinter der Tür */
.inhalt {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ecf0f1;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1; /* Liegt hinter der Tür */
}

/* Handy-Layout: kleineres Raster, damit alle 4 Spalten passen */
@media (max-width: 600px) {
    #kalender-container {
        grid-template-columns: repeat(4, 70px);
        gap: 6px;
        padding: 12px;
        height: auto;
        min-height: 100vh;
    }

    .tuer-wrapper {
        width: 70px;
        height: 70px;
    }

    .tuer {
        font-size: 18px;
    }

    .tuer::after {
        width: 22px;
        height: 22px;
        box-shadow:
            -14px 0 0 -3px #f1c40f,
            14px 0 0 -3px #f1c40f;
    }
}
