/* Ultimate Masonry Gallery - Frontend Styles */
.masonry-gallery {
    margin: 20px auto;
    width: 100%;
    opacity: 0;
    transition: opacity var(--animation-speed, 300ms) ease;
}

.masonry-gallery.loaded {
    opacity: 1;
}

.grid-sizer,
.gallery-item {
    width: calc(100% / var(--columns, 3) - 1px);
    margin-bottom: var(--gutter, 15px);
    padding: 0 calc(var(--gutter, 15px)/2);
    box-sizing: border-box;
}

.gallery-item {
    transition: transform calc(var(--animation-speed, 300ms) * 0.5) ease;
}

.gallery-item a,
.gallery-image-wrapper {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all calc(var(--animation-speed, 300ms) * 0.5) ease;
}

.gallery-item a:hover,
.gallery-item:hover .gallery-image-wrapper {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform calc(var(--animation-speed, 300ms) * 0.5) ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-caption {
    padding: 8px 0;
    font-size: 14px;
    color: #555;
    text-align: center;
    transition: all calc(var(--animation-speed, 300ms) * 0.5) ease;
}

/* Loading state */
.gallery-item img[loading="lazy"] {
    background: #f5f5f5;
    min-height: 100px;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .grid-sizer,
    .gallery-item {
        width: calc(100% / var(--columns-tablet, 2) - 1px) !important;
    }
}

@media (max-width: 767px) {
    .grid-sizer,
    .gallery-item {
        width: calc(100% / var(--columns-mobile, 1) - 1px) !important;
        margin-bottom: var(--gutter-mobile, 10px);
    }
    
    .masonry-gallery:not(.mobile-animation) .gallery-item {
        transition: none !important;
    }
    
    .masonry-gallery:not(.mobile-animation) .gallery-item a,
    .masonry-gallery:not(.mobile-animation) .gallery-item img,
    .masonry-gallery:not(.mobile-animation) .gallery-caption {
        transition: none !important;
    }
}

/* Lightbox overrides */
.lb-data .lb-caption {
    font-size: 16px;
    line-height: 1.4;
    max-width: 600px;
}

.lb-nav a.lb-prev,
.lb-nav a.lb-next {
    opacity: 0.9;
}

/* Mobile lightbox specific styles */
@media (max-width: 767px) {
    .lb-outerContainer {
        max-width: 90vw !important;
        max-height: 90vh !important;
    }
    
    .lb-container {
        padding: 15px !important;
    }
    
    .lb-nav a.lb-prev,
    .lb-nav a.lb-next {
        width: 30% !important;
    }
    
    .lb-data .lb-close {
        display: var(--mobile-close-button, block) !important;
        right: 10px !important;
        top: 10px !important;
    }
}