/* ==========================================================================
   Baltic Talent — Work Lightbox
   Handles the gallery / media lightbox shown from talent work cards.
   ========================================================================== */

/* --- Container ------------------------------------------------------------ */
.baltic-lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 2147483646;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    box-sizing: border-box;
}

.admin-bar .baltic-lightbox {
    padding-top: 92px;
}

@media screen and (max-width: 782px) {
    .admin-bar .baltic-lightbox {
        padding-top: 106px;
    }
}

/* Lock the page behind the lightbox and hide the sticky site header */
body.lightbox-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

body.lightbox-open header,
body.lightbox-open .header-menu,
body.lightbox-open .hed-sticky,
body.lightbox-open .is-stuck {
    display: none !important;
}

/* --- Overlay -------------------------------------------------------------- */
.lightbox-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #ed3b3e;
}

/* --- Content + media ------------------------------------------------------ */
.lightbox-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
    color: #fff;
}

.lightbox-main {
    position: relative;
    width: 90vw;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.lightbox-main img {
    max-height: 70vh;
    width: auto;
}

.custom-embed-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

#lightbox-video {
    width: 100%;
    max-width: 960px;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: contain;
}

.media-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    line-height: 0;
    max-width: 100%;
}

/* --- Image zoom ----------------------------------------------------------- */
#lightbox-img {
    transition: transform 0.25s ease;
    cursor: zoom-in;
    transform-origin: center center;
    display: block;
    max-width: 100%;
}

.media-container.zoom-on-hover:hover #lightbox-img,
#lightbox-img.zoomed {
    transform: scale(2.2);
    cursor: zoom-out;
}

/* --- Info (title + description) ------------------------------------------ */
.lightbox-info {
    order: 2;
    margin-top: 20px;
    color: #fff;
    text-align: center;
}

.lightbox-info h3 {
    margin: 0 0 10px;
    font-size: 24px;
    color: #fff;
}

.lightbox-info div {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.5;
}

/* --- Close button --------------------------------------------------------- */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

/* --- Prev / Next arrows --------------------------------------------------- */
.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0;
    background-size: 24px 24px;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.lightbox-prev {
    left: 20px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='15 18 9 12 15 6'/></svg>");
}

.lightbox-next {
    right: 20px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 18 15 12 9 6'/></svg>");
}

/* --- Zoom button ---------------------------------------------------------- */
.lightbox-zoom {
    position: absolute;
    bottom: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.55);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-zoom:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.08);
}

.lightbox-zoom.is-visible {
    display: inline-flex;
}

.lightbox-zoom svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Mobile (≤768px)
   ========================================================================== */
@media (max-width: 768px) {
    .baltic-lightbox {
        padding-bottom: 160px;
    }

    .admin-bar .baltic-lightbox {
        padding-bottom: 160px;
    }

    #lightbox-img,
    .custom-embed-container {
        width: 90%;
        margin: 0 auto;
        max-height: 42vh;
    }

    /* Close button just above the media */
    .lightbox-close {
        top: -20px;
        right: 5%;
        width: 38px;
        height: 38px;
        background: rgba(0, 0, 0, 0.55);
        color: #fff;
        border-radius: 50%;
        font-size: 26px;
        line-height: 38px;
        text-align: center;
        padding: 0;
    }

    .lightbox-zoom {
        bottom: 8px;
        left: 8px;
        width: 34px;
        height: 34px;
    }

    .lightbox-zoom svg {
        width: 16px;
        height: 16px;
    }

    /* Arrows pinned to viewport bottom, side-by-side.
       Larger hit area (56x56) to forgive near-miss taps. */
    .lightbox-prev,
    .lightbox-next {
        position: fixed;
        top: auto;
        bottom: 78px;
        transform: none;
        width: 56px;
        height: 56px;
        background-size: 22px 22px;
    }

    .lightbox-prev {
        left: calc(50% - 64px);
        right: auto;
    }

    .lightbox-next {
        right: calc(50% - 64px);
        left: auto;
    }

    .lightbox-info {
        margin-top: 30px;
        padding: 0 20px;
        width: 90%;
    }

    #lightbox-title {
        font-size: 40px;
        margin-bottom: 15px;
    }

    .custom-embed-container iframe {
        height: 40vh;
        min-height: 250px;
    }

    #lightbox-video {
        width: 90%;
        max-width: 90%;
        aspect-ratio: 16 / 9;
        margin: 0 auto;
    }
}

/* ==========================================================================
   Small mobile (≤480px)
   ========================================================================== */
@media (max-width: 480px) {
    .lightbox-prev,
    .lightbox-next {
        bottom: 65px;
        width: 50px;
        height: 50px;
        background-size: 20px 20px;
    }

    .lightbox-prev {
        left: calc(50% - 58px);
    }

    .lightbox-next {
        right: calc(50% - 58px);
    }

    #lightbox-img,
    .custom-embed-container {
        width: 95%;
        max-height: 45vh;
    }

    #lightbox-video {
        width: 95%;
        max-width: 95%;
        aspect-ratio: 16 / 9;
    }

    .custom-embed-container iframe {
        height: 35vh;
        min-height: 200px;
    }

    .lightbox-info {
        margin-top: 20px;
        padding: 0 15px;
    }

    #lightbox-title {
        font-size: 18px;
    }
}
