/* Album lightbox */

@media (prefers-reduced-motion: reduce) {
    .ws-album-lightbox__image {
        animation: none !important;
        transition: none !important;
    }
}

.ws-album-lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: var(--ws-album-lightbox-viewport-height, 100vh);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: rgba(8, 10, 14, 0.76);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 10000;
}

.ws-album-lightbox.is-active {
    opacity: 1;
    pointer-events: auto;
}

.ws-album-lightbox__backdrop {
    position: absolute;
    inset: 0;
}

.ws-album-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(12, 13, 18, 0.92);
    padding: clamp(1rem, 2.6vw, 1.6rem);
    box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.7);
}

.ws-album-lightbox__figure {
    margin: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.ws-album-lightbox__image {
    max-width: min(100%, 1400px);
    max-height: calc(var(--ws-album-lightbox-viewport-height, 100vh) - 10.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
    background: #0b0c10;
    opacity: 1;
    transform: scale(1);
    transition: transform 0.35s ease, opacity 0.35s ease;
    will-change: transform;
}

.ws-album-lightbox__image:not([src]),
.ws-album-lightbox__image[src=""] {
    opacity: 0;
}

.ws-album-lightbox__image.is-loaded {
    opacity: 1;
    transform: scale(1);
}

.ws-album-lightbox__caption {
    margin: 0.6rem 0 0;
    text-align: center;
    color: #f4f2f0;
    font-size: 0.95rem;
    line-height: 1.45;
}

.ws-album-lightbox__counter {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.ws-album-lightbox__close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 2.25rem;
    height: 2.25rem;
    color: #ffffff;
    font-size: 1.4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    background: transparent;
    z-index: 1;
}

.ws-album-lightbox__autoplay {
    position: absolute;
    top: 0.65rem;
    right: 3.35rem;
    width: 2.25rem;
    height: 2.25rem;
    color: #ffffff;
    font-size: 1.05rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    outline: none;
    background: transparent;
    z-index: 1;
}

.ws-album-lightbox__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    height: 1.1rem;
    line-height: 1;
}

.ws-album-lightbox__icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.ws-album-lightbox__autoplay .ws-album-lightbox__icon--play {
    display: none;
}

.ws-album-lightbox__autoplay.is-paused .ws-album-lightbox__icon--pause {
    display: none;
}

.ws-album-lightbox__autoplay.is-paused .ws-album-lightbox__icon--play {
    display: inline;
}

.ws-album-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.6rem;
    height: 2.6rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 999px;
    z-index: 12;
}

.ws-album-lightbox__nav svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ws-album-lightbox__nav--prev {
    left: 0.8rem;
}

.ws-album-lightbox__nav--next {
    right: 0.8rem;
}

.ws-album-lightbox__thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem 0.1rem 0.2rem;
    overflow-x: auto;
}

.ws-album-lightbox__thumb {
    flex: 0 0 auto;
    width: 68px;
    height: 52px;
    border: 2px solid #fff;
    background: rgba(255, 255, 255, 0.08);
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    border-radius: 4px;
}

.ws-album-lightbox__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ws-album-lightbox__thumb.is-active {
    border-color: var(--primary-light);
}

body.ws-album-lightbox-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .ws-album-lightbox__dialog {
        padding: 0.9rem 0.9rem 0.7rem;
    }

    .ws-album-lightbox__image {
        max-height: calc(var(--ws-album-lightbox-viewport-height, 100vh) - 9rem);
    }

    .ws-album-lightbox__thumb {
        width: 56px;
        height: 44px;
    }
}