/* Shared gallery modal + lightbox styles */

.gallery-modal {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gallery-modal.gallery-page {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

body.gallery-open {
    overflow: hidden;
}

.masonry-grid {
    column-count: 1;
    column-gap: 1.5rem;
}

@media (min-width: 640px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        column-count: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    cursor: pointer;
}

.masonry-item.is-hidden {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.image-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(27, 48, 34, 0.88);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.image-lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 9999px;
    background: rgba(249, 246, 240, 0.95);
    color: #1B3022;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.image-lightbox-close:hover {
    background: #C5A059;
    color: #1B3022;
    transform: scale(1.05);
}

.image-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: rgba(249, 246, 240, 0.95);
    color: #1B3022;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.image-lightbox-prev {
    left: 1.25rem;
}

.image-lightbox-next {
    right: 1.25rem;
}

.image-lightbox-nav:hover {
    background: #C5A059;
    color: #1B3022;
    transform: translateY(-50%) scale(1.08);
}

.image-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox-img {
    max-width: 100%;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transform: scale(0.88) translateY(16px);
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.image-lightbox.is-open .image-lightbox-img {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.image-lightbox.is-closing .image-lightbox-img {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
