.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.lightbox-overlay.is-active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1002;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    min-height: 0;
}

.lightbox-image-container {
    max-width: 100%;
    max-height: 100%;
    position: relative;
}

.lightbox-image-container img {
    max-width: 90vw;
    max-height: calc(100vh - 180px);
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.3s;
    cursor: zoom-in;
}

.lightbox-image-container img.is-zoomed {
    cursor: zoom-out;
    transform: scale(2);
}

.lightbox-caption {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding: 0.5rem 1rem 0;
    font-style: italic;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    z-index: 1001;
}

.lightbox-nav:hover {
    opacity: 1;
}

.lightbox-prev {
    left: 0.5rem;
}

.lightbox-next {
    right: 0.5rem;
}

.lightbox-thumbnails {
    height: 80px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-shrink: 0;
}

.lightbox-thumbnails::-webkit-scrollbar {
    display: none;
}

.lightbox-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    scroll-snap-align: center;
    border: 2px solid transparent;
}

.lightbox-thumb:hover {
    opacity: 0.7;
}

.lightbox-thumb.is-active {
    opacity: 1;
    border-color: var(--wp--preset--color--accent, #d4a574);
}

.lightbox-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    z-index: 1002;
}

@media (max-width: 768px) {
    .lightbox-main {
        padding: 1rem;
    }

    .lightbox-nav {
        font-size: 1.5rem;
        padding: 0.5rem;
    }

    .lightbox-image-container img {
        max-height: calc(100vh - 160px);
    }
}
