/*
 Theme Name:   Hello Elementor Child
 Theme URI:    https://townx.com
 Description:  Child theme for Hello Elementor (holds Projects module and custom styles)
 Author:       TownX
 Template:     hello-elementor   
 Version:      1.0.0
 Text Domain:  hello-elementor-child
*/

/* child-level overrides can go here (optional) */


:root{ --header-h: 100px; } /* fallback; JS will update it */

/* ===== Overlay header everywhere (Hello + Elementor header) ===== */
header#masthead,
.elementor-location-header,
header.site-header{
  position: absolute;
  top: 0; left: 0; right: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  /* Pull the next content up under the header */
  margin-bottom: calc(-1 * var(--header-h));
}

/* When Elementor makes it sticky, pin and give it a background */
.elementor-sticky--active{
  position: fixed !important;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
  left: 0; right: 0;
}

/* Ensure the *first* section has room so text/buttons aren’t hidden */
#primary.tx-main > :first-child,
.site-content > :first-child,
.elementor-page .elementor-section-wrap > .elementor-section:first-child{
  margin-top: 0 !important;
  /*padding-top: calc(var(--header-h) + 24px) !important;*/
}

/* Elementor sometimes drops a spacer for sticky headers — keep it neutral */
.elementor-sticky__spacer{ height: 0 !important; }

/* Anchor links won’t hide under the overlay */
[id]{ scroll-margin-top: calc(var(--header-h) + 20px); }

/* Logged-in WP admin bar compensation */
body.admin-bar header#masthead,
body.admin-bar .elementor-location-header,
body.admin-bar header.site-header{ top: 32px; }
@media (max-width: 782px){
  body.admin-bar header#masthead,
  body.admin-bar .elementor-location-header,
  body.admin-bar header.site-header{ top: 46px; }
}

/* Include Elementor Container layouts for the first-block padding */
.elementor .e-con:first-child{
  margin-top: 0 !important;
  padding-top: calc(var(--header-h) + 24px) !important;
}

/* Some headers drop a spacer after going sticky — force it to 0 */
.elementor-sticky--active + .elementor-sticky__spacer{ height: 0 !important; }



