/* ==================== Modern Gallery Styles ==================== */

/* Masonry Gallery Layout */
.gallery-modern {
    columns: 3 !important;
    column-gap: 20px !important;
    margin-bottom: 40px !important;
}

.gallery-modern .gallery-item {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    margin-bottom: 20px !important;
    break-inside: avoid !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: transform 0.3s ease !important;
    border-radius: 8px !important;
}

.gallery-modern .gallery-item:hover {
    transform: translateY(-5px);
}

/* Image Container */
.gallery-modern .image-container {
    position: relative !important;
    width: 100% !important;
    overflow: hidden !important;
    border-radius: 8px !important;
}

.gallery-modern .image-container img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    transition: transform 0.4s ease !important;
}

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

/* Subtle Hover Overlay */
.gallery-modern .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Minimal Lightbox */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    background: rgba(0, 0, 0, 0.95);
}

.gallery-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px 20px;
}

.lightbox-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90vw;
    height: calc(90vh - 80px);
}

.lightbox-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    touch-action: manipulation;
}

/* Lightbox Controls */
.lightbox-close {
    position: fixed;
    top: 100px;
    right: 30px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 1.1rem;
}

.lightbox-close:hover {
    background: #a52422;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 20px rgba(165, 36, 34, 0.5);
}

.lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .gallery-modern {
        columns: 2 !important;
        column-gap: 15px !important;
    }
    
    .gallery-modern .gallery-item {
        margin-bottom: 15px !important;
    }
}

@media (max-width: 768px) {
    .gallery-modern {
        columns: 2 !important;
        column-gap: 15px !important;
    }
    
    .gallery-modern .gallery-item {
        margin-bottom: 15px !important;
    }
    
    .gallery-lightbox.active {
        padding: 60px 10px 10px 10px;
    }
    
    .lightbox-container {
        width: 95vw;
        height: calc(90vh - 60px);
    }
    
    .lightbox-close {
        position: fixed !important;
        top: 80px !important;
        right: 20px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 1rem !important;
        z-index: 10001 !important;
        background: rgba(0, 0, 0, 0.9) !important;
        backdrop-filter: blur(10px);
        color: white !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
    }
    
    .lightbox-counter {
        bottom: 20px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .gallery-modern {
        columns: 1 !important;
        column-gap: 10px !important;
    }
    
    .gallery-modern .gallery-item {
        margin-bottom: 10px !important;
    }
}
