/* =========================================================
   TYTOZ GALLERY
   Lightbox Stylesheet
   Tattoo Artist: Akash Kumar
   Part 19 — Image + Video Lightbox
========================================================= */


/* =========================================================
   LIGHTBOX OVERLAY
========================================================= */

.lightbox {

    position: fixed;

    inset: 0;

    z-index: 99990;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 25px;

    background:
        rgba(0, 0, 0, 0.94);

    opacity: 0;

    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;

}


/* =========================================================
   OPEN STATE
========================================================= */

.lightbox.active {

    opacity: 1;

    visibility: visible;

    pointer-events: auto;

}


/* =========================================================
   LIGHTBOX CONTENT
========================================================= */

.lightbox-content {

    position: relative;

    width: 100%;

    max-width: 1100px;

    max-height: 88vh;

    display: flex;

    align-items: center;

    justify-content: center;

}


/* =========================================================
   IMAGE
========================================================= */

.lightbox-image {

    display: none;

    max-width: 100%;

    max-height: 82vh;

    width: auto;

    height: auto;

    object-fit: contain;

    border-radius: 6px;

    box-shadow:
        0 20px 70px
        rgba(0, 0, 0, 0.65);

}


/* =========================================================
   VIDEO
========================================================= */

.lightbox-video {

    display: none;

    width: auto;

    height: auto;

    max-width: 900px;

    max-height: 72vh;

    object-fit: contain;

    border-radius: 8px;

    background: #000000;

    box-shadow:
        0 20px 70px
        rgba(0, 0, 0, 0.65);

}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.lightbox-close {

    position: absolute;

    top: -15px;

    right: -15px;

    z-index: 5;

    width: 44px;

    height: 44px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid
        rgba(255, 255, 255, 0.15);

    border-radius: 50%;

    background:
        rgba(20, 20, 20, 0.95);

    color: #ffffff;

    font-size: 1.5rem;

    line-height: 1;

    cursor: pointer;

    transition:
        background 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;

}


/* CLOSE HOVER */

.lightbox-close:hover {

    background: var(--accent);

    color: #111111;

    border-color: var(--accent);

    transform: rotate(90deg);

}


/* =========================================================
   NAVIGATION BUTTONS
========================================================= */

.lightbox-prev,
.lightbox-next {

    position: fixed;

    top: 50%;

    z-index: 5;

    width: 48px;

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    border: 1px solid
        rgba(255, 255, 255, 0.15);

    border-radius: 50%;

    background:
        rgba(20, 20, 20, 0.9);

    color: #ffffff;

    font-size: 1.5rem;

    line-height: 1;

    cursor: pointer;

    transform:
        translateY(-50%);

    transition:
        background 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease;

}


/* =========================================================
   PREVIOUS POSITION
========================================================= */

.lightbox-prev {

    left: 25px;

}


/* =========================================================
   NEXT POSITION
========================================================= */

.lightbox-next {

    right: 25px;

}


/* =========================================================
   NAVIGATION HOVER
========================================================= */

.lightbox-prev:hover,
.lightbox-next:hover {

    background: var(--accent);

    color: #111111;

    border-color: var(--accent);

}


/* =========================================================
   COUNTER
========================================================= */

.lightbox-counter {

    position: absolute;

    top: calc(100% + 12px);

    left: 50%;

    transform:
        translateX(-50%);

    color:
        rgba(255, 255, 255, 0.7);

    font-size: 0.78rem;

    letter-spacing: 0.08em;

    white-space: nowrap;

}


/* =========================================================
   CAPTION
========================================================= */

.lightbox-caption {

    position: absolute;

    left: 50%;

    bottom: -55px;

    width: calc(100% - 120px);

    transform:
        translateX(-50%);

    text-align: center;

    color: #ffffff;

    font-size: 0.95rem;

    font-weight: 600;

    pointer-events: none;

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 760px) {

    .lightbox {

        padding: 15px;

    }


    .lightbox-content {

        max-height: 84vh;

    }


    .lightbox-image {

        max-width: 94vw;

        max-height: 72vh;

    }


    .lightbox-video {

        width: 94vw;

        max-width: 94vw;

        max-height: 62vh;

    }


    .lightbox-close {

        top: -10px;

        right: -5px;

        width: 40px;

        height: 40px;

        font-size: 1.25rem;

    }


    .lightbox-prev,
    .lightbox-next {

        width: 40px;

        height: 40px;

        font-size: 1.15rem;

    }


    .lightbox-prev {

        left: 8px;

    }


    .lightbox-next {

        right: 8px;

    }


    .lightbox-caption {

        bottom: -42px;

        width: calc(100% - 80px);

        font-size: 0.82rem;

    }


    .lightbox-counter {

        top: calc(100% + 5px);

        font-size: 0.7rem;

    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .lightbox {

        padding: 10px;

    }


    .lightbox-image {

        max-width: 92vw;

        max-height: 68vh;

    }


    .lightbox-video {

        width: 92vw;

        max-width: 92vw;

        max-height: 56vh;

    }


    .lightbox-prev,
    .lightbox-next {

        width: 36px;

        height: 36px;

        font-size: 1rem;

    }


    .lightbox-prev {

        left: 5px;

    }


    .lightbox-next {

        right: 5px;

    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .lightbox {

        transition: none;

    }


    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {

        transition: none;

    }

}


/* =========================================================
   END
========================================================= */
