/* 
 * Custom Gallery Grid Styles
 * Save this as gallery-style.css in your theme folder
 */

/* Gallery Container */
.custom-gallery-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Category Filter Buttons */
.gallery-filters {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-filters button {
    background: #ffffff;
    border: 2px solid #178e79;
    color: #178e79;
    padding: 10px 25px;
    margin: 5px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.gallery-filters button:hover {
    background: #178e79;
    color: #ffffff;
    border-color: #178e79;
}

.gallery-filters button.active {
    background: #178e79;
    color: #ffffff;
    border-color: #178e79;
}

/* Grid Layout - 3 Columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f9f9f9;
    aspect-ratio: 1 / 1; /* Square items */
}

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

/* Image/Video Container */
.gallery-item-media {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* Video Icon Overlay */
.gallery-item.is-video::after {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.5);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    pointer-events: none;
    transition: all 0.3s ease;
}

.gallery-item.is-video:hover::after {
    background: rgba(0, 0, 0, 0.7);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Item Title Overlay */
.gallery-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 15px;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Category Badge */
.gallery-item-category {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(23, 142, 121, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-filters button {
        padding: 8px 15px;
        font-size: 12px;
        margin: 3px;
    }
}

/* Loading State */
.gallery-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #999;
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.gallery-empty h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

/* Animation for filter */
.gallery-item.hiding {
    animation: fadeOut 0.3s ease;
}

.gallery-item.showing {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}