/* 1.3.1 — Boxed content. Scope width overrides to the portal's own three shells. */
body.np-portal { --np-layout-gutter: 48px; --np-layout-max: 1040px; }
body #np-content-boundary.np-layout-shell,
body.np-portal > header.np-site-header > .np-layout-shell,
body.np-portal > footer.np-site-footer > .np-layout-shell {
    box-sizing: border-box;
    width: min(100%,max(0px,calc(100vw - var(--np-ed-active-gap,var(--np-ed-gap-desktop,48px)))),var(--np-ed-active-width,var(--np-ed-width-desktop,1040px))) !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    float: none;
}
body #np-content-boundary.np-layout-shell { display: block; }
body.np-portal > header.np-site-header > .np-layout-shell { display: flex; }
body.np-portal > footer.np-site-footer > .np-layout-shell { display: grid; }
body.np-portal #main > section,
body.np-portal #main > .np-pd,
body.np-portal #main .table-wrap { min-width: 0; max-width: 100%; }
body.np-portal #main .article .content :is(img, video, iframe),
body.np-portal #main .np-pd-content :is(img, video, iframe) { max-width: 100%; }
body.np-portal #main .article .content :is(.alignwide, .alignfull),
body.np-portal #main .np-pd-content :is(.alignwide, .alignfull) {
    width: auto; max-width: 100%; margin-inline: 0;
}
@media (max-width: 760px) { body.np-portal { --np-layout-gutter: 32px; } }
@media (max-width: 380px) { body.np-portal { --np-layout-gutter: 24px; } }
@media print {
    body #np-content-boundary.np-layout-shell {
        width: 100% !important; max-width: none !important;
    }
}
/* Section editor shells: fixed width fallback survives generic plugin width overrides. */
.np-ed-group,.np-ed-section{min-width:0;max-width:100%;}
.np-ed-section{display:flow-root;}
.np-ed-custom{margin-block:16px;}
.np-ed-custom img{max-width:100%;height:auto;}
.np-ed-custom hr{border:0;border-top:1px solid var(--line);}
:root{--np-layout-gutter:48px;}
@media(max-width:760px){:root{--np-layout-gutter:32px;}}
@media(max-width:380px){:root{--np-layout-gutter:24px;}}

/* Per-shell responsive tokens also work when the published head style is removed. */
.np-layout-shell{--np-ed-active-width:var(--np-ed-width-desktop,1040px);--np-ed-active-gap:var(--np-ed-gap-desktop,48px);}
@media(max-width:1024px){.np-layout-shell{--np-ed-active-width:var(--np-ed-width-tablet,1040px);--np-ed-active-gap:var(--np-ed-gap-tablet,32px);}}
@media(max-width:600px){.np-layout-shell{--np-ed-active-width:var(--np-ed-width-mobile,1040px);--np-ed-active-gap:var(--np-ed-gap-mobile,24px);}}
@media print{body #np-content-boundary.np-layout-shell{--np-ed-active-width:100%!important;--np-ed-active-gap:0px!important;}}

/* 1.8.0: the width boundary belongs to the page template, not to the header.
   Allow the owned boundary to resize even inside older main markup. */
body main#main:has(> #np-content-boundary),
body #main.np-main:has(> #np-content-boundary) {
    width:100%!important;max-width:none!important;min-width:0!important;
    margin-inline:0!important;padding-inline:0!important;box-sizing:border-box!important;
}
body #np-content-boundary.np-content-boundary {
    display:block!important;float:none!important;min-width:0!important;
    margin-inline:auto!important;box-sizing:border-box!important;
    overflow-wrap:anywhere;
}
#np-content-boundary :is(.grid,.split,.hero-grid,.np-pd-hero,.np-pd-body,.feature,.np-mosaic)>* {min-width:0;}
#np-content-boundary :is(img,video,iframe) {max-width:100%;}
#np-content-boundary :is(.table-wrap,.np-ed-section,.np-ed-group) {max-width:100%;min-width:0;}
@media print{body #np-content-boundary.np-layout-shell{--np-ed-active-width:100%!important;--np-ed-active-gap:0px!important;}}
