/* Section rhythm belongs to module placement, independently of internal layouts. */
.generated-site [data-live-sections] {
  --module-section-space: 40px;
}
.generated-site [data-live-sections] > :is(.section, .generated-gallery-story, .site-legacy-content) {
  padding-block: var(--module-section-space);
}
.generated-site [data-live-sections] > .site-legacy-content > .site-section {
  padding-block: 0;
}
/* Native figure margins and optional copy must not add a second section gap. */
.generated-site [data-live-sections] > .section > .container {
  margin-block: 0;
}
.generated-site [data-live-sections] > .section > .container > :nth-child(1 of :not([hidden])),
.generated-site [data-live-sections] > .site-legacy-content > .site-section > :nth-child(1 of :not([hidden])),
.generated-site [data-live-sections] > .section > .two-col > div:not(.media-stack) > :nth-child(1 of :not([hidden])),
.generated-site [data-live-sections] > .section .editorial-layout-copy > :nth-child(1 of :not([hidden])) {
  margin-top: 0;
}
.generated-site [data-live-sections] > .section > .container > :nth-last-child(1 of :not([hidden])),
.generated-site [data-live-sections] > .site-legacy-content > .site-section > :nth-last-child(1 of :not([hidden])),
.generated-site [data-live-sections] > .section > .two-col > div:not(.media-stack) > :nth-last-child(1 of :not([hidden])),
.generated-site [data-live-sections] > .section .editorial-layout-copy > :nth-last-child(1 of :not([hidden])),
.generated-site [data-live-sections] > .module-quote figcaption > :nth-last-child(1 of :not([hidden])) {
  margin-bottom: 0;
}
/* Consecutive story galleries remain one continuous narrative. */
.generated-site [data-live-sections] > .generated-gallery-story:has(+ .generated-gallery-story) {
  padding-bottom: 0;
}
.generated-site [data-live-sections] > .generated-gallery-story + .generated-gallery-story {
  padding-top: 10px;
}
@media (max-width: 1100px) {
  .generated-site [data-live-sections] { --module-section-space: 32px; }
}
@media (max-width: 760px) {
  .generated-site [data-live-sections] { --module-section-space: 24px; }
}
