/* =====================================================================
   MDS — Elementor compatibility layer
   Load order:  Elementor CSS  ->  THIS FILE  ->  experience.elementor.css
   Scope: only elements created by the migration (.mds-raw / .mds-w / .mds-chrome)
   and the Theme-Builder header/footer wrappers. Contains NO design values.
   ===================================================================== */

/* 1) Everything the migration created behaves like the plain original HTML element:
      "all: revert" drops Elementor's container/widget/kit styling back to browser defaults.
      Specificity (1,0,0) beats Elementor's class rules and loses to every original rule
      in experience.elementor.css (all boosted to >= 1,0,0 and loaded after this file). */
:not(#mdsx) :where(.e-con.mds-raw),
:not(#mdsx) :where(.e-con.mds-doc),
:not(#mdsx) :where(.mds-w),
:not(#mdsx) :where(.mds-w > .elementor-widget-container),
:not(#mdsx) :where(.mds-w .elementor-heading-title),
:not(#mdsx) :where(.mds-chrome, .mds-chrome > .elementor-widget, .mds-chrome .elementor-widget-container) { all: revert; }
:not(#mdsx) :where(.e-con.mds-raw)::before { content: none; }

/* 2) Front end only: wrappers that did not exist in the static HTML are made fully transparent:
      no box (display:contents) AND they pass every inherited property straight through, so an
      original rule that happens to match a wrapper <div> (e.g. ".x>div", ".x div") can never
      change layout or typography.  !important is used only here, only on these wrapper nodes.
      Result: .site-header keeps position:sticky against <body>, .mobile-cta/.floating-* stay fixed,
      and children of converted containers take part in the original flex/grid directly. */
body:not(.elementor-editor-active) :is(.elementor-location-header, .elementor-location-footer),
body:not(.elementor-editor-active) :is(.mds-chrome, .mds-chrome > .elementor-widget, .mds-chrome .elementor-widget-container),
body:not(.elementor-editor-active) :is(.mds-w, .mds-w > .elementor-widget-container),
body.experience:not(.elementor-editor-active) > .elementor[data-elementor-type="wp-page"],
body.inner-page:not(.elementor-editor-active) > .elementor[data-elementor-type="wp-page"],
body.inner-page:not(.elementor-editor-active) > .elementor[data-elementor-type="wp-post"],
body.inner-page:not(.elementor-editor-active) > .elementor[data-elementor-type="archive"] { all: inherit !important; display: contents !important; }
