/* The image viewer of the site (brandbook 8.46): js/bk-lightbox.js, markup views/bkLightbox.html - on every page.
   The picture is shown by Viewer.js (js/viewerjs/viewer.min.css is loaded before this file), the buttons are ours. */

/* Viewer.js: the backdrop, the picture, the animation */
.viewer-backdrop {
    background: rgba(0, 0, 0, .9);
}

.viewer-container.viewer-transition,
.viewer-canvas > img.viewer-transition {
    transition-duration: .2s;
    transition-timing-function: ease-out;
}

.viewer-canvas > img {
    background: #fff; /* under the transparent pictures */
    box-shadow: 0 0 24px rgba(0, 0, 0, .5);
}

.viewer-tooltip {
    border-radius: 0;
    background: rgba(0, 0, 0, .7);
    font-size: 14px;
}

/* our buttons inside the container of Viewer.js: the layer does not catch the clicks - the backdrop closes */
.fb-lightbox {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fb-lightbox[hidden] {
    display: none;
}

.fb-lightbox__btn {
    position: absolute;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color .15s;
}

.fb-lightbox__btn:hover {
    background: rgba(255, 255, 255, .3);
}

.fb-lightbox__btn:focus {
    outline: none;
}

.fb-lightbox__btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .6);
}

.fb-lightbox__btn[hidden] {
    display: none;
}

.fb-lightbox__close { top: 16px; right: 16px; }
.fb-lightbox__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.fb-lightbox__next { right: 16px; top: 50%; transform: translateY(-50%); }

/* at the top, in the line of the close button: "caption - 2 / 5"; at the bottom - the row of the tools */
.fb-lightbox__counter {
    position: absolute;
    top: 16px;
    left: 72px;
    right: 72px;
    color: #ccc;
    font-size: 14px;
    line-height: 44px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fb-lightbox__footer {
    position: absolute;
    left: 72px;
    right: 72px;
    bottom: 16px;
    display: flex;
    justify-content: center;
}

.fb-lightbox__tools {
    display: flex;
    gap: 8px;
}

.fb-lightbox__tool {
    position: static;
    width: 40px;
    height: 40px;
    font-size: 17px;
}

.fb-lightbox__tool span {
    font-size: 13px;
    font-weight: 600;
}

/* the pictures of a text open in the viewer (js/bk-lightbox.js) */
.bk-post__text img:not(.forum-smile),
.fb-post__text img:not(.forum-smile),
.fb-comment__text img:not(.forum-smile) {
    cursor: zoom-in;
}

@media (max-width: 575px) {
    /* the arrows at the bottom corners, between them the tools; zoom - by the fingers */
    .fb-lightbox__close { top: 8px; right: 8px; }

    .fb-lightbox__counter {
        top: 8px;
        left: 16px;
        right: 60px;
        text-align: left;
    }

    .fb-lightbox__prev,
    .fb-lightbox__next {
        top: auto;
        bottom: 8px;
        transform: none;
    }

    .fb-lightbox__prev { left: 8px; }
    .fb-lightbox__next { right: 8px; }

    .fb-lightbox__footer {
        left: 60px;
        right: 60px;
        bottom: 10px; /* the middle in the line of the arrows */
    }

    .fb-lightbox__tool--zoom {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .viewer-container.viewer-transition,
    .viewer-canvas > img.viewer-transition {
        transition: none !important;
    }
}
