/* ================================
   CUSTOM FULLSCREEN LIGHTBOX
   ================================ */

body .custom-lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.92);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 999999 !important;
}

body .custom-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

/* Image fills screen */
body .custom-lightbox img {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    max-width: none !important;
    max-height: none !important;
    z-index: 999999 !important;
}

/* ================================
   CONTROLS
   ================================ */

body .custom-lightbox .lightbox-control {
    position: absolute;
    color: #fff;
    background: rgba(0,0,0,0.45);
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 32px;
    cursor: pointer;
    user-select: none;
    z-index: 1000000 !important;
    transition: background .2s ease;
}

body .custom-lightbox .lightbox-control:hover {
    background: rgba(255,255,255,0.25);
}

/* Close button */
body .custom-lightbox .lightbox-close {
    top: 20px;
    right: 20px;
}

/* Navigation arrows */
body .custom-lightbox .lightbox-prev,
body .custom-lightbox .lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    padding: 18px 22px;
}

body .custom-lightbox .lightbox-prev {
    left: 20px;
}

body .custom-lightbox .lightbox-next {
    right: 20px;
}

/* Force visibility */
body .custom-lightbox .lightbox-prev,
body .custom-lightbox .lightbox-next,
body .custom-lightbox .lightbox-close {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}
/* Fullscreen button beside the close button with safe spacing */
body .custom-lightbox .lightbox-fullscreen {
    position: absolute;
    top: 20px;
    right: 90px; /* moved farther left to avoid overlap */
    font-size: 26px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.45);
    border-radius: 6px;
    cursor: pointer;
    z-index: 1000000;
    transition: background .2s ease;
}


/* Smaller controls on mobile */
@media (max-width: 600px) {
    body .custom-lightbox .lightbox-prev,
    body .custom-lightbox .lightbox-next {
        font-size: 28px;
        padding: 10px 14px;
    }

    body .custom-lightbox .lightbox-close {
        font-size: 26px;
        padding: 8px 12px;
        top: 12px;
        right: 12px;
    }
}
/* Mobile-only: move arrows to the same height as the close button */
@media (max-width: 600px) {
    body .custom-lightbox .lightbox-prev,
    body .custom-lightbox .lightbox-next {
        top: 20px;                 /* same height as the X */
        transform: none;           /* remove vertical centering */
        font-size: 28px;           /* smaller arrows */
        padding: 10px 14px;
    }

    body .custom-lightbox .lightbox-prev {
        left: 20px;                /* mirror the X position */
    }

    body .custom-lightbox .lightbox-next {
        right: 60px;               /* space so it doesn't overlap the X */
    }

    body .custom-lightbox .lightbox-close {
        font-size: 26px;
        padding: 8px 12px;
        top: 20px;
        right: 20px;
    }
}
@media (max-width: 600px) {
    body .custom-lightbox .lightbox-close {
        top: auto;               /* remove top positioning */
        bottom: 20px;            /* place near bottom */
        left: 50%;               /* center horizontally */
        right: auto;
        transform: translateX(-50%);
        font-size: 28px;
        padding: 10px 14px;
    }
}
@media (max-width: 600px) {
    /* Move fullscreen button to top center */
    body .custom-lightbox .lightbox-fullscreen {
        top: 12px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        font-size: 22px;
        padding: 6px 10px;
    }

    /* Move close button to bottom center */
    body .custom-lightbox .lightbox-close {
        top: auto;
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        font-size: 28px;
        padding: 10px 14px;
    }
}

