/* Numeric reference geometry, shared by the editable canvas and published page.
   Only imported blocks opt in; normal templates keep their existing layouts. */
body .site-section[data-reference=true]{--ref-active-width:var(--ref-width,1120px);--ref-active-height:var(--ref-height,0px);--ref-active-media-height:var(--ref-media-height,420px);--ref-active-media-ratio:var(--ref-media-ratio,50);position:relative;min-height:var(--ref-active-height);padding:var(--padding,72px) var(--ref-gutter,24px) var(--ref-padding-bottom,72px);overflow:clip}
body .site-section[data-reference=true]>.section-inner{position:relative;width:100%!important;max-width:var(--ref-active-width)!important;margin-inline:auto;min-height:0;gap:var(--gap,32px);padding:0;box-sizing:border-box}
body .site-section[data-reference=true] .hero-copy{width:100%;min-width:0;box-sizing:border-box}
body .site-section[data-reference=true] :is(h1,h2){font-size:var(--heading,38px);line-height:calc(var(--ref-heading-line,120)/100);max-width:var(--ref-text-width,700px);margin-block:var(--ref-title-top,0px) var(--ref-title-bottom,0px)}
body .site-section[data-reference=true] p{font-size:var(--font,16px);max-width:var(--ref-text-width,700px);margin-block:var(--ref-text-top,20px) var(--ref-text-bottom,0px)}
body .site-section[data-reference=true] :is(.hero-img,.content-img,.canvas-media){max-height:none;min-height:0;border-radius:var(--radius,0px);object-fit:cover}
body .site-section[data-reference=true]>.section-inner>:is(.hero-img,.content-img,.canvas-media){width:100%;height:var(--ref-active-media-height);margin:0}
body .site-section[data-reference=true] .canvas-media>:is(img,.hero-img,.content-img){height:100%;width:100%;max-height:none;object-fit:cover}
body .site-section[data-reference=true][data-reference-placement=split]>.section-inner{display:grid!important;grid-template-columns:minmax(0,calc((100% - var(--gap,32px))*(100 - var(--ref-active-media-ratio))/100)) minmax(0,1fr);align-items:center}
body .site-section[data-reference=true][data-reference-placement=split]>.section-inner>:is(.hero-img,.content-img,.canvas-media){grid-column:2;grid-row:1 / span 4}
body .site-section[data-reference=true][data-reference-placement=split]>.section-inner>:not(.hero-img):not(.content-img):not(.canvas-media){grid-column:1}
body .site-section[data-reference=true][data-reference-placement=split][data-media-side=left]>.section-inner{grid-template-columns:minmax(0,calc((100% - var(--gap,32px))*var(--ref-active-media-ratio)/100)) minmax(0,1fr)}
body .site-section[data-reference=true][data-reference-placement=split][data-media-side=left]>.section-inner>:is(.hero-img,.content-img,.canvas-media){grid-column:1}
body .site-section[data-reference=true][data-reference-placement=split][data-media-side=left]>.section-inner>:not(.hero-img):not(.content-img):not(.canvas-media){grid-column:2}
body .site-section[data-reference=true]:is([data-reference-placement=stack],[data-reference-placement=text])>.section-inner{display:flex!important;flex-direction:column;align-items:stretch}
body .site-section[data-reference=true][data-reference-placement=stack][data-reference-first=true]>.section-inner>:is(.hero-img,.content-img,.canvas-media){order:-1}
body .site-section[data-reference=true][data-reference-placement=overlay]{display:flex;align-items:center;min-height:max(360px,var(--ref-active-height))}
body .site-section[data-reference=true][data-reference-placement=overlay]>.section-inner{position:static;display:block!important}
body .site-section[data-reference=true][data-reference-placement=overlay]>.section-inner>:is(.hero-img,.content-img,.canvas-media){position:absolute;inset:0;z-index:0;width:100%;height:100%;border-radius:0}
body .site-section[data-reference=true][data-reference-placement=overlay]>.section-inner>:not(.hero-img):not(.content-img):not(.canvas-media){position:relative;z-index:2}
body .site-section[data-reference=true][data-reference-placement=overlay]>.section-inner:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#0007,#0002);z-index:1;pointer-events:none}
body .site-section[data-reference=true][data-reference-fullheight=true]{min-height:calc(100svh + var(--ref-viewport-extra,0px))}
body .site-section[data-reference=true][data-reference-media=false] .site-art{display:none}
body .site-section[data-reference=true] .content-columns{margin-top:var(--gap,32px);grid-template-columns:repeat(var(--columns,3),minmax(0,1fr))}
body .site-section[data-reference=true] .content-columns img{height:var(--ref-active-media-height);object-fit:cover;border-radius:var(--radius,0px)}
body .site-section[data-reference=true][style*='--align:center'] :is(h1,h2,p,.hero-copy){margin-inline:auto}
@media(max-width:767px){
 body .site-section[data-reference=true]{--ref-active-width:var(--ref-mobile-width,390px);--ref-active-height:var(--ref-mobile-height,0px);--ref-active-media-height:var(--ref-mobile-media-height,280px);--ref-active-media-ratio:var(--ref-mobile-media-ratio,50);--gap:var(--ref-mobile-gap,20px);min-height:var(--ref-active-height);padding:var(--mobile-padding,40px) var(--ref-mobile-gutter,20px) var(--ref-mobile-padding-bottom,40px)}
 body .site-section[data-reference=true] :is(h1,h2){font-size:var(--mobile-heading,28px);line-height:calc(var(--ref-mobile-heading-line,120)/100);max-width:var(--ref-mobile-text-width,390px);margin-block:var(--ref-mobile-title-top,0px) var(--ref-mobile-title-bottom,0px)}
 body .site-section[data-reference=true] p{font-size:var(--mobile-font,14px);max-width:var(--ref-mobile-text-width,390px);margin-block:var(--ref-mobile-text-top,16px) var(--ref-mobile-text-bottom,0px)}
 body .site-section[data-reference=true]:is([data-reference-mobile=stack],[data-reference-mobile=text])>.section-inner{display:flex!important;flex-direction:column;align-items:stretch;position:relative}
 body .site-section[data-reference=true]:is([data-reference-mobile=stack],[data-reference-mobile=text])>.section-inner>:is(.hero-img,.content-img,.canvas-media){position:relative;inset:auto;width:100%;height:var(--ref-active-media-height);grid-column:auto;grid-row:auto}
 body .site-section[data-reference=true]:not([data-reference-mobile=overlay])>.section-inner:after{display:none}
 body .site-section[data-reference=true][data-reference-mobile=split]>.section-inner{display:grid!important;grid-template-columns:minmax(0,calc((100% - var(--gap,20px))*(100 - var(--ref-active-media-ratio))/100)) minmax(0,1fr);align-items:center}
 body .site-section[data-reference=true][data-reference-mobile=split]>.section-inner>:is(.hero-img,.content-img,.canvas-media){position:relative;inset:auto;grid-column:2;grid-row:1 / span 4;width:100%;height:var(--ref-active-media-height)}
 body .site-section[data-reference=true][data-reference-mobile=split]>.section-inner>:not(.hero-img):not(.content-img):not(.canvas-media){grid-column:1}
 body .site-section[data-reference=true][data-reference-mobile=overlay]{display:flex;align-items:center;min-height:max(300px,var(--ref-active-height))}
 body .site-section[data-reference=true][data-reference-mobile=overlay]>.section-inner{position:static;display:block!important}
 body .site-section[data-reference=true][data-reference-mobile=overlay]>.section-inner>:is(.hero-img,.content-img,.canvas-media){position:absolute;inset:0;z-index:0;width:100%;height:100%}
 body .site-section[data-reference=true][data-reference-mobile=overlay]>.section-inner>:not(.hero-img):not(.content-img):not(.canvas-media){position:relative;z-index:2}
 body .site-section[data-reference=true][data-reference-mobile=overlay]>.section-inner:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#0007,#0002);z-index:1;pointer-events:none}
 body .site-section[data-reference=true][data-reference-mobile=stack]>.section-inner>:is(.hero-img,.content-img,.canvas-media){order:1}
 body .site-section[data-reference=true][data-reference-mobile=stack][data-reference-mobile-first=true]>.section-inner>:is(.hero-img,.content-img,.canvas-media){order:-1}
 body .site-section[data-reference=true] .content-columns{grid-template-columns:repeat(var(--mobile-columns,1),minmax(0,1fr))}
 body .site-section[data-reference=true][data-reference-mobile-fullheight=true]{min-height:calc(100svh + var(--ref-mobile-viewport-extra,0px))}
}

/* Structured references use native widgets inside measured nested containers. */
.site-section[data-reference-mounted="true"]{padding:0!important;min-height:0!important}
.site-section[data-reference-mounted="true"]>.section-inner{display:block!important;width:100%!important;max-width:none!important;padding:0!important;margin:0!important;min-height:0!important}
.reference-branch,.reference-branch .widget-node{box-sizing:border-box;min-width:0}
.reference-branch .widget-node{max-width:100%;overflow-wrap:anywhere}
.reference-branch .canvas-media>img{display:block;width:100%;height:100%;object-fit:cover}
.reference-branch .widget-node:empty:not([contenteditable]){display:none}
/* Keep an empty editing host focusable while replacing its text. */
.reference-branch .widget-node[contenteditable]{min-height:1.5em}
.site-section[data-reference-mounted="true"]{width:100%;max-width:100%;overflow:clip;box-sizing:border-box}
