/**
 * PRS Block Reset
 *
 * Resets WP core block styles inside PRS custom blocks.
 * Uses :where() for zero specificity so component CSS in main.css always wins.
 * Loaded BEFORE main.css.
 */

/* ---------------------------------------------------------------------------
 * 1. Layout flow/constrained margins → 0 inside PRS blocks
 *    WP adds margin-block-start: 24px to every child via .is-layout-flow
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.is-layout-flow) > *,
:where([class*="prs-"]) :where(.is-layout-constrained) > *,
:where([class*="prs-"]) :where(.is-layout-flex) > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

:where([class*="prs-"]) > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* ---------------------------------------------------------------------------
 * 2. Constrained layout max-width removal inside PRS blocks
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.is-layout-constrained) > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

/* ---------------------------------------------------------------------------
 * 3. WP button base reset inside PRS blocks
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.wp-element-button),
:where([class*="prs-"]) :where(.wp-block-button__link) {
	background-color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 600;
	padding: 1rem 2rem;
	border-radius: 0.5rem;
	line-height: 1.5;
	text-decoration: none;
	transition: background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

/* Outline button variant */
:where([class*="prs-"]) :where(.is-style-outline) :where(.wp-block-button__link) {
	background-color: transparent;
	border: 2px solid color-mix(in srgb, var(--wp--preset--color--dark) 20%, transparent);
	color: var(--wp--preset--color--dark);
	padding: calc(1rem - 2px) calc(2rem - 2px);
}
:where([class*="prs-"]) :where(.is-style-outline) :where(.wp-block-button__link):hover {
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

/* ---------------------------------------------------------------------------
 * 4. WP image/figure margin reset inside PRS blocks
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.wp-block-image) {
	margin: 0;
}
:where([class*="prs-"]) :where(.wp-block-image) img {
	display: block;
	max-width: 100%;
	height: auto;
}
:where([class*="prs-"]) :where(figure) {
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * 5. WP heading reset inside PRS blocks
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.wp-block-heading) {
	margin-block-start: 0;
	margin-block-end: 0;
	font-family: var(--wp--preset--font-family--display);
}

/* ---------------------------------------------------------------------------
 * 6. WP paragraph reset inside PRS blocks
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.wp-block-paragraph) {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* ---------------------------------------------------------------------------
 * 7. WP buttons wrapper reset inside PRS blocks
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.wp-block-buttons) {
	margin-block-start: 0;
	margin-block-end: 0;
}
:where([class*="prs-"]) :where(.wp-block-buttons) :where(.wp-block-button) {
	margin: 0;
}

/* ---------------------------------------------------------------------------
 * 8. WP group wrapper reset inside PRS blocks
 * --------------------------------------------------------------------------- */
:where([class*="prs-"]) :where(.wp-block-group) {
	margin-block-start: 0;
	margin-block-end: 0;
	padding: 0;
}

/* ---------------------------------------------------------------------------
 * 9. Font-size presets — controlled via theme.json fontSizes, not here.
 *    theme.json defines: small=0.875rem, medium=1rem, large=1.125rem, x-large=1.5rem
 * --------------------------------------------------------------------------- */
