.hb-image-gallery {
    --hb-image-hover-outline: #50c8d6;
}

.hb-image-link {
    cursor: zoom-in !important;
    display: block;
    text-decoration: none;
}

.hb-image-link * {
    cursor: zoom-in !important;
}

.hb-image-frame {
    align-items: center;
    aspect-ratio: 1 / 1;
    background: #f7fafc;
    display: block;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.hb-image-frame::before {
    color: #6b7280;
    content: "Зареждане...";
    font-size: .95rem;
    font-weight: 700;
    left: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
}

.hb-image-frame.is-loaded::before {
    content: "";
}

.hb-image-thumb {
    display: block;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .18s ease;
    width: 100%;
}

.hb-image-frame.is-loaded .hb-image-thumb {
    opacity: 1;
}

.hb-image-link:focus-visible {
    outline: 3px solid var(--hb-image-hover-outline);
    outline-offset: 3px;
}

.hb-image-viewer {
    --hb-image-viewer-caption-height: 0px;
    --hb-image-viewer-viewport-height: 100vh;
    align-items: center;
    background: rgba(0, 0, 0, .88);
    bottom: 0;
    display: none;
    justify-content: center;
    left: 0;
    padding: 36px 88px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 10000;
}

.hb-image-viewer.is-open {
    display: flex;
}

.hb-image-viewer__frame {
    align-items: center;
    display: flex;
    flex-direction: column;
    max-width: calc(100vw - 176px);
    overflow: hidden;
    position: relative;
    width: calc(100vw - 176px);
    z-index: 1;
}

.hb-image-viewer__track {
    height: calc(100vh - 180px);
    position: relative;
    transform: translateX(0);
    transition: transform .18s ease;
    width: 100%;
    will-change: transform;
}

.hb-image-viewer__track.is-dragging {
    transition: none;
}

.hb-image-viewer__slide {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    min-width: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.hb-image-viewer__slide--prev {
    left: -100%;
}

.hb-image-viewer__slide--current {
    left: 0;
}

.hb-image-viewer__slide--next {
    left: 100%;
}

.hb-image-viewer__image {
    display: block;
    max-height: calc(100vh - 180px);
    max-width: 100%;
    object-fit: contain;
}

.hb-image-viewer__caption {
    background: rgba(0, 0, 0, .5);
    bottom: 0;
    box-sizing: border-box;
    color: #ffffff;
    font-weight: 700;
    left: 0;
    line-height: 1.45;
    padding: 16px 24px;
    position: absolute;
    right: 0;
    text-align: center;
    z-index: 2;
}

.hb-image-viewer__caption-title {
    display: -webkit-box;
    font-size: 1.2rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hb-image-viewer__caption-time {
    color: #de7d3a;
    font-size: 1rem;
    margin-top: 4px;
}

.hb-image-viewer__caption-comment {
    color: rgba(255, 255, 255, .86);
    display: -webkit-box;
    font-size: 1.2rem;
    font-weight: 400;
    margin-top: 8px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hb-image-viewer__button {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .42);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font-size: 3rem;
    font-weight: 700;
    height: 64px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    width: 64px;
    z-index: 3;
}

.hb-image-viewer__button:hover,
.hb-image-viewer__button:focus {
    background: rgba(80, 200, 214, .32);
    outline: none;
}

.hb-image-viewer__button--prev {
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.hb-image-viewer__button--next {
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.hb-image-viewer__button--close {
    background: rgba(0, 0, 0, .56);
    border-color: rgba(255, 255, 255, .55);
    font-size: 2.5rem;
    height: 52px;
    right: 24px;
    top: 24px;
    width: 52px;
}

body.hb-image-viewer-open {
    overflow: hidden;
}

body.hb-image-viewer-locked {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

@media (max-width: 767.98px) {
    .hb-image-viewer {
        align-items: flex-start;
        height: var(--hb-image-viewer-viewport-height);
        overscroll-behavior: contain;
        padding: 0;
    }

    .hb-image-viewer__image {
        height: auto;
        max-height: calc(var(--hb-image-viewer-viewport-height) - var(--hb-image-viewer-caption-height));
        width: 100vw;
    }

    .hb-image-viewer__frame {
        height: var(--hb-image-viewer-viewport-height);
        max-height: var(--hb-image-viewer-viewport-height);
        max-width: 100vw;
        width: 100vw;
    }

    .hb-image-viewer__track {
        height: calc(var(--hb-image-viewer-viewport-height) - var(--hb-image-viewer-caption-height));
        width: 100vw;
    }

    .hb-image-viewer__slide {
        align-items: center;
        width: 100vw;
    }

    .hb-image-viewer__caption {
        padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    }

    .hb-image-viewer__caption-title {
        font-size: 1rem;
    }

    .hb-image-viewer__caption-comment {
        font-size: 1rem;
    }

    .hb-image-viewer__button {
        background: transparent;
        border: 0;
        font-size: 2.4rem;
        height: 44px;
        width: 44px;
    }

    .hb-image-viewer__button:hover,
    .hb-image-viewer__button:focus {
        background: transparent;
    }

    .hb-image-viewer__button--prev {
        left: 8px;
        top: calc((var(--hb-image-viewer-viewport-height) - var(--hb-image-viewer-caption-height)) / 2);
    }

    .hb-image-viewer__button--next {
        right: 8px;
        top: calc((var(--hb-image-viewer-viewport-height) - var(--hb-image-viewer-caption-height)) / 2);
    }

    .hb-image-viewer__button--close {
        background: rgba(0, 0, 0, .58);
        border: 1px solid rgba(255, 255, 255, .28);
        font-size: 2rem;
        height: 42px;
        right: 10px;
        top: 10px;
        width: 42px;
    }
}
