:where(.wpfox-has-group-background-image) {
    position: relative;
    isolation: isolate;
}

.wpfox-has-group-background-image > img.wpfox-group-background-image,
.wpfox-has-group-background-image.wpfox-group-background-image-preview::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
}

.wpfox-has-group-background-image.wpfox-group-background-image-preview::before {
    content: '';
    background-image: var(--wpfox-group-background-image);
    background-size: cover;
    background-position: center;
    opacity: var(--wpfox-group-background-image-opacity, 1);
}

/* The decorative layer must not add a block gap before the first content block. */
:where(.wpfox-has-group-background-image.is-layout-flow, .wpfox-has-group-background-image.is-layout-constrained) > .wpfox-group-background-image + * {
    margin-block-start: 0;
}
