body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Oswald', sans-serif;
    background: url('/images/background.jpg') center/cover no-repeat fixed;
    background-color: #27130E;
    color: #f8f1e4;
    overscroll-behavior: none;
}

.page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(39, 19, 14, 0.7);
    pointer-events: none;
    z-index: 0;
}

.gallery-container {
    position: relative;
    min-height: 100vh;
    padding: 40px 20px;
    z-index: 1;
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 2.5rem;
    color: #C3A16D;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.gallery-subtitle {
    font-size: 1.5rem;
    color: #f8f1e4;
    max-width: 800px;
    margin: 0 auto 30px;
    opacity: 0.8;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    border: 3px solid #C3A16D;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    aspect-ratio: 3/4;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(39, 19, 14, 0.8);
    color: #f8f1e4;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.caption-title {
    font-size: 1.2rem;
    color: #C3A16D;
    margin: 0 0 5px;
}

.caption-text {
    font-size: 1rem;
    margin: 0;
}

.navigation {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 50px;
    padding-bottom: 20px;
}

.nav-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: transparent;
    border: 2px solid #C3A16D;
    color: #C3A16D;
    text-decoration: none;
    border-radius: 5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    font-weight: bold;
}

.nav-button:hover {
    background-color: #C3A16D;
    color: #27130E;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 80%;
    margin: 20px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    border: 4px solid #C3A16D;
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.8);
}

.lightbox-caption {
    color: #f8f1e4;
    text-align: center;
    padding: 20px;
    max-width: 80%;
}

.lightbox-caption h3 {
    font-size: 1.8rem;
    color: #C3A16D;
    margin: 0 0 10px;
}

.lightbox-caption p {
    font-size: 1.2rem;
    margin: 0;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #f8f1e4;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(39, 19, 14, 0.7);
    border: 2px solid #C3A16D;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-lightbox:hover {
    background-color: #C3A16D;
    color: #27130E;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .gallery-title {
        font-size: 1.8rem;
    }

    .gallery-subtitle {
        font-size: 1.1rem;
        padding: 0 10px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
        padding: 0 5px;
    }

    .gallery-item {
        border: 2px solid #C3A16D;
    }

    .gallery-caption {
        padding: 10px;
    }

    .caption-title {
        font-size: 1rem;
    }

    .caption-text {
        font-size: 0.8rem;
    }

    .navigation {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-top: 30px;
    }

    .nav-button {
        width: 80%;
        text-align: center;
        padding: 12px 0;
        font-size: 0.9rem;
    }

    .lightbox-content {
        max-width: 95%;
    }

    .lightbox-caption h3 {
        font-size: 1.4rem;
    }

    .lightbox-caption p {
        font-size: 1rem;
    }

    .close-lightbox {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

/* Improved touch interaction for mobile */
@media (hover: none) {
    .gallery-caption {
        transform: translateY(0);
        height: auto;
        max-height: 40%;
        overflow-y: auto;
    }
    
    .gallery-item:active {
        transform: scale(0.98);
    }
}