.gallery-page {
    background-color: black;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    position: relative;
    font-family: 'Thonburi', sans-serif;
}

.gallery-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: -1;
}

.gallery-container {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

.gallery-header {
    font-family: 'Thonburi', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.back-button {
    font-family: 'Thonburi', sans-serif;
    font-family: 'Thonburi', sans-serif;
    background-color: transparent;
    border: 1px solid var(--text-color);
    padding: 0.75rem 1.5rem;
}

.photo-grid {
    font-family: 'Thonburi', sans-serif;
    column-count: 3;
    column-gap: 1rem;
    padding: 1rem;
}

.gallery-image-container {
    font-family: 'Thonburi', sans-serif;
    break-inside: avoid;
    margin-bottom: 1rem;
    margin-top: 4rem;
    position: relative;
}

.gallery-image {
    font-family: 'Thonburi', sans-serif;
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease;
    position: relative;
    z-index: 1;
}

.gallery-image.loaded {
    opacity: 1;
}

@media screen and (max-width: 1200px) {
    .photo-grid {
        column-count: 2;
    }
}

@media screen and (max-width: 768px) {
    .photo-grid {
        column-count: 1;
    }
}

.loading {
    color: var(--text-color);
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

.error {
    color: var(--accent-color);
    text-align: center;
    padding: 2rem;
    grid-column: 1 / -1;
}

.photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.gallery-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.3),
        0 0 40px rgba(255, 255, 255, 0.2),
        0 0 60px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-image-container:hover::after {
    opacity: 1;
}

/* Modal styles */
.modal {
    font-family: 'Thonburi', sans-serif;
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.modal-content.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover {
    color: #999;
}