/* Page Hero */
.page-hero {
    padding-top: calc(var(--header-height) + 60px + env(safe-area-inset-top, 0px));
    padding-bottom: 60px;
    text-align: center;
    background: linear-gradient(135deg, var(--plum), var(--plum-light));
    color: white;
}


.page-hero h1 {
    color: white;
    margin-bottom: 12px;
}

.page-hero p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto;
}

/* Gallery Grid */
.gallery-full {
    padding-top: 60px;
    padding-bottom: 80px;
}

.gallery-masonry {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: dense;
    gap: 16px;
}

.gallery-masonry .gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

/* Large square on the right */
.gallery-masonry .gallery-item:nth-child(10n + 2) {
    grid-column: span 2;
    grid-row: span 2;
}

/* Large square on the left */
.gallery-masonry .gallery-item:nth-child(10n + 9) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-masonry .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-masonry .gallery-item:hover img {
    transform: scale(1.06);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-base);
    z-index: 2001;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lightbox-close:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.2);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 78vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.lightbox-caption {
    color: rgba(255, 255, 255, 0.8);
    margin-top: 16px;
    font-size: 1rem;
    text-align: center;
}


.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .gallery-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Reset desktop pattern */
    .gallery-masonry .gallery-item:nth-child(10n + 2),
    .gallery-masonry .gallery-item:nth-child(10n + 9) {
        grid-column: span 1;
        grid-row: span 1;
    }

    /* Smaller pattern for mobile */
    .gallery-masonry .gallery-item:nth-child(5n + 1) {
        grid-column: span 2;
        grid-row: span 2;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
}