
/* ============================================================
   V4.9 — ONE BALANCED TOP GAP FOR EVERY PAGE
   ------------------------------------------------------------
   The actual value is updated by JS from the rendered fixed header.
   Defaults below prevent a flash before JS measures the header.
============================================================ */

body:not(.wp-admin){
  --cs-page-header-bottom:112px;
  --cs-page-content-gap:28px;
  --cs-page-start:calc(var(--cs-page-header-bottom) + var(--cs-page-content-gap));
}

/*
 * Remove older accumulated outer main offsets. The page/hero background
 * can begin at the very top; only the first real content section is
 * pushed below the fixed menu.
 */
body:not(.wp-admin) main,
body:not(.wp-admin) .cs-home-v11,
body:not(.wp-admin) .cs-services-v2,
body:not(.wp-admin) .cs-industries-v2,
body:not(.wp-admin) .cs-insights-exact,
body:not(.wp-admin) .cs-contact-v43,
body:not(.wp-admin) .cs-adenwalla-v42{
  margin-top:0 !important;
}

/*
 * Normal WordPress pages + Growth Stories archive.
 * This catches About and standard/custom page templates whose first
 * visible block is a top-level section.
 */
body:not(.wp-admin) main > section:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/* Services */
body:not(.wp-admin) .cs-services-v2 > .hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/* Industries */
body:not(.wp-admin) .cs-industries-v2 > .hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/* About */
body:not(.wp-admin) main > .hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/* Contact */
body:not(.wp-admin) .cs-contact-v43 > .hero:first-child{
  padding-top:var(--cs-page-start) !important;
}

/* Insights */
body:not(.wp-admin) .cs-insights-exact > .hero:first-of-type,
body:not(.wp-admin) .cs-insights-exact .hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/* HAZWOPER Growth Story */
body:not(.wp-admin) main.cs-hazwoper-v40 > .hero:first-of-type,
body:not(.wp-admin) main.cs-hazwoper-v40 .hero.hero-v2:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/* Adenwalla Growth Story */
body:not(.wp-admin) main.cs-adenwalla-v42 > .aden-hero:first-of-type,
body:not(.wp-admin) .cs-adenwalla-v42 .aden-hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/*
 * Growth Stories listing/archive safety. Different WordPress archive
 * templates may use hero, archive-hero, page-hero or the first section.
 */
body.post-type-archive-growth_story:not(.wp-admin) main > section:first-of-type,
body.post-type-archive-growth_story:not(.wp-admin) .archive-hero:first-of-type,
body.post-type-archive-growth_story:not(.wp-admin) .page-hero:first-of-type,
body.post-type-archive-growth_story:not(.wp-admin) .hero:first-of-type,
body.page-growth-stories:not(.wp-admin) main > section:first-of-type,
body.page-growth-stories:not(.wp-admin) .hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}

/*
 * Homepage is a Framer-derived layout, so its first hero container uses
 * a dedicated class. It now follows the same measured header clearance.
 */
body.home:not(.wp-admin) .cs-home-v11 .framer-1jcgmjm{
  padding-top:var(--cs-page-start) !important;
}

/* Equal anchor clearance as well. */
body:not(.wp-admin) section[id]{
  scroll-margin-top:calc(var(--cs-page-header-bottom) + 16px) !important;
}

/* Tablet: same system, slightly tighter intentional visual gap. */
@media(max-width:1100px){
  body:not(.wp-admin){
    --cs-page-content-gap:22px;
    --cs-page-header-bottom:92px;
  }
}

/* Phone: keep it compact but still identical across templates. */
@media(max-width:720px){
  body:not(.wp-admin){
    --cs-page-content-gap:18px;
    --cs-page-header-bottom:70px;
  }
}

/* WordPress admin bar is included by the JS measurement automatically. */


/* V5.0 — Urban Glo joins the same measured global header clearance. */
body:not(.wp-admin) .cs-urban-glo-v50{
  margin-top:0 !important;
}
body:not(.wp-admin) main.cs-urban-glo-v50 > .hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}


/* V6.7 — Growth Stories Showcase header clearance */
body:not(.wp-admin) .cs-growth-stories-v67{
  margin-top:0 !important;
}
body:not(.wp-admin) main.cs-growth-stories-v67 > .gs-hero:first-of-type{
  padding-top:var(--cs-page-start) !important;
}
