/**
 * MBA Gallery Pro — Composite image + lightbox styles.
 *
 * @package MBA_Gallery_Pro
 */

/* ════════════════════════════════════════════════════════════════════
   1. GRID — single composite image (no crop, natural ratio)
   ════════════════════════════════════════════════════════════════════ */

/* Free plugin makes the image container 1:1 and splits two 50% images.
   For a composite we want the whole image at its natural 16:9 ratio. */
.mba-pro-composite-case .medbeafgallery-gallery-image-container {
    aspect-ratio: 16 / 9;
    background-color: #fff;
}

.mba-pro-composite-case .medbeafgallery-preview-container {
    display: block;
}

.mba-pro-composite-img {
    width: 100%;
    height: 100%;
    object-fit: contain;      /* never crop the composite */
    object-position: center;
    display: block;
}

/* Safety: hide the split divider if it somehow remains on a composite card. */
.mba-pro-composite-case .medbeafgallery-preview-divider {
    display: none;
}

/* ════════════════════════════════════════════════════════════════════
   2. MODAL — single composite image
   ════════════════════════════════════════════════════════════════════ */

.mba-pro-single-wrapper {
    position: static;
    width: 100%;
    height: auto;
    overflow: visible;
}

.mba-pro-single {
    margin: 0;
    width: 100%;
}

.mba-pro-single-imgwrap {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: var(--pro-bg-muted, #f5f5f7);
}

.mba-pro-single-img {
    display: block;
    width: 100% !important;      /* defeat theme img{max-width:100%} quirks */
    height: auto !important;
    max-width: none !important;
    max-height: 74vh;
    object-fit: contain;
    cursor: zoom-in;
}

.mba-pro-zoom-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, 0.62);
    border: none;
    border-radius: 8px;
    cursor: zoom-in;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: background-color 0.2s ease;
}

.mba-pro-zoom-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.mba-pro-zoom-btn svg {
    width: 16px;
    height: 16px;
}

/* ════════════════════════════════════════════════════════════════════
   3. LIGHTBOX — fit-to-screen, click to toggle 100%
   ════════════════════════════════════════════════════════════════════ */

body.mba-pro-lightbox-lock {
    overflow: hidden;
}

.mba-pro-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000;          /* above the modal (z-index:1000) + portal */
    display: none;
    background: rgba(0, 0, 0, 0.92);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.mba-pro-lightbox.is-open {
    display: block;
}

.mba-pro-lightbox-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;               /* enables panning when zoomed */
    -webkit-overflow-scrolling: touch;
}

.mba-pro-lightbox-img {
    max-width: 96vw;
    max-height: 96vh;
    object-fit: contain;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-select: none;
}

/* Zoomed = show at natural size and allow scroll/pan. */
.mba-pro-lightbox.is-zoomed .mba-pro-lightbox-stage {
    align-items: flex-start;
    justify-content: flex-start;
}

.mba-pro-lightbox.is-zoomed .mba-pro-lightbox-img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    cursor: zoom-out;
}

.mba-pro-lightbox-close {
    position: fixed;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background-color 0.2s ease;
}

.mba-pro-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mba-pro-lightbox-hint {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    z-index: 2;
    pointer-events: none;
}

@media (max-width: 600px) {
    .mba-pro-single-img {
        max-height: 60vh;
    }
}
