/* One content-to-footer gap for every template.
   Load last: the main element owns this space, never both main and Elementor.
   The footer's own dark-background padding remains part of the footer design. */
body.hz-site{--hz-footer-gap:96px}

body.hz-site #hz-main-content{
 display:block;
 padding-bottom:var(--hz-footer-gap);
 margin-bottom:0;
}
body.hz-site .hz-footer.footer-area{margin-top:0}
body.hz-site #hz-main-content .hz-article-end{display:flex;align-items:center;justify-content:center}

/* Plain Elementor pages previously put the same gap on their outer wrapper. */
body.hz-site #hz-main-content:not(.hz-article):not(.hz-archive)>.elementor,
body.hz-site.hz-inner:not(.home) #hz-main-content:not(.hz-article):not(.hz-archive)>.elementor{
 padding-bottom:0;
 margin-bottom:0;
}
body.hz-site #hz-main-content>.container,
body.hz-site #hz-main-content>.container>:last-child,
body.hz-site #hz-main-content>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child>.elementor{
 margin-bottom:0;
}

/* Homepage's final section currently ends with the film. Replace its section
   padding with the shared main gap, while retaining its top/side geometry. */
body.hz-site.home #hz-main-content>.elementor>.hz-home:last-child{
 --padding-bottom:0px;
 padding-bottom:0;
 margin-bottom:0;
}
body.hz-site.home #hz-main-content>.elementor>.hz-home:last-child>.e-con-inner,
body.hz-site.home #hz-main-content>.elementor>.hz-home:last-child>.hz-layout,
body.hz-site.home #hz-main-content>.elementor>.hz-home:last-child>.e-con-inner>.hz-layout{
 padding-bottom:0;
 margin-bottom:0;
}

/* On text-only/static pages, the last magazine row must not add another
   76–108px below the actual content. Earlier editorial section gaps stay intact.
   Support both Elementor container DOM modes (.e-con-inner or direct children). */
body.hz-site #hz-main-content .hz-article-content:last-child>.elementor>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child .hz-magazine-layout>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child .hz-magazine-layout>.e-con-inner>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child .hz-hub>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child .hz-hub>.e-con-inner>:last-child{
 margin-bottom:0;
}

/* Only terminal prose loses its paragraph/list margin; padded cards, image
   stripes, captions, closing actions and borders retain their own geometry. */
body.hz-site #hz-main-content .hz-article-content:last-child :is(.hz-magazine-layout,.hz-hub)>:last-child :is(.elementor-widget-text-editor:last-child,.hz-mag-reading-text:last-child)>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child :is(.hz-magazine-layout,.hz-hub)>.e-con-inner>:last-child :is(.elementor-widget-text-editor:last-child,.hz-mag-reading-text:last-child)>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child .elementor-widget-text-editor:last-child>.elementor-widget-container>:last-child,
body.hz-site #hz-main-content .hz-article-content:last-child>:is(p,ul,ol,figure,blockquote):last-child{
 margin-bottom:0;
}

/* A one-page archive emits an empty nav; it must not contribute a phantom
   64px margin. For real pagination, the final page button remains the endpoint. */
body.hz-site #hz-main-content.hz-archive .hz-pagination:not(:has(.page-numbers)){
 display:none;
 margin:0;
 padding:0;
}
body.hz-site #hz-main-content.hz-archive :is(.hz-pagination,.navigation.pagination,.nav-links){
 margin-bottom:0;
}
body.hz-site #hz-main-content.hz-archive .hz-archive-grid .post-content>:last-child{
 margin-bottom:0;
}

@media(max-width:1023px){body.hz-site{--hz-footer-gap:80px}}
@media(max-width:767px){body.hz-site{--hz-footer-gap:64px}}
