/* Header e footer sono gestiti da Divi e dal Theme Builder. */
body.pixel3-layout #page-container { padding-top: 0 !important; overflow: visible; }
body.pixel3-layout #et-main-area { overflow: visible; }
body.pixel3-layout #main-content { background: var(--bg); color: var(--fg); }
/* L'archivio articoli non riceve pixel3-layout: evita che Divi mostri il bianco durante il fade. */
body.blog #main-content.pixel3-blog-page { background: var(--bg) !important; color: var(--fg); }
/* Le sezioni Divi all'interno del contenuto del post usano lo sfondo del tema. */
body.single-post .pixel3-article-content .et_pb_section { background-color: var(--bg) !important; }

/* Divi nests page sections inside builder wrappers rather than directly under main. */
body.pixel3-layout .pixel3-page-section:not(.pixel3-last-section) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--p3d-chrome-height, var(--header-height)));
  scroll-margin-top: var(--p3d-chrome-height, var(--header-height));
  isolation: isolate;
}
body.pixel3-layout .pixel3-page-section.pixel3-last-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: max(0px, calc(100svh - var(--p3d-visible-header, var(--header-height)) - var(--p3d-visible-footer, 0px)));
  scroll-margin-top: var(--p3d-chrome-height, var(--header-height));
  isolation: isolate;
}
@supports (position: sticky) {
  body.pixel3-layout .pixel3-page-section:not(.pixel3-last-section) {
    position: sticky;
    top: min(var(--p3d-chrome-height, var(--header-height)), calc(100svh - var(--section-height, 100svh)));
    z-index: var(--section-layer, 1);
  }
  body.pixel3-layout .pixel3-page-section.pixel3-last-section {
    position: relative;
    z-index: var(--section-layer, 1);
  }
}
@media (prefers-reduced-motion: no-preference) {
  body.pixel3-layout .pixel3-page-section:not(.pixel3-last-section) {
    opacity: var(--depart-opacity, 1);
    transform: perspective(1200px) scale(var(--depart-scale, 1));
    transform-origin: center top;
  }
  body.pixel3-layout .pixel3-page-section.is-gone {
    visibility: hidden;
    pointer-events: none;
  }
  body.pixel3-layout .pixel3-page-section:has(:focus-visible) {
    opacity: 1;
    transform: none;
  }
}
