:root {
    --primary-color: #333;
    --accent-color: #8e8e8e;
    --bg-overlay: rgba(255, 255, 255, 0.65);
    --transition-speed: 1.5s;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-sans);
    color: var(--primary-color);
}

/* Background & Overlay */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 10s ease-out;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    transition: opacity var(--transition-speed) ease-in-out;
    backdrop-filter: blur(0px);
}

.overlay.active {
    opacity: 0.7;
    backdrop-filter: blur(5px);
}

/* Typography */
.playfair {
    font-family: var(--font-serif);
    font-weight: 400;
    font-style: italic;
}

.letter-text {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    line-height: 1.6;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    color: #444;
}

@media (max-width: 768px) {
    .letter-text {
        font-size: 1.4rem;
        padding: 0 20px;
    }
}

/* Layout */
main {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.stage {
    display: none;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    width: 100%;
    max-width: 600px;
}

.stage.active {
    display: block;
    opacity: 1;
}

.content-wrapper {
    text-align: center;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #222;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    padding: 12px 40px;
    font-family: var(--font-sans);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-filled {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
    margin-top: 2rem;
}

.btn-filled:hover {
    opacity: 0.8;
}

/* Categories Grid */
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

/* Checkbox Styling */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: transparent;
    border: 1px solid #ccc;
}

.checkbox-container:hover input~.checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 2rem;
    }

    .button-group {
        flex-direction: column;
    }
}

/* Photo Grid */
#gallery-stage {
    max-width: 1200px;
    width: 90%;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0 10px;
}

.btn-back {
    background: transparent;
    border: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    cursor: pointer;
    color: var(--primary-color);
    padding: 10px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px;
    max-height: 70vh;
    overflow-y: auto;
    width: 100%;
}

.photo-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
    background: #f0f0f0;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 3px solid white;
}

.lightbox-counter {
    color: white;
    margin-top: 10px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 20px;
    transition: background 0.3s;
    z-index: 1001;
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .lightbox-prev,
    .lightbox-next {
        padding: 5px;
        font-size: 20px;
    }

    .close-lightbox {
        top: 10px;
        right: 20px;
    }
}