/**
 * Lightbox Styles - Simple Image Viewer
 */

/* Lightbox Overlay */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* Caption */
.lightbox-caption {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 16px 24px;
    margin-top: 16px;
    border-radius: 4px;
    max-width: 600px;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
}

/* Close Button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10000;
    line-height: 1;
    padding-bottom: 4px;
}

.lightbox-close:hover {
    background: rgba(200, 16, 46, 0.8);
    transform: rotate(90deg);
}

/* Navigation Arrows */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 10000;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(200, 16, 46, 0.8);
}

.lightbox-prev.disabled,
.lightbox-next.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Loading Spinner */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 48px;
}

/* Photo Grid - Use thumbnails */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

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

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

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

.photo-caption {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Photo Gallery (for martyr/event pages) */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.photo-gallery .photo-item {
    aspect-ratio: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .lightbox-image {
        max-height: 70vh;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        padding: 12px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption {
        font-size: 14px;
        padding: 12px 16px;
        margin-top: 12px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}
