/*
 * JW Canvas Core v0.1.14
 * Structural WordPress/Vantage host bridge only.
 *
 * Core does not restyle, optimize, parse, or rewrite the submitted website
 * payload. These rules do only two host-integration jobs:
 * 1. let the Canvas body reach the viewport edges from Vantage's content shell;
 * 2. suppress Vantage's masthead/menu because JW Canvas always uses the
 *    Canvas payload's own navigation.
 *
 * Navigation geometry and hash alignment follow a one-owner rule. When an
 * embedded JW Core Runtime is present, the payload owns them. Otherwise the
 * fallback runtime in frontend.js owns them. CSS does not add an independent
 * scroll-margin or scroll-padding owner.
 */

body.jw-canvas-core-page {
    overflow-x: hidden;
}

@supports (overflow: clip) {
    body.jw-canvas-core-page {
        overflow-x: clip;
    }
}

/* Vantage containment must not clip the viewport breakout. */
body.jw-canvas-core-page #page-wrapper,
body.jw-canvas-core-page #main.site-main,
body.jw-canvas-core-page #main.site-main > .full-container {
    overflow-x: visible !important;
}

body.jw-canvas-core-page #main.site-main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body.jw-canvas-core-page #main.site-main > .full-container {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/*
 * Break the Canvas body out of the centered Vantage content container without
 * depending on a special row, SiteOrigin setting, or theme full-width option.
 * Horizontal overflow is clipped at the body boundary above.
 */
body.jw-canvas-core-page #jw-canvas-core-main {
    position: relative;
    left: 50%;
    display: block;
    width: 100vw;
    max-width: 100vw;
    margin: 0 0 0 -50vw;
    padding: 0;
    box-sizing: border-box;
}

/*
 * JW Canvas always uses Canvas navigation. Hide the Vantage masthead/menu on
 * every explicitly managed Canvas page. WordPress menu data is not altered.
 */
body.jw-canvas-core-page.jw-canvas-core-nav-canvas #masthead.site-header,
body.jw-canvas-core-page.jw-canvas-core-nav-canvas #masthead .main-navigation,
body.jw-canvas-core-page.jw-canvas-core-nav-canvas #masthead #site-navigation,
body.jw-canvas-core-page.jw-canvas-core-nav-canvas #masthead .main-navigation-container,
body.jw-canvas-core-page.jw-canvas-core-nav-canvas #masthead .menu-wrapper {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

body.jw-canvas-core-page #wpadminbar {
    z-index: 1000000 !important;
}

body.jw-canvas-core-page .jw-canvas-core-skip-target {
    position: relative;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/*
 * Fallback navigation clearance.
 *
 * The fallback runtime creates this placeholder only when the payload does not
 * expose JW Core Runtime as the infrastructure owner. The navigation itself is
 * fixed with inline !important geometry by frontend.js after that ownership
 * decision has been made.
 */
body.jw-canvas-core-page .jw-canvas-core-nav-placeholder {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: var(--jw-canvas-core-nav-height, 0px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
