/* Lightbox Styles */
.lightbox-modal {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    user-select: none; /* Prevent selection during swipe */
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: transparent;
    border: none;
    line-height: 1;
    padding: 10px;
    z-index: 10000;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 60px;
    cursor: pointer;
    padding: 20px;
    z-index: 10000;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 10px;
}

.lightbox-next {
    right: 10px;
}

/* Hide arrows on touch devices if preferred, or keep them */
@media (hover: none) and (pointer: coarse) {
    .lightbox-nav {
        display: none; /* Rely on swipe */
    }
}

.lightbox-info {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    color: white;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.lightbox-caption {
    font-size: 1.1rem;
    margin: 0;
    padding: 0 20px;
}

.lightbox-author {
    pointer-events: auto;
    font-size: 0.9rem;
    font-weight: bold;
    color: #11d411; /* Primary color */
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 99px;
    transition: background 0.2s, color 0.2s;
}

.lightbox-author:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #111811;
}