/* Pure CSS Lightbox - No JavaScript Required */

/* Prevent scroll jump when closing lightbox */
html {
    scroll-behavior: smooth;
}

/* Lightbox Container with permanent black background */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    /* No transition at all to eliminate flickering */
}

/* Show lightbox when targeted - instant visibility */
.lightbox:target {
    opacity: 1;
    visibility: visible;
}

/* Hide navigation when any lightbox is active */
.lightbox:target ~ main header {
    display: none;
}

/* Lightbox Content */
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 70vw;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Make gallery images clickable */
.image-item a {
    display: block;
    text-decoration: none;
}

.image-item img {
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

/* Close Button - Improved Design */
.lightbox-close {
    position: absolute;
    top: -60px;
    right: -10px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lightbox-close:hover {
    background: #fff;
    color: #ff4444;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Navigation Arrows - Improved Design */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-decoration: none;
    font-size: 30px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lightbox-nav:hover {
    background: #fff;
    color: #007bff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

/* Image Description */
.lightbox-description {
    position: absolute;
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 18px;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 25px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .lightbox-close {
        top: -50px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
    
    .lightbox-description {
        bottom: -60px;
        font-size: 14px;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .lightbox-content {
        max-width: 90%;
        max-height: 75%;
    }
    
    .lightbox-close {
        top: -40px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-description {
        bottom: -50px;
        font-size: 12px;
        padding: 8px 15px;
    }
}