/* --- GLOBAL LIGHTBOX STYLES --- */
.foz-modal {
    position: fixed;
    z-index: 999999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.foz-modal.is-active {
    opacity: 1;
    pointer-events: all;
}

.foz-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.foz-content {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 960px;
    aspect-ratio: 16/9;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

/* Image mode: no fixed aspect ratio, content wraps image so small/portrait photos fill properly */
.foz-modal.is-image .foz-content {
    width: auto;
    max-width: 95vw;
    max-height: 90vh;
    aspect-ratio: auto;
}

.foz-modal.is-image .foz-wrapper {
    position: relative;
    width: auto;
    height: auto;
}

.foz-modal.is-image .foz-wrapper #foz-lightbox-image {
    display: block;
    max-width: 95vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    position: relative;
}

.foz-modal.is-active .foz-content {
    transform: scale(1);
}

.foz-wrapper,
.foz-wrapper iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.foz-close {
    position: absolute;
    top: -50px;
    right: -10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s;
}

.foz-close:hover {
    transform: scale(1.1);
    color: var(--theme-palette-color-1, #BB141A);
}

/* ─── WordPress core lightbox theming overrides ─────────────────────────── */

.wp-lightbox-overlay .scrim {
    background-color: var(--theme-palette-color-2, #111) !important;
}
.wp-lightbox-overlay .close-button {
    color: var(--theme-palette-color-1, #fff);
}

/* ─── Foz Gallery lightbox prev/next overlay ────────────────────────────── */

.foz-modal .foz-lightbox-gallery-nav {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}
.foz-modal .foz-lightbox-gallery-nav button {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: var(--theme-palette-color-1, #fff);
    background: rgba(0, 0, 0, 0.4);
    transition: background 0.2s ease;
}
.foz-modal .foz-lightbox-gallery-nav button:hover {
    background: rgba(0, 0, 0, 0.6);
}
.foz-modal .foz-lightbox-gallery-nav .foz-lightbox-prev { left: 16px; }
.foz-modal .foz-lightbox-gallery-nav .foz-lightbox-next { right: 16px; left: auto; }