/**
 * FIFE Elementor widgets — shared polish rules.
 *
 * Holds only the CSS that is identical across multiple FIFE widget files —
 * the box-sizing safety net and the "full-width section, boxed content"
 * inner-wrapper pattern. Everything widget-specific (shadows, hover
 * transitions, typography) stays in each widget's own stylesheet.
 *
 * Registered as a dependency of every FIFE widget style handle, so it
 * loads only when at least one FIFE widget is present on the page —
 * never enqueued site-wide on its own.
 *
 * Hero Carousel is intentionally NOT included in the max-width block
 * below: it's a full-bleed, min-height:100vh hero by design, and its own
 * inner content already has a correct cap (.fife-hero__slide-inner,
 * max-width 900px) in hero-carousel.css. Capping its root here would
 * turn it into a boxed card, which is a redesign, not polish.
 */

.fife-elementor-services-grid,
.fife-elementor-projects-grid,
.fife-elementor-team-members,
.fife-elementor-approaches,
.fife-elementor-testimonials,
.fife-elementor-featured-events,
.fife-elementor-partners,
.fife-elementor-about,
.fife-elementor-stats,
.fife-elementor-publication-cards,
.fife-elementor-lab-videos,
.fife-elementor-course-cards {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

.fife-elementor-services-grid,
.fife-elementor-services-grid *,
.fife-elementor-services-grid *::before,
.fife-elementor-services-grid *::after,
.fife-elementor-projects-grid,
.fife-elementor-projects-grid *,
.fife-elementor-projects-grid *::before,
.fife-elementor-projects-grid *::after,
.fife-elementor-team-members,
.fife-elementor-team-members *,
.fife-elementor-team-members *::before,
.fife-elementor-team-members *::after,
.fife-elementor-approaches,
.fife-elementor-approaches *,
.fife-elementor-approaches *::before,
.fife-elementor-approaches *::after,
.fife-elementor-featured-events,
.fife-elementor-featured-events *,
.fife-elementor-featured-events *::before,
.fife-elementor-featured-events *::after,
.fife-elementor-partners,
.fife-elementor-partners *,
.fife-elementor-partners *::before,
.fife-elementor-partners *::after,
.fife-elementor-about,
.fife-elementor-about *,
.fife-elementor-about *::before,
.fife-elementor-about *::after,
.fife-elementor-page-hero,
.fife-elementor-page-hero *,
.fife-elementor-page-hero *::before,
.fife-elementor-page-hero *::after,
.fife-elementor-stats,
.fife-elementor-stats *,
.fife-elementor-stats *::before,
.fife-elementor-stats *::after,
.fife-elementor-cta-banner,
.fife-elementor-cta-banner *,
.fife-elementor-cta-banner *::before,
.fife-elementor-cta-banner *::after,
.fife-elementor-publication-cards,
.fife-elementor-publication-cards *,
.fife-elementor-publication-cards *::before,
.fife-elementor-publication-cards *::after,
.fife-elementor-lab-videos,
.fife-elementor-lab-videos *,
.fife-elementor-lab-videos *::before,
.fife-elementor-lab-videos *::after,
.fife-elementor-course-cards,
.fife-elementor-course-cards *,
.fife-elementor-course-cards *::before,
.fife-elementor-course-cards *::after {
    box-sizing: border-box;
}

/**
 * Elementor container full-width compatibility.
 *
 * Migrated verbatim from Elementor → Site Settings → Custom CSS, where it
 * was verified to fix full-width Elementor Container (flexbox `.e-con`)
 * stretching. Kept byte-for-byte identical to the verified version — do
 * not "clean up" the !important flags below, they're load-bearing against
 * Elementor's own generated container CSS.
 *
 * Scoping: this whole file now only enqueues on pages where
 * `_elementor_edit_mode` post meta is set (see
 * FIFE_Elementor_Widgets::maybe_enqueue_common_style() in
 * class-fife-elementor-widgets.php) — the same check
 * inc/elementor-loader.php already uses to detect Elementor-built
 * content — so none of the rules below, including the unprefixed
 * `html, body` rule, ever load on legacy (non-Elementor) templates. Most
 * selectors are additionally scoped with `body.elementor-page` as a
 * second, CSS-side safety net.
 */
body.elementor-page .site-main,
body.elementor-page .content-area,
body.elementor-page .site-content,
body.elementor-page main,
body.elementor-page article,
body.elementor-page .entry-content,
body.elementor-page .elementor,
body.elementor-page .elementor-inner,
body.elementor-page .elementor-section-wrap {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0;
    padding-right: 0;
}

/* New Elementor Flexbox Containers */
body.elementor-page .e-con.e-parent,
body.elementor-page .e-con-full,
body.elementor-page .elementor-element.e-con {
    --container-max-width: 100%;
    width: 100%;
    max-width: 100%;
}

/* Ensure top-level Elementor containers can stretch edge-to-edge */
body.elementor-page
.elementor
> .elementor-element.e-con {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
}

/* Prevent accidental horizontal scrolling */
html,
body {
    overflow-x: clip;
}
