/**
 * Frontend CSS for Community Gallery plugin
 */

/* Gallery Container */
.community-gallery-container {
    width: 100%;
    max-width: 100%;
}

/* Grid Layout */
.community-gallery-container .community-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Default 4 columns */
    grid-gap: 20px;
    width: 100%;
}

/* Gallery Items */
.community-gallery-container .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.community-gallery-container .gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.community-gallery-container .gallery-item a {
    display: block;
    text-decoration: none;
}

.community-gallery-container .gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.community-gallery-container .gallery-item:hover img {
    transform: scale(1.05);
}

/* Caption */
.community-gallery-container .gallery-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 15px 10px 10px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.community-gallery-container .gallery-item:hover .gallery-item-caption {
    transform: translateY(0);
}

.community-gallery-container .gallery-item-author {
    font-size: 12px;
    opacity: 0.9;
}

/* Pagination */
.community-gallery-pagination {
    text-align: center;
    margin-top: 30px;
}

.community-gallery-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 3px;
    background: #f7f7f7;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.community-gallery-pagination .page-numbers:hover,
.community-gallery-pagination .page-numbers.current {
    background: #0073aa;
    color: white;
}

/* No Items Message */
.community-gallery-container .no-gallery-items {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Responsive Breakpoints */
@media (max-width: 1200px) {
    .community-gallery-container .community-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .community-gallery-container .community-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-gap: 15px;
    }
}

@media (max-width: 480px) {
    .community-gallery-container .community-gallery-grid {
        grid-template-columns: 1fr;
        grid-gap: 10px;
    }
}

/* Elementor Column Control Support */
.elementor-widget-community_gallery .community-gallery-grid {
    display: grid !important;
    width: 100% !important;
}

/* Fallback for when Elementor controls aren't applied */
.community-gallery-grid:not([style*="grid-template-columns"]) {
    grid-template-columns: repeat(4, 1fr) !important;
}

/* Tablet responsive fallback */
@media (max-width: 1024px) {
    .community-gallery-grid:not([style*="grid-template-columns"]) {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Mobile responsive fallback */
@media (max-width: 767px) {
    .community-gallery-grid:not([style*="grid-template-columns"]) {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}