/* ABOUTME: Aligns core `core/button` with YCV UI tokens (tight radius, accent fill). */
/* ABOUTME: User-chosen colors win via `has-background` or inline `background-color`. */

/* Match Quick Links “Buttons” variant label typography. */
.wp-block-button .wp-block-button__link {
	font-size: var(--ycvds-font-size-base);
	font-weight: var(--ycvds-weight-bold);
	line-height: 1.35;
	text-transform: uppercase;
	letter-spacing: var(--ycvds-tracking-wide);
}

.wp-block-button:not(.is-style-squared) .wp-block-button__link {
	border-radius: var(--ycvds-ui-button-border-radius);
	padding: var(--ycvds-ui-button-padding-y) var(--ycvds-ui-button-padding-x);
	box-shadow: var(--ycvds-ui-button-box-shadow);
}

.wp-block-button.is-style-squared .wp-block-button__link {
	border-radius: 0;
}

/* Fill (default): accent when the block did not set a background. */
.wp-block-button:not(.is-style-outline):not(.is-style-squared)
	.wp-block-button__link:not(.has-background):not([style*="background"]) {
	background-color: var(--ycvds-color-accent);
	color: var(--ycvds-ui-button-text-on-fill);
	border: none;
}

.wp-block-button:not(.is-style-outline):not(.is-style-squared)
	.wp-block-button__link:not(.has-background):not([style*="background"]):hover {
	background: color-mix(
		in srgb,
		var(--ycvds-color-accent) 88%,
		var(--ycvds-color-text) 12%
	);
	box-shadow: 0 2px 10px rgb(0 0 0 / 14%);
	color: var(--ycvds-ui-button-text-on-fill);
}

.wp-block-button:not(.is-style-outline):not(.is-style-squared)
	.wp-block-button__link:not(.has-background):not([style*="background"]):focus-visible {
	outline: 2px solid var(--ycvds-ui-button-text-on-fill);
	outline-offset: 2px;
}

/* Palette / custom fills: hover was missing when `has-background` hid the default mix rule. */
.wp-block-button:not(.is-style-outline):not(.is-style-squared)
	.wp-block-button__link.has-background:hover {
	filter: brightness(0.94);
	box-shadow: 0 2px 10px rgb(0 0 0 / 14%);
}

/* Accent preset: same hover mix as default orange (avoid stacking filter on top). */
.wp-block-button:not(.is-style-outline):not(.is-style-squared)
	.wp-block-button__link.has-accent-background-color:hover,
.wp-block-button:not(.is-style-outline):not(.is-style-squared)
	.wp-block-button__link[style*="--wp--preset--color--accent"]:hover {
	background: color-mix(
		in srgb,
		var(--wp--preset--color--accent) 88%,
		var(--ycvds-color-text) 12%
	) !important;
	box-shadow: 0 2px 10px rgb(0 0 0 / 14%);
	color: var(--ycvds-ui-button-text-on-fill);
	filter: none;
}
