/**
 * Block style "Section label" for the Paragraph block.
 *
 * Names a section on a template page: a peach box that hugs the text, under
 * a thin orange line across the paragraph's full width. Measured from the
 * 1x Figma export: line 1px #FBB253; box #FFC685 (the design's #FBB253 at
 * about 72% opacity on white, made solid), 40px tall for one line, 44px on
 * each side of the text; text bold 22px with a 29px line height.
 *
 * The paragraph stays full width so its top border draws the line. It is a
 * one-column grid whose column is as wide as the text (capped at the content
 * width, so long names wrap). The ::before layer is positioned against that
 * column's grid area and reaches out into the padding to draw the box.
 *
 * Selectors start with .site-container (front end) or .editor-styles-wrapper
 * (editor) to outrank the theme's paragraph rules without !important.
 */

:is(.site-container, .editor-styles-wrapper) p.is-style-uwcm-section-label {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: minmax(0, max-content);
	justify-content: start;
	padding: 5.5px 44px;
	border-top: 1px solid #fbb253;
	color: var(--wp--preset--color--theme-text, #221e1f);
	font-size: 22px;
	font-weight: 700;
	line-height: 29px;
	text-align: center;
}

/* The box: the text's column plus the padding around it. */
:is(.site-container, .editor-styles-wrapper) p.is-style-uwcm-section-label::before {
	content: "";
	position: absolute;
	/* All four lines: for a positioned layer, an "auto" end line means the
	   paragraph's padding edge, not the end of the column. */
	grid-area: 1 / 1 / 2 / 2;
	inset: -5.5px -44px;
	z-index: -1;
	background-color: #ffc685;
}

/* The paragraph's alignment setting moves the box. */
:is(.site-container, .editor-styles-wrapper) p.is-style-uwcm-section-label.has-text-align-center {
	justify-content: center;
}

:is(.site-container, .editor-styles-wrapper) p.is-style-uwcm-section-label.has-text-align-right {
	justify-content: end;
}
