.gallery-img {
    cursor: pointer;
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.lightbox.open {
    display: flex;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 95vh;
}

.lightbox-image-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.lightbox img {
    display: block;
    max-width: 85vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    user-select: none;
}

#lightbox-caption {
    color: white;
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.4;
    text-align: center;
    max-width: 85vw;
}

.lightbox button {
    flex: 0 0 auto;
    font-size: 40px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    padding: 20px;
}

.lightbox button:hover {
    color: #999999;
}

.lightbox button:active {
    color: #333333;
}

/* Invisible tap zones for mobile */
.mobile-tap-zone {
    display: none;
}

@media (max-width: 600px) {
    .lightbox {
        padding: 10px;
    }

    .lightbox button {
        display: none;
    }

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

    .lightbox img {
        max-width: 96vw;
        max-height: 85vh;
    }

    #lightbox-caption {
        max-width: 92vw;
        font-size: 14px;
        margin-top: 10px;
    }

    .lightbox-image-wrap {
        position: relative;
    }

    .mobile-tap-zone {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        width: 30%;
        z-index: 2;
    }

    .mobile-tap-left {
        left: 0;
    }

    .mobile-tap-right {
        right: 0;
    }
}
