/* JHHS Hero & Spacing Controls 1.0.0 — frontend only, scoped to detected pages. */
body.jhhs-layout-remove-gap .site-content,
body.jhhs-layout-remove-gap #content,
body.jhhs-layout-remove-gap #primary,
body.jhhs-layout-remove-gap .content-area,
body.jhhs-layout-remove-gap .site-main,
body.jhhs-layout-remove-gap article.page,
body.jhhs-layout-remove-gap .entry-content,
body.jhhs-layout-remove-gap .page-content,
body.jhhs-layout-remove-gap .site-content > .container,
body.jhhs-layout-remove-gap #content > .container,
body.jhhs-layout-remove-gap .site-content > .wrap,
body.jhhs-layout-remove-gap #content > .wrap {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Remove an empty page-title region ONLY if explicitly enabled in settings. */
body.jhhs-layout-hide-duplicate-title .entry-header,
body.jhhs-layout-hide-duplicate-title .page-header,
body.jhhs-layout-hide-duplicate-title h1.entry-title,
body.jhhs-layout-hide-duplicate-title h1.page-title {
  display: none !important;
}

/* Page wrapper constraints: allow only ancestors of a recognized hero to overflow. */
body.jhhs-layout-active .jhhs-layout-overflow-release {
  overflow: visible !important;
  overflow-x: visible !important;
}

/* Break an existing hero out of the theme's boxed content width. */
body.jhhs-layout-active .jhhs-layout-hero-target {
  box-sizing: border-box !important;
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  left: auto !important;
  right: auto !important;
}

/* Elementor containers and block covers often impose inner widths. 
   The hero itself stretches, but internal text remains governed by its own widths. */
body.jhhs-layout-active .jhhs-layout-hero-target.elementor-section,
body.jhhs-layout-active .jhhs-layout-hero-target.e-con,
body.jhhs-layout-active .jhhs-layout-hero-target.wp-block-cover {
  --container-max-width: 100vw;
}

@supports (width: 100dvw) {
  /* Prevent the gap caused by vertical scrollbars in browsers that support dynamic viewports. */
  body.jhhs-layout-active .jhhs-layout-hero-target {
    max-width: 100dvw !important;
  }
}
