/* Стилове за преглед на изображения в увеличен изглед. */
:root {
    --slb-accent: #c79b55;
}
body.slb-lock {
    overflow: hidden !important;
}
.slb-trigger {
    cursor: zoom-in;
}
.site-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: rgba(7, 7, 8, 0.94);
    color: #fff;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    backdrop-filter: blur(18px);
    overscroll-behavior: contain;
}
.site-lightbox.is-open {
    display: grid;
}
.slb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    z-index: 3;
}
.slb-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.slb-counter {
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.slb-caption {
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slb-actions {
    display: flex;
    gap: 8px;
}
.slb-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid #ffffff35;
    border-radius: 50%;
    background: #ffffff12;
    color: #fff;
    font: 700 23px/1 system-ui;
    cursor: pointer;
    transition:
        background 0.2s,
        color 0.2s,
        transform 0.2s;
}
.slb-button:hover,
.slb-button:focus-visible {
    background: #fff;
    color: #111;
    outline: none;
    transform: scale(1.04);
}
.slb-stage {
    position: relative;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 8px 80px;
    touch-action: pan-y;
}
.slb-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 25px 80px #000;
    user-select: none;
    transition:
        transform 0.25s ease,
        opacity 0.18s;
    cursor: zoom-in;
}
.site-lightbox.is-zoomed .slb-image {
    transform: scale(1.7);
    cursor: zoom-out;
}
.slb-prev,
.slb-next {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
}
.slb-prev:hover,
.slb-next:hover {
    transform: translateY(-50%) scale(1.04);
}
.slb-prev {
    left: 20px;
}
.slb-next {
    right: 20px;
}
.slb-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 12px max(18px, calc((100vw - 900px) / 2));
    background: #0005;
}
.slb-thumb {
    flex: 0 0 58px;
    width: 58px;
    height: 68px;
    padding: 3px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #ffffff0d;
    cursor: pointer;
    opacity: 0.55;
    transition: 0.2s;
}
.slb-thumb:hover {
    opacity: 1;
}
.slb-thumb.is-active {
    opacity: 1;
    border-color: var(--slb-accent);
    background: #ffffff20;
}
.slb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 5px;
}
.slb-help {
    position: absolute;
    left: 50%;
    bottom: 92px;
    z-index: 3;
    transform: translateX(-50%);
    padding: 7px 12px;
    border-radius: 999px;
    background: #000a;
    color: #ddd;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
}
.site-lightbox.is-open .slb-help {
    animation: slb-help 4s ease;
}
@keyframes slb-help {
    0%,
    75% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
@media (max-width: 760px) {
    .slb-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px;
    }
    .slb-meta {
        gap: 8px;
        min-width: 0;
    }
    .slb-counter {
        font-size: 12px;
    }
    .slb-caption {
        display: block;
        min-width: 0;
        overflow: hidden;
        color: #fff;
        font-size: 13px;
        font-weight: 800;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .slb-actions {
        gap: 4px;
    }
    .slb-actions .slb-zoom,
    .slb-actions .slb-full {
        display: none;
    }
    .slb-stage {
        padding: 6px 54px;
    }
    .slb-prev {
        left: 7px;
    }
    .slb-next {
        right: 7px;
    }
    .slb-button {
        width: 40px;
        height: 40px;
    }
    .slb-image {
        max-height: calc(100vh - 170px);
    }
    .slb-thumbs {
        padding: 10px;
    }
    .slb-help {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .slb-button,
    .slb-image,
    .slb-thumb {
        transition: none;
    }
    .site-lightbox.is-open .slb-help {
        animation: none;
    }
}
