﻿/* VabletLightbox - glass styling. No dependencies; scoped to .vlb so Bootstrap 3 is not affected. */

/* border-radius uses !important on purpose: the Metronic theme sets border-radius with !important on
   plain elements (div, button, img, pre...). Our class selectors are more specific, so they win the
   !important tie without touching anything outside .vlb. */

html.vlb-lock {
    overflow: hidden;
}

dialog.vlb {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    background: transparent;
    color: #fff;
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    opacity: 0;
    transition: opacity .22s ease;
}

    dialog.vlb *,
    dialog.vlb *::before,
    dialog.vlb *::after {
        box-sizing: border-box;
    }

    dialog.vlb [hidden] {
        display: none !important;
    }

    dialog.vlb.vlb--open {
        opacity: 1;
    }

    /* The page behind is blurred once, as a single backdrop layer. */
    dialog.vlb::backdrop {
        background: rgba(8, 10, 22, .46);
        -webkit-backdrop-filter: blur(26px) saturate(1.5);
        backdrop-filter: blur(26px) saturate(1.5);
        opacity: 0;
        transition: opacity .22s ease;
    }

    dialog.vlb.vlb--open::backdrop {
        opacity: 1;
    }

/* ---------- glass material ---------- */

.vlb .vlb-glass {
    color: #fff;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .3);
    -webkit-backdrop-filter: blur(22px) saturate(1.8);
    backdrop-filter: blur(22px) saturate(1.8);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 10px 34px rgba(0, 0, 0, .28);
}

.vlb .vlb-glass--dark {
    background: rgba(22, 24, 36, .62);
    border-color: rgba(255, 255, 255, .16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 34px rgba(0, 0, 0, .35);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .vlb .vlb-glass {
        background: rgba(58, 62, 80, .9);
    }

    .vlb .vlb-glass--dark {
        background: rgba(22, 24, 36, .94);
    }
}

@media (prefers-reduced-transparency: reduce) {
    dialog.vlb::backdrop {
        background: rgba(8, 10, 22, .88);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .vlb .vlb-glass {
        background: rgba(58, 62, 80, .96);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .vlb .vlb-glass--dark {
        background: rgba(22, 24, 36, .97);
    }
}

/* ---------- layout ---------- */

.vlb__stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 84px 24px 36px;
}

.vlb__content {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .vlb__content > * {
        animation: vlb-pop .3s cubic-bezier(.2, .8, .2, 1) both;
    }

.vlb__top {
    position: absolute;
    z-index: 3;
    top: max(14px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

    .vlb__top > * {
        pointer-events: auto;
    }

.vlb__title {
    max-width: min(62%, 680px);
    height: 44px;
    padding: 0 20px;
    border-radius: 22px !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 42px;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .vlb__title:empty {
        visibility: hidden;
    }

.vlb__tools {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.vlb__actions {
    display: flex;
    gap: 2px;
    height: 44px;
    padding: 3px;
    border-radius: 22px !important;
}

/* ---------- buttons ---------- */

.vlb .vlb__btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50% !important;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

    .vlb .vlb__btn svg {
        width: 20px;
        height: 20px;
    }

.vlb .vlb__close, .vlb .vlb__nav {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .3);
}

    .vlb .vlb__close.vlb-glass, .vlb .vlb__nav.vlb-glass {
        background: rgba(255, 255, 255, .16);
    }

.vlb .vlb__nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    margin-top: -22px;
    width: 48px;
    height: 48px;
}

.vlb .vlb__prev {
    left: 18px;
}

.vlb .vlb__next {
    right: 18px;
}

.vlb .vlb__btn:hover, .vlb .vlb__close.vlb-glass:hover, .vlb .vlb__nav.vlb-glass:hover {
    background: rgba(255, 255, 255, .28);
}

.vlb .vlb__btn:active {
    transform: scale(.92);
}

.vlb .vlb__btn:focus-visible, .vlb .vlb__pill:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.vlb .vlb__pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font: 600 13px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

    .vlb .vlb__pill svg {
        width: 16px;
        height: 16px;
        flex: none;
    }

    .vlb .vlb__pill:hover {
        background: rgba(255, 255, 255, .3);
    }

    .vlb .vlb__pill:active {
        transform: scale(.96);
    }

.vlb .vlb__pill--primary {
    background: #0a84ff;
}

    .vlb .vlb__pill--primary:hover {
        background: #409cff;
    }

/* ---------- content ---------- */

.vlb__media {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 18px !important;
    background: rgba(0, 0, 0, .35);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
}

video.vlb__media {
    width: min(1280px, 100%);
    background: #000;
}

.vlb__card {
    position: relative;
    width: min(1180px, 100%);
    height: 100%;
    overflow: hidden;
    border-radius: 22px !important;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
}

.vlb__frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.vlb .vlb__pre {
    display: block;
    height: 100%;
    margin: 0;
    padding: 24px 28px 64px;
    overflow: auto;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
    color: #1d1d1f;
    font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    tab-size: 2;
}

.vlb__banner {
    position: absolute;
    left: 50%;
    bottom: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100% - 32px);
    padding: 8px 8px 8px 18px;
    border-radius: 26px !important;
    font-size: 13px;
    transform: translateX(-50%);
}

    .vlb__banner > span {
        flex: 1 1 auto;
        min-width: 0;
    }

.vlb__card > .vlb__banner:not(:has(button)) {
    padding: 12px 18px;
}

.vlb__audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(440px, 100%);
    padding: 26px;
    border-radius: 28px !important;
}

    .vlb__audio img {
        width: 220px;
        max-width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 20px !important;
    }

.vlb__audio-title {
    max-width: 100%;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    overflow-wrap: anywhere;
}

.vlb__audio audio {
    width: 100%;
}

.vlb__fallback {
    width: min(420px, 100%);
    padding: 32px 28px 28px;
    border-radius: 28px !important;
    text-align: center;
}

.vlb__fallback-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, .14);
}

    .vlb__fallback-icon svg {
        width: 28px;
        height: 28px;
    }

.vlb__fallback-title {
    font-size: 17px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.vlb__fallback-msg {
    margin-top: 6px;
    color: rgba(255, 255, 255, .78);
}

.vlb__fallback-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

/* Delayed so quick loads never flash a spinner. */
.vlb__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50% !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease .2s;
    animation: vlb-spin .8s linear infinite;
}

.vlb--busy .vlb__spinner {
    opacity: 1;
}

@keyframes vlb-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes vlb-pop {
    from {
        opacity: 0;
        transform: scale(.965);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- small screens, reduced motion ---------- */

@media (max-width: 600px) {
    .vlb__stage {
        padding: 76px 10px 20px;
    }

    .vlb__top {
        left: 10px;
        right: 10px;
    }

    .vlb__title {
        max-width: 52%;
        padding: 0 14px;
    }

    .vlb .vlb__nav {
        width: 42px;
        height: 42px;
        margin-top: -21px;
    }

    .vlb .vlb__prev {
        left: 8px;
    }

    .vlb .vlb__next {
        right: 8px;
    }

    .vlb__card, .vlb__media {
        border-radius: 16px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    dialog.vlb, dialog.vlb::backdrop, .vlb .vlb__btn, .vlb .vlb__pill {
        transition: none;
    }

    .vlb__content > * {
        animation: none;
    }

    .vlb__spinner {
        animation-duration: 2s;
    }
}

/* ---------- web build: stacked layers, full-bleed content, chrome modes ---------- */

/* A layer opened above another only dims; the blur is already there from the layer below. */
dialog.vlb--stacked::backdrop {
    background: rgba(8, 10, 22, .4);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Full-bleed (zhtml, custom launchers): content fills the screen, nothing around it. */
dialog.vlb--full::backdrop {
    background: #000;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.vlb--full .vlb__stage {
    padding: 0;
}

.vlb--full .vlb__card {
    width: 100%;
    height: 100%;
    border-radius: 0 !important;
    box-shadow: none;
}

.vlb--full .vlb__content > * {
    animation: none;
}
/* With the full toolbar the content starts below it, as the old LightGallery toolbar did. */
.vlb--full[data-chrome="full"] .vlb__stage {
    padding-top: calc(max(14px, env(safe-area-inset-top)) + 58px);
}

/* Chrome modes: full (default) | floating (translucent buttons only) | none (locked launcher) */
.vlb[data-chrome="none"] .vlb__top, .vlb[data-chrome="none"] .vlb__nav {
    display: none;
}

.vlb[data-chrome="floating"] .vlb__title {
    display: none;
}

.vlb[data-chrome="floating"] .vlb__tools {
    opacity: .55;
    transition: opacity .2s ease;
}

    .vlb[data-chrome="floating"] .vlb__tools:hover, .vlb[data-chrome="floating"] .vlb__tools:focus-within {
        opacity: 1;
    }

/* video.js player (web) */
.vlb__vjs {
    width: min(1280px, 100%);
    max-height: 100%;
    overflow: hidden;
    border-radius: 18px !important;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .5);
}

    .vlb__vjs .video-js {
        width: 100%;
    }

/* Page modals borrowed into the viewer (see web-openMedia.js): Bootstrap's own backdrop sits on <body>, outside
   the top layer, so the full-screen .modal element supplies the dim instead. It fades in with the modal. */
dialog.vlb .modal {
    background: rgba(0, 0, 0, .5);
}

/* Undo lightbox styles leaking into Bootstrap modals */
.vlb .modal-body div {
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

    .vlb .modal-body div + div {
        margin-top: 15px;
    }

.vlb .modal-body .btn {
    display: block !important;
    width: 100% !important;
    border-radius: 999px !important;
}

.vlb .modal-body div:empty {
    display: none;
}