.simple-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    overflow: hidden;
}

.simple-lightbox-content-wrapper {
    position: relative;
    background-color: #f7f7f7;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 90vw;
    max-height: 90vh;
    width: 80vw;
    height: auto;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

/* OUTSIDE close button styling */
.simple-lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: beige;
    font-family: sans-serif;
    z-index: 10000;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.2s ease;
}

.simple-lightbox-close:hover {
    background: none;
    color: black;
    opacity: 0.6;
}


/* Responsive embeds */
.simple-lightbox-content .video-container {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    margin-bottom: 20px;
}

.simple-lightbox-content .video-container iframe,
.simple-lightbox-content iframe,
.simple-lightbox-content video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensures block content inside lightbox scales */
.simple-lightbox-content img,
.simple-lightbox-content iframe,
.simple-lightbox-content video,
.simple-lightbox-content .wp-block-embed-youtube {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

body.simple-lightbox-open {
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .simple-lightbox-content-wrapper {
        max-height: 70vh; /* limit very tall pages */
        width: 90vw;
    }

    /* Keep close button close to lightbox */
    .simple-lightbox-close {
        top: 65px; /* near wrapper */
        right: 8px;
    }
}

/* Fix horizontal scrolling inside content */
.simple-lightbox-content {
    word-break: break-word;
    overflow-x: hidden;
}