.custom-section {
  background-color: rgb(var(--color-background));
}

.custom-section .block-heading,
.custom-section .subheading {
  width: 100%;
}

.custom-section .custom-html-block {
  background-color: rgb(var(--color-background));
}

.custom-section .subheading,
.custom-section .rte {
  word-break: break-word;
}

/* Background controls are opt-in per section; existing sections keep their styles. */
.custom-section-section--with-background {
  position: relative;
  isolation: isolate;
  background-color: rgb(var(--color-background));
}

.custom-section-section--with-background > .custom-section-background {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

.custom-section-section--with-background > .custom-section-background > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--custom-bg-position, center center);
}

.custom-section-section--with-background > .custom-section,
.custom-section-section--transparent-html > .custom-section .custom-html-block {
  background-color: transparent;
}

@media (max-width: 959px) {
  .custom-section-section--with-background > .custom-section-background > img {
    object-position: var(--custom-bg-mobile-position, center center);
  }
}
