/**
 * ACF Gallery Widget Styles
 * 
 * Styles for the ACF Gallery Widget with masonry layout and lightbox functionality.
 */

.acf-gallery-widget {
    margin: 20px 0;
    clear: both;
}

.acf-gallery-widget .widget-title {
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 600;
    color: #333;
}

.acf-gallery-widget .gallery {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.acf-gallery-widget .gallery-item {
    margin: 0 0 16px 16px;
    display: inline-block;
    vertical-align: top;
    width: calc(33.333% - 16px);
    position: relative;
}

.acf-gallery-widget .gallery-icon {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.acf-gallery-widget .gallery-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.acf-gallery-widget .gallery-icon img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.acf-gallery-widget .gallery-icon:hover img {
    transform: scale(1.05);
}

.acf-gallery-widget .gallery-caption {
    padding: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    margin: 0;
    border-radius: 0 0 8px 8px;
}

.acf-gallery-widget .gallery-icon a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.acf-gallery-widget .gallery-icon a:hover {
    text-decoration: none;
}

/* Empty state styling */
.acf-gallery-widget-empty {
    padding: 20px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    color: #666;
}

.acf-gallery-widget-empty p {
    margin: 0;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 768px) {
    .acf-gallery-widget .gallery-item {
        width: calc(50% - 16px);
    }
}

@media (max-width: 480px) {
    .acf-gallery-widget .gallery-item {
        width: calc(100% - 16px);
        margin-left: 0;
    }
    
    .acf-gallery-widget .widget-title {
        font-size: 1.3em;
    }
}

/* Masonry layout adjustments */
.acf-gallery-widget .masonry-gallery {
    column-gap: 16px;
}

.acf-gallery-widget .masonry-item {
    break-inside: avoid;
    margin-bottom: 16px;
}

/* Lightbox customizations */
.glightbox-clean .gslide-description {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    margin: 10px;
}

/* Loading state */
.acf-gallery-widget .gallery.loading {
    opacity: 0.7;
}

.acf-gallery-widget .gallery.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.acf-gallery-widget .gallery-icon a:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.acf-gallery-widget .gallery-icon img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    .acf-gallery-widget .gallery-icon {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .acf-gallery-widget .gallery-icon:hover {
        transform: none;
    }
}

