:root {
    --primary-red: #D42426;
    --primary-green: #165B33;
    --gold: #F8B229;
    --snow-white: #F0F4F8;
    --paper-bg: #fdfbf7;
    --cardboard: #d2b48c;
    --text-color: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* Prevent text selection while dragging */
}

html,
body {
  height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--dark-bg);
    /* Fallback */
    background-image: url('images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-color);
    /* height: 100vh;
    width: 100vw; */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

main {
    width: 100%;
    height: 100%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* The Board (ol) */
.calendar-board {
    list-style: none;
    width: 90vmin;
    /* Responsive square-ish size */
    height: 90vmin;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2vmin;
    padding: 2vmin;
    /* Background removed for transparent look */
}

/* The Day Container (li) */
.calendar-board li {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1000px;
    /* Adds 3D depth */
}

/* The content behind the door (a) */
.calendar-board li a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #ccc;
    box-sizing: border-box;
    overflow: hidden;
    text-decoration: none;
    /* Remove underline */
}

.calendar-board li a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* The door itself (h2) */
.calendar-board li h2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Match the body background to create "transparency" effect while hiding content */
    background-image: url('images/background.jpg');
    /* background-image set by JS to ensure alignment during drag */

    border: 1px dashed rgba(255, 255, 255, 0.6);
    margin: 0;
    /* Reset h2 margin */
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Mountains of Christmas', cursive;
    font-size: 6vmin;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    cursor: grab;
    transform-origin: left;
    transform-style: preserve-3d;
    transition: transform 0.1s linear;
    z-index: 2;
    /* Initial shadow */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.calendar-board li h2:active {
    cursor: grabbing;
}

.calendar-board li h2.open {
    transform: rotateY(-110deg) !important;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 10px 0 20px rgba(0, 0, 0, 0.4);
    /* Shadow cast by the open door */
}

.calendar-board li h2.previously-opened {
    border: 1px solid rgba(0, 0, 0, 0.5);
}

/* The "handle" area to hint at dragging */
.calendar-board li h2::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .calendar-board {
        width: 95vw;
        height: 80vh;
        /* Taller on mobile */
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(8, 1fr);
    }
}

/* Fullscreen Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: flex;
    opacity: 1;
}

.overlay img {
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.thumbnails-hidden img {
    visibility: hidden;
}
