/**
 * Elementor editor + preview iframe helpers for Espaces widgets.
 * Note: preview iframe does NOT have .elementor-editor-active on body — only the parent editor window does.
 */

.espaces-vo-app.ep-editor-preview .ep-reveal,
.espaces-vo-app.ep-editor-preview.ep-anim-ready .ep-reveal:not(.ep-visible) {
    opacity: 1 !important;
    transform: none !important;
}

/* Keep reveal content visible while editing (JS adds ep-anim-ready which hides .ep-reveal otherwise). */
body.elementor-page .espaces-vo-app.ep-anim-ready .ep-reveal:not(.ep-visible),
body.elementor-editor-preview .espaces-vo-app.ep-anim-ready .ep-reveal:not(.ep-visible),
.elementor-editor-active .espaces-vo-app.ep-anim-ready .ep-reveal:not(.ep-visible) {
    opacity: 1 !important;
    transform: none !important;
}

body.elementor-page .espaces-vo-app .ep-reveal,
body.elementor-editor-preview .espaces-vo-app .ep-reveal {
    opacity: 1 !important;
    transform: none !important;
}

/* Editor preview: fixed backgrounds break the canvas layout. */
body.elementor-page .espaces-vo-app .ep-bg-layer,
body.elementor-editor-preview .espaces-vo-app .ep-bg-layer,
.elementor-editor-active .espaces-vo-app .ep-bg-layer {
    position: absolute !important;
}

body.elementor-page .espaces-vo-app,
body.elementor-editor-preview .espaces-vo-app {
    min-height: auto !important;
}

body.elementor-page .espaces-vo-app.ep-scope-bg,
body.elementor-editor-preview .espaces-vo-app.ep-scope-bg {
    min-height: 100vh !important;
}

/* Hide lightbox overlay inside editor canvas. */
body.elementor-page .ep-lightbox,
body.elementor-editor-preview .ep-lightbox,
.elementor-editor-active .ep-lightbox {
    display: none !important;
}

body.elementor-page .ep-custom-icon,
body.elementor-editor-preview .ep-custom-icon,
.elementor-editor-active .ep-custom-icon {
    width: 22px !important;
    height: 22px !important;
    object-fit: contain !important;
}

/* Ensure widget containers inherit Espaces scope when wrapper wraps document content. */
body.elementor-page .elementor-widget[class*="elementor-widget-ep-"] .elementor-widget-container,
body.elementor-editor-preview .elementor-widget[class*="elementor-widget-ep-"] .elementor-widget-container {
    overflow: visible !important;
}
