/* =====================================================================
   Meridian :: WordPress and Elementor corrections
   Nothing here is design. Every rule undoes a default that would otherwise
   change the approved preview. Keep design changes in site.css.
   ===================================================================== */

/* 1. UNWRAP ELEMENTOR ON THE FRONTEND -------------------------------------
   Each page is one container (.mer-stack) holding one widget per section
   (.mer-w). display:contents removes those boxes from the layout on the
   frontend, so sticky bars, sibling selectors and :last-child behave exactly
   as they did in the static preview. The editor keeps the boxes so sections
   stay selectable. */
body:not(.elementor-editor-active) .e-con.mer-stack,
body:not(.elementor-editor-active) .e-con.mer-stack > .e-con-inner,
body:not(.elementor-editor-active) .elementor-widget.mer-w,
body:not(.elementor-editor-active) .elementor-widget.mer-w > .elementor-widget-container{
	display:contents;
}

/* 2. Elementor strips link underlines globally. The preview underlines
   specific links, so restore them where the design asks. */
.elementor a{text-decoration:none}
.elementor .hero-legal a,
.elementor .prose a,
.elementor .disclaim a,
.elementor .impdisc a,
.elementor .btn-text,
.elementor .foot a:hover{text-decoration:underline;text-underline-offset:3px}

/* 3. Elementor zeroes figure margins with a specificity that beats ours.
   Match it rather than reaching for !important. */
.elementor .elementor-widget:not(.elementor-widget-text-editor):not(.elementor-widget-theme-post-content) figure{
	margin:0;
}

/* 4. Elementor sets line-height on media elements. */
.elementor video,
.elementor img{line-height:1}

/* 5. Elementor adds a bottom margin to every widget but the last. Our
   sections own their own spacing. */
body:not(.elementor-editor-active) .elementor-widget:not(:last-child){margin-bottom:0}

/* 6. WordPress admin bar offsets a fixed header. */
body.admin-bar .nav{top:32px}
@media screen and (max-width:782px){body.admin-bar .nav{top:46px}}

/* 7. The theme prints the header and footer, so an empty Elementor container
   must not add height. */
body:not(.elementor-editor-active) .e-con.mer-stack{padding:0;margin:0}

/* 8. Editor only: make sections visible and measurable while editing. */
.elementor-editor-active .mer-w{display:block}
