/* Photo Gallery View */
.post-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
    width: 100%;
    margin: 10px 0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.post-gallery .gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
}

.post-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

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

.post-gallery .gallery-item .more-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    z-index: 2;
}

.post-gallery .gallery-item .more-overlay:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Single photo - full width */
.post-gallery.single {
    grid-template-columns: 1fr;
}

.post-gallery.single .gallery-item {
    aspect-ratio: auto;
}

.post-gallery.single .gallery-item img {
    max-height: 500px;
    object-fit: contain;
    background: #000;
}

/* Two photos */
.post-gallery.two {
    grid-template-columns: repeat(2, 1fr);
}

/* Three photos */
.post-gallery.three {
    grid-template-columns: repeat(3, 1fr);
}

/* Four photos */
.post-gallery.four {
    grid-template-columns: repeat(2, 1fr);
}

/* Five or more photos */
.post-gallery.five-plus {
    grid-template-columns: repeat(3, 1fr);
}

/* Blur effect */
.post-gallery.blurred .gallery-item img {
    filter: blur(20px);
    pointer-events: none;
}

.post-gallery.blurred .gallery-item .more-overlay {
    pointer-events: none;
}

.post-gallery.blurred .blur-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .post-gallery {
        gap: 2px;
    }
    
    .post-gallery.five-plus {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Animation */
@keyframes galleryFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.post-gallery .gallery-item {
    animation: galleryFadeIn 0.3s ease forwards;
}

.post-gallery .gallery-item:nth-child(1) { animation-delay: 0s; }
.post-gallery .gallery-item:nth-child(2) { animation-delay: 0.05s; }
.post-gallery .gallery-item:nth-child(3) { animation-delay: 0.1s; }
.post-gallery .gallery-item:nth-child(4) { animation-delay: 0.15s; }
.post-gallery .gallery-item:nth-child(5) { animation-delay: 0.2s; }
.post-gallery .gallery-item:nth-child(6) { animation-delay: 0.25s; }
.post-gallery .gallery-item:nth-child(7) { animation-delay: 0.3s; }
.post-gallery .gallery-item:nth-child(8) { animation-delay: 0.35s; }
.post-gallery .gallery-item:nth-child(9) { animation-delay: 0.4s; }

/* Lightbox Container */
.lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lb-preloader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
}
