/*
 * Section block — srdss/section.
 *
 * Every value arrives as a custom property in the block's own style
 * attribute, and every property here is declared only under a class the
 * block adds when that value is set. A bare var() would be worse than no
 * rule: an unset variable computes to the property's initial value, so an
 * untouched section would zero the theme's own block-gap margin.
 *
 * The Tablet and Mobile rules are not in this file. A @media condition
 * cannot read a variable, so srdss_section_responsive_css() prints them
 * inline after this file, with the breakpoints from the settings. They use
 * the same (0,2,0) selectors, so the later rule wins.
 *
 * (0,2,0) rather than (0,1,0) because core's flow layout sets the block gap
 * at `:root :where(.is-layout-flow) > *`, which is (0,1,0) and would tie.
 */

.srd-section {
	position: relative;
	box-sizing: border-box;
}

/*
 * One longhand per side, never the padding shorthand. A side the block
 * leaves blank must fall through to the site default (`div.srd-section`,
 * printed inline from the General screen, (0,1,1)) rather than be zeroed.
 */
.srd-section.srd-section--pt-d { padding-top: var(--srd-section-pt-d); }
.srd-section.srd-section--pr-d { padding-right: var(--srd-section-pr-d); }
.srd-section.srd-section--pb-d { padding-bottom: var(--srd-section-pb-d); }
.srd-section.srd-section--pl-d { padding-left: var(--srd-section-pl-d); }
.srd-section.srd-section--mt-d { margin-top: var(--srd-section-mt-d); }
.srd-section.srd-section--mb-d { margin-bottom: var(--srd-section-mb-d); }

/*
 * Retired: what 0.47.0 saved, a padding shorthand per device. Kept so a
 * section saved then renders unchanged until the editor migrates it, which it
 * does on the next edit (the `deprecated` entry in editor.js).
 */
.srd-section.srd-section--pad-d { padding: var(--srd-section-pad-d); }

/*
 * The overlay is a ::before at z-index -1 inside a stacking context the
 * section makes for itself. That paints it above the section's own
 * background and below its content, without giving the children a
 * position or a z-index, which would override whatever they already use.
 *
 * isolation: isolate, not z-index, because a z-index would also reorder
 * the section against its siblings.
 */
.srd-section.srd-section--overlay {
	isolation: isolate;
}

.srd-section.srd-section--overlay::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: -1;
	border-radius: inherit;
	background-color: var(--srd-section-overlay);
	opacity: var(--srd-section-overlay-opacity, 0.5);
	pointer-events: none;
}
