/* Post Gallery Styles */
.spnc-post-gallery-wrapper {
    margin: 30px 0;
    clear: both;
}

.spnc-post-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.spnc-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    aspect-ratio: 1;
    background: #f5f5f5;
}

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

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

.spnc-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

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

.spnc-gallery-overlay i {
    color: #fff;
    font-size: 2rem;
}

.spnc-gallery-lightbox {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Lightbox Styles */
.spnc-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.spnc-lightbox-overlay.active {
    opacity: 1;
    display: flex !important;
}

.spnc-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spnc-lightbox-image-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: move;
    -webkit-overflow-scrolling: touch;
}

.spnc-lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    cursor: move;
    display: block;
}

.spnc-lightbox-close,
.spnc-lightbox-prev,
.spnc-lightbox-next,
.spnc-lightbox-zoom-in,
.spnc-lightbox-zoom-out {
    position: fixed;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    z-index: 1000000;
    line-height: 1;
    padding: 0;
}

.spnc-lightbox-close:hover,
.spnc-lightbox-zoom-in:hover,
.spnc-lightbox-zoom-out:hover {
    background: transparent;
    transform: scale(1.2);
}

.spnc-lightbox-zoom-in {
    top: 80px;
    left: 20px;
    font-size: 2rem;
}

.spnc-lightbox-zoom-out {
    top: 140px;
    left: 20px;
    font-size: 2rem;
}


.spnc-lightbox-close {
    top: 20px;
    left: 20px;
    font-size: 2.5rem;
}

.spnc-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.spnc-lightbox-prev:hover {
    transform: translateY(-50%) scale(1.2);
}

.spnc-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.spnc-lightbox-next:hover {
    transform: translateY(-50%) scale(1.2);
}

.spnc-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
}

/* RTL Support */
body.rtl .spnc-lightbox-close,
[dir="rtl"] .spnc-lightbox-close {
    left: auto;
    right: 20px;
}

body.rtl .spnc-lightbox-zoom-in,
[dir="rtl"] .spnc-lightbox-zoom-in {
    left: auto;
    right: 20px;
}

body.rtl .spnc-lightbox-zoom-out,
[dir="rtl"] .spnc-lightbox-zoom-out {
    left: auto;
    right: 20px;
}


body.rtl .spnc-lightbox-prev,
[dir="rtl"] .spnc-lightbox-prev {
    right: auto;
    left: 20px;
}

body.rtl .spnc-lightbox-next,
[dir="rtl"] .spnc-lightbox-next {
    left: auto;
    right: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .spnc-post-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .spnc-lightbox-close,
    .spnc-lightbox-prev,
    .spnc-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .spnc-lightbox-close {
        top: 10px;
        left: 10px;
    }
    
    .spnc-lightbox-prev {
        left: 10px;
    }
    
    .spnc-lightbox-next {
        right: 10px;
    }
}

