/* Gallery Page Specific Styles (gallery.css) */

.gallery-page {
    background-color: var(--color-secondary);
}

.masonry-grid {
    column-count: 3;
    column-gap: 20px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 10px 30px rgba(59,66,49,0.05);
}

/* Base image styling */
.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s ease;
    filter: brightness(0.95);
}

/* The elegant overlay on hover */
.gallery-item-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(59,66,49,0.2) 0%, rgba(26,28,22,0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-item-overlay span {
    color: var(--color-secondary);
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--color-accent);
    transform: translateY(20px);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img {
    transform: scale(1.05); /* very subtle scale */
    filter: brightness(1);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

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

/* Lightbox Styling */
#lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(26,28,22,0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    cursor: zoom-out;
}

#lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

#lightbox img {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    border-radius: 4px;
    transform: scale(0.95);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#lightbox.active img {
    transform: scale(1);
}

/* Lightbox close indicator */
#lightbox::after {
    content: 'Close';
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--color-secondary);
    font-family: var(--font-body);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.85rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

#lightbox:hover::after {
    opacity: 1;
}

@media (max-width: 991px) {
    .masonry-grid { column-count: 2; column-gap: 15px; }
    .gallery-item { margin-bottom: 15px; }
}

@media (max-width: 576px) {
    .masonry-grid { column-count: 1; }
    #lightbox img { max-width: 95%; }
    #lightbox::after { top: 20px; right: 20px; font-size: 0.75rem; }
}
