/* ASE v1.4.6 theme-family refinements. Dynamic page-ID scoping is added in PHP. */
body.ase-managed-page .ase-site {
    clear: both;
}

body.ase-managed-page.ase-header-minimal .site-header,
body.ase-managed-page.ase-header-minimal header.wp-block-template-part {
    box-shadow: none;
}

body.ase-managed-page .ase-site .alignfull {
    max-width: none;
}

/* Full-bleed is a reviewed homepage option. These runtime selectors cover
 * common classic and block-theme wrappers; page-ID-scoped copies are also
 * written into ASE's rollback-safe Custom CSS during a confirmed build. */
body.ase-managed-page.ase-hero-full-bleed {
    overflow-x: hidden;
    overflow-x: clip;
}

body.ase-managed-page.ase-hero-full-bleed :where(
    .site-content,
    #content,
    .site-content > .container,
    .site-content > .ast-container,
    #content > .ast-container,
    .site-content .ast-container,
    #content .ast-container,
    .content-area,
    #primary,
    .site-main,
    article.page,
    .ast-article-single,
    .inside-article,
    .entry-content-wrap,
    .entry-content,
    .content-container,
    .site-grid,
    .wp-site-blocks > main,
    .wp-block-post-content
) {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
    padding-block-start: 0 !important;
    overflow: visible !important;
}

body.ase-managed-page.ase-hero-full-bleed :where(
    .site-header,
    #masthead,
    header.wp-block-template-part,
    .wp-site-blocks > header
) {
    margin-bottom: 0 !important;
    margin-block-end: 0 !important;
}

/* Gutenberg flow layouts can add a block-gap margin to the first visible ASE
 * block when a hidden theme title remains its previous sibling. Reset the
 * actual full-bleed root, not every block on the page. */
body.ase-managed-page.ase-hero-full-bleed :where(
    .entry-content,
    .wp-block-post-content,
    .inside-article,
    .site-main
) > .ase-site.ase-has-full-bleed-hero,
body.ase-managed-page.ase-hero-full-bleed .ase-site.ase-has-full-bleed-hero {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
    padding-block-start: 0 !important;
}

body.ase-managed-page.ase-hero-full-bleed .ase-site .ase-hero--background-full-bleed {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}

/* Optional landing-page treatment for a minimal theme header over the native
 * full-width image hero. The class is added only to the ASE-managed homepage
 * when the publisher explicitly enables the compatible setting. */
body.ase-hero-header-overlay.ase-header-minimal :where(
    .site-header,
    #masthead,
    header.wp-block-template-part,
    .wp-site-blocks > header
) {
    position: absolute !important;
    inset: 0 0 auto !important;
    z-index: 100 !important;
    width: 100% !important;
    border-bottom-color: transparent !important;
    color: inherit;
    background: transparent !important;
    box-shadow: none !important;
}

body.admin-bar.ase-hero-header-overlay.ase-header-minimal :where(
    .site-header,
    #masthead,
    header.wp-block-template-part,
    .wp-site-blocks > header
) {
    top: 32px !important;
}

body.ase-hero-header-overlay.ase-header-minimal :where(
    .site-header,
    #masthead,
    header.wp-block-template-part,
    .wp-site-blocks > header
) :where(
    .ast-primary-header-bar,
    .main-header-bar,
    .site-primary-header-wrap,
    .site-header-wrap,
    .site-header-inner,
    .inside-header,
    .wp-block-group.has-background
) {
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.ase-hero-header-overlay .ase-site .ase-hero--background {
    padding-top: clamp(8.75rem, 13vw, 12rem);
}

body.ase-hero-header-tone-dark :where(
    .site-header,
    #masthead,
    header.wp-block-template-part,
    .wp-site-blocks > header
) :where(
    .site-title,
    .site-title a,
    .site-description,
    .site-branding,
    .main-navigation a,
    .menu-item > a,
    .wp-block-site-title,
    .wp-block-site-title a,
    .wp-block-navigation-item__content,
    .wp-block-navigation__responsive-container-open,
    .menu-toggle
) {
    color: #fff !important;
}

body.ase-hero-header-tone-light :where(
    .site-header,
    #masthead,
    header.wp-block-template-part,
    .wp-site-blocks > header
) :where(
    .site-title,
    .site-title a,
    .site-description,
    .site-branding,
    .main-navigation a,
    .menu-item > a,
    .wp-block-site-title,
    .wp-block-site-title a,
    .wp-block-navigation-item__content,
    .wp-block-navigation__responsive-container-open,
    .menu-toggle
) {
    color: #17242e !important;
}

body.ase-hero-header-overlay :where(
    .main-navigation .sub-menu,
    .main-navigation .children,
    .wp-block-navigation__submenu-container,
    .wp-block-navigation__responsive-container.is-menu-open
) {
    color: var(--ase-ink, #17242e) !important;
    background: var(--ase-card, #fff) !important;
    box-shadow: 0 14px 40px rgb(7 18 29 / 0.18);
}

body.ase-hero-header-overlay :where(
    .main-navigation .sub-menu,
    .main-navigation .children,
    .wp-block-navigation__submenu-container,
    .wp-block-navigation__responsive-container.is-menu-open
) a {
    color: var(--ase-ink, #17242e) !important;
}

@media (max-width: 782px) {
    body.admin-bar.ase-hero-header-overlay.ase-header-minimal :where(
        .site-header,
        #masthead,
        header.wp-block-template-part,
        .wp-site-blocks > header
    ) {
        top: 46px !important;
    }

    body.ase-hero-header-overlay .ase-site .ase-hero--background {
        padding-top: clamp(8.5rem, 28vw, 11rem);
    }
}
