.gallery-page {
    min-height: 100vh;
    background: url('A6702555_DxO.jpg') center center / cover no-repeat fixed;
    position: relative;
}

.gallery-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.gallery-page > * {
    position: relative;
    z-index: 1;
}

.gallery-page .nav-links a.active {
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 2px;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

.gallery-title {
    font-size: 1.8rem;
    font-weight: 200;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Masonry layout with CSS columns */
.masonry {
    columns: 3;
    column-gap: 1rem;
}

.masonry img {
    width: 100%;
    display: block;
    margin-bottom: 1rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.5s ease forwards;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.masonry img:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger the animations */
.masonry img:nth-child(1) { animation-delay: 0.0s; }
.masonry img:nth-child(2) { animation-delay: 0.05s; }
.masonry img:nth-child(3) { animation-delay: 0.1s; }
.masonry img:nth-child(4) { animation-delay: 0.15s; }
.masonry img:nth-child(5) { animation-delay: 0.2s; }
.masonry img:nth-child(6) { animation-delay: 0.25s; }
.masonry img:nth-child(7) { animation-delay: 0.3s; }
.masonry img:nth-child(8) { animation-delay: 0.35s; }
.masonry img:nth-child(9) { animation-delay: 0.4s; }
.masonry img:nth-child(10) { animation-delay: 0.45s; }
.masonry img:nth-child(11) { animation-delay: 0.5s; }
.masonry img:nth-child(12) { animation-delay: 0.55s; }

.gallery-empty {
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.1rem;
    font-weight: 300;
    text-align: center;
    padding: 6rem 0;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox button {
    position: absolute;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: color 0.2s;
    font-family: 'Raleway', sans-serif;
}

.lightbox button:hover {
    color: #fff;
}

.lightbox-close {
    top: 1.5rem;
    right: 2rem;
    font-size: 2.5rem;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    padding: 1rem;
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

/* Responsive */
@media (max-width: 900px) {
    .masonry { columns: 2; }
    .gallery-container { padding: 1rem 1rem 3rem; }
}

@media (max-width: 500px) {
    .masonry { columns: 1; }
    .lightbox-prev, .lightbox-next { font-size: 2rem; }
}
