/* Tivan protected-image guard */

.tiv-protected-stage,
.tiv-protected-media,
.tiv-protected-background {
    position: relative;
    overflow: hidden;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
}

.tiv-protected-canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    -webkit-user-drag: none !important;
    user-select: none !important;
}

.tiv-image-shield {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: block;
    background: transparent;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

#hero-bg-image.tiv-protected-stage {
    background-image: none !important;
}

#hero-bg-image.tiv-protected-stage .tiv-protected-canvas {
    position: absolute;
    inset: 0;
}

.tiv-signature-item .tiv-protected-canvas,
.tiv-more-gallery-item .tiv-protected-canvas {
    width: 100%;
    height: 100%;
    transform: scale(1.06);
    filter: saturate(.94) contrast(1.05);
    transition:
        transform 1.2s cubic-bezier(.19,1,.22,1),
        filter 1.2s cubic-bezier(.19,1,.22,1);
}

.tiv-signature-item:hover .tiv-protected-canvas,
.tiv-more-gallery-item:hover .tiv-protected-canvas {
    transform: scale(1.11);
    filter: saturate(1.05) contrast(1.07);
}

.tiv-protected-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tiv-protected-lightbox.is-open {
    display: flex;
}

.tiv-protected-lightbox__stage {
    position: relative;
    width: min(92vw, 1500px);
    height: min(86vh, 940px);
    overflow: hidden;
}

.tiv-protected-lightbox__canvas {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tiv-protected-lightbox__close,
.tiv-protected-lightbox__prev,
.tiv-protected-lightbox__next {
    position: fixed;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(0,0,0,.28);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
}

.tiv-protected-lightbox__close {
    top: 25px;
    right: 25px;
}

.tiv-protected-lightbox__prev {
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
}

.tiv-protected-lightbox__next {
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
}

.tiv-protected-lightbox__caption {
    position: fixed;
    right: 90px;
    bottom: 28px;
    left: 90px;
    color: rgba(255,255,255,.82);
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
}

.tiv-security-curtain {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    display: none;
    background: #050505;
    pointer-events: none;
}

html.tiv-security-lock .tiv-security-curtain {
    display: block;
}

@media print {
    .tiv-protected-stage,
    .tiv-protected-media,
    .tiv-protected-background,
    .tiv-signature-gallery,
    .tiv-more-gallery,
    #hero-bg-wrapper {
        display: none !important;
        visibility: hidden !important;
    }
}

@media only screen and (max-width: 767px) {
    .tiv-protected-lightbox__stage {
        width: 100vw;
        height: 78vh;
    }

    .tiv-protected-lightbox__prev {
        left: 10px;
    }

    .tiv-protected-lightbox__next {
        right: 10px;
    }

    .tiv-protected-lightbox__caption {
        right: 25px;
        left: 25px;
    }
}


/* =========================================================
   AJAX + async protected-image loading
========================================================= */

.tiv-async-portfolio {
    opacity: 1 !important;
    visibility: visible !important;
}

.tiv-images-async-enabled .tiv-async-portfolio {
    min-height: 1px;
}

.item-image[data-tiv-bg],
.thumb-page[data-tiv-bg] {
    background-color: #111;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transition:
        opacity .55s ease,
        filter .55s ease,
        transform 1.1s cubic-bezier(.19,1,.22,1);
}

.item-image[data-tiv-bg]:not([data-tiv-loaded="1"]),
.thumb-page[data-tiv-bg]:not([data-tiv-loaded="1"]) {
    opacity: .01;
}

.item-image[data-tiv-loaded="1"],
.thumb-page[data-tiv-loaded="1"] {
    opacity: 1;
}

canvas.tiv-protected-canvas[data-tiv-loading="1"],
[data-tiv-bg][data-tiv-loading="1"] {
    cursor: progress;
}

#hero-bg-image .tiv-protected-canvas {
    opacity: 0;
    transition: opacity .35s ease;
}

#hero-bg-image .tiv-protected-canvas[data-tiv-loaded="1"] {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .item-image[data-tiv-bg],
    .thumb-page[data-tiv-bg],
    #hero-bg-image .tiv-protected-canvas {
        transition: none !important;
    }
}


/* =========================================================
   v1.5 batch + optimized derivatives
========================================================= */

[data-tiv-loading="1"] {
    background-color: #101010;
}

.item-image[data-tiv-bg][data-tiv-loading="1"],
.thumb-page[data-tiv-bg][data-tiv-loading="1"] {
    opacity: .08;
}

.item-image[data-tiv-bg][data-tiv-loaded="1"],
.thumb-page[data-tiv-bg][data-tiv-loaded="1"],
canvas.tiv-protected-canvas[data-tiv-loaded="1"] {
    opacity: 1;
}

canvas.tiv-protected-canvas[data-tiv-preview-loaded="1"] {
    opacity: 1;
}
