/**
 * BeDijital canonical post-hero spacing — v1.5.73
 *
 * Desktop contract:
 * - Every page with a hero starts its FIRST post-hero content exactly 58px
 *   below the hero.
 * - The 58px belongs to the first real content section, so its own background
 *   continues naturally under the hero.
 * - Divi wrapper/row/column/module/text layers between the hero and that first
 *   section must not add any extra top margin or padding.
 * - Immediate content containers must not add their own top padding.
 *
 * This file is enqueued at priority 999 and is intentionally the final
 * authority for desktop hero-to-content spacing.
 */
:root{
  --bd-post-hero-space:58px;
}

@media (min-width:992px){

  /* Home page: explicit guard because the campaign section is rendered by shortcode. */
  #main-content .bdh-campaigns{
    padding-top:var(--bd-post-hero-space)!important;
    margin-top:0!important;
  }
  #main-content .bdh-campaigns > .bdh-container{
    padding-top:0!important;
    margin-top:0!important;
  }

  /*
   * Divi 5 generated pages place the hero and the following content in
   * separate outer Divi sections. Cancel all wrapper spacing first.
   */
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"]) + .et_pb_section{
    margin-top:0!important;
  }

  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"]) + .et_pb_section > .et_pb_row,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"]) + .et_pb_section > .et_pb_row > .et_pb_column,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"]) + .et_pb_section .et_pb_module,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"]) + .et_pb_section .et_pb_text,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"]) + .et_pb_section .et_pb_text_inner{
    margin-top:0!important;
    padding-top:0!important;
  }

  /*
   * Standard custom-section pages:
   * outer Divi section contributes no spacing; the first real section owns
   * exactly 58px so its background starts directly below the hero.
   */
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section:has(.et_pb_text_inner > div > section:first-of-type),
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section:has(.et_pb_text_inner > section:first-of-type){
    padding-top:0!important;
  }

  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > div > section:first-of-type,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > section:first-of-type{
    padding-top:var(--bd-post-hero-space)!important;
    margin-top:0!important;
  }

  /*
   * Native-Divi first sections (for example the contact card row) have no
   * custom inner <section>. In that one case the outer Divi section owns 58px.
   */
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section:not(:has(.et_pb_text_inner > div > section:first-of-type)):not(:has(.et_pb_text_inner > section:first-of-type)){
    padding-top:var(--bd-post-hero-space)!important;
  }

  /* Remove the WordPress/Divi generic .container top padding from the first real section. */
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > div > section:first-of-type > .container,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > div > section:first-of-type > .bdh-container,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > div > section:first-of-type > .bd-corp-container,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > div > section:first-of-type > .bdes-container,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > div > section:first-of-type > .bdssl-container,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > section:first-of-type > .container,
  #main-content .et_pb_section:has(.et_pb_text_inner section[class*="-hero"])
    + .et_pb_section .et_pb_text_inner > section:first-of-type > .bd-corp-container{
    padding-top:0!important;
    margin-top:0!important;
  }
}
