/* =========================================================
   BRIDGE — loaded LAST. Only what WordPress/Elementor change about the
   page structure, never design decisions (those live in the prototype CSS).
========================================================= */

/* Elementor's wrappers are not boxes: the document root, the .ms-pass
   containers and the HTML widgets in them. The prototype's header, sections
   and footer then sit in the layout as if they were children of <body> —
   which is what keeps `.site-header{position:sticky}` sticking (inside a
   wrapper exactly its own height it would have nowhere to go).
   In the editor they stay boxes, so they can be hovered and selected. */
body.ms-site:not(.elementor-editor-active) :is(
  .elementor[data-elementor-type="wp-page"],
  .elementor-location-header,
  .elementor-location-footer,
  .e-con.ms-pass,
  .ms-pass > .elementor-widget,
  .ms-main > .elementor-widget,
  .ms-pass > .elementor-widget > .elementor-widget-container,
  .ms-main > .elementor-widget > .elementor-widget-container
){display:contents;}

/* Pages that aren't built from the prototype (client dashboard, 404 …):
   header · main · footer, with the footer at the bottom of the window even
   when the page is short, instead of right under a short panel. */
body.ms-chrome:not(.elementor-editor-active){display:flex;flex-direction:column;min-height:100vh;min-height:100dvh;}
body.ms-chrome.admin-bar:not(.elementor-editor-active){min-height:calc(100vh - 32px);min-height:calc(100dvh - 32px);}
@media (max-width:782px){ body.ms-chrome.admin-bar:not(.elementor-editor-active){min-height:calc(100vh - 46px);min-height:calc(100dvh - 46px);} }
body.ms-chrome .site-main{flex:1 0 auto;width:100%;}

/* WordPress's admin bar (signed in) covers the top 32px/46px; the sticky
   header sits under it rather than behind it. */
.ms-site.admin-bar .site-header{top:32px;}
@media (max-width:782px){ .ms-site.admin-bar .site-header{top:46px;} }
@media (max-width:600px){ .ms-site.admin-bar .site-header{top:0;} }

/* In the editor, widgets are re-rendered after the page scripts have run, so
   scroll-reveal never marks them visible. Show everything while editing. */
.elementor-editor-active .reveal,
.elementor-editor-active .hero-in{opacity:1 !important;transform:none !important;animation:none !important;}

/* Free-tool download cards = [am_download] (AM Downloads plugin). Its
   fallback sheet sets `font:inherit` (so line-height 1.6) on the input and
   button and fades the note; the prototype's card uses the browser's
   line-height and no fade. */
:is(.amp-page,.amr-page) .am-downloads :is(input[type=email],.btn-submit){line-height:normal;}
:is(.amp-page,.amr-page) .am-downloads .amp-dlcard__why{opacity:1;}
