/**
 * ZARE Theme semantic Button state foundation.
 *
 * Core Button remains the authoring primitive. Variants own their complete
 * interaction state matrix; this file never invents persistent selected state
 * for ordinary CTA links/buttons.
 */

@media (hover: hover) and (pointer: fine) {
	.wp-block-button:not(.is-style-outline):not(.is-style-secondary):not(.is-style-ghost):not(.is-style-link):not(.is-style-destructive) .wp-block-button__link:not(.has-background):hover:not([aria-disabled="true"]),
	.zare-theme-ui-button:not(.zare-theme-ui-button--secondary):not(.zare-theme-ui-button--outline):not(.zare-theme-ui-button--ghost):not(.zare-theme-ui-button--link):not(.zare-theme-ui-button--destructive):hover:not(:disabled):not([aria-disabled="true"]),
	.wp-block-search__button:hover:not(:disabled) {
		background: color-mix(in srgb, var(--wp--preset--color--primary) 90%, var(--wp--preset--color--background));
		color: var(--wp--preset--color--primary-foreground);
	}

	.wp-block-button.is-style-secondary .wp-block-button__link:hover:not([aria-disabled="true"]),
	.zare-theme-ui-button--secondary:hover:not(:disabled):not([aria-disabled="true"]) {
		background: color-mix(in srgb, var(--wp--preset--color--secondary) 88%, var(--wp--preset--color--foreground));
		color: var(--wp--preset--color--secondary-foreground);
	}

	.wp-block-button.is-style-outline .wp-block-button__link:hover:not([aria-disabled="true"]),
	.wp-block-button.is-style-ghost .wp-block-button__link:hover:not([aria-disabled="true"]),
	.zare-theme-ui-button--outline:hover:not(:disabled):not([aria-disabled="true"]),
	.zare-theme-ui-button--ghost:hover:not(:disabled):not([aria-disabled="true"]),
	.zare-theme-ui-icon-button:hover:not(:disabled):not([aria-disabled="true"]) {
		background: var(--wp--preset--color--accent);
		color: var(--wp--preset--color--accent-foreground);
	}

	.wp-block-button.is-style-destructive .wp-block-button__link:hover:not([aria-disabled="true"]),
	.zare-theme-ui-button--destructive:hover:not(:disabled):not([aria-disabled="true"]) {
		background: color-mix(in srgb, var(--wp--preset--color--destructive) 90%, var(--wp--preset--color--background));
		color: var(--wp--preset--color--destructive-foreground);
	}

	.wp-block-button.is-style-link .wp-block-button__link:hover:not([aria-disabled="true"]),
	.zare-theme-ui-button--link:hover:not(:disabled):not([aria-disabled="true"]) {
		text-decoration-thickness: 2px;
	}
}

.wp-block-button:not(.is-style-outline):not(.is-style-secondary):not(.is-style-ghost):not(.is-style-link):not(.is-style-destructive) .wp-block-button__link:not(.has-background):focus-visible,
.zare-theme-ui-button:not(.zare-theme-ui-button--secondary):not(.zare-theme-ui-button--outline):not(.zare-theme-ui-button--ghost):not(.zare-theme-ui-button--link):not(.zare-theme-ui-button--destructive):focus-visible,
.wp-block-search__button:focus-visible {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary-foreground);
}

.wp-block-button.is-style-secondary .wp-block-button__link:focus-visible,
.zare-theme-ui-button--secondary:focus-visible {
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--secondary-foreground);
}

.wp-block-button.is-style-destructive .wp-block-button__link:focus-visible,
.zare-theme-ui-button--destructive:focus-visible {
	background: var(--wp--preset--color--destructive);
	color: var(--wp--preset--color--destructive-foreground);
}

.wp-block-button.is-style-outline .wp-block-button__link:focus-visible,
.wp-block-button.is-style-ghost .wp-block-button__link:focus-visible,
.zare-theme-ui-button--outline:focus-visible,
.zare-theme-ui-button--ghost:focus-visible,
.zare-theme-ui-icon-button:focus-visible {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-foreground);
}

.wp-block-button.is-style-link .wp-block-button__link:focus-visible,
.zare-theme-ui-button--link:focus-visible {
	text-decoration-thickness: 2px;
}

.wp-block-button:not(.is-style-outline):not(.is-style-secondary):not(.is-style-ghost):not(.is-style-link):not(.is-style-destructive) .wp-block-button__link:not(.has-background):active:not([aria-disabled="true"]),
.zare-theme-ui-button:not(.zare-theme-ui-button--secondary):not(.zare-theme-ui-button--outline):not(.zare-theme-ui-button--ghost):not(.zare-theme-ui-button--link):not(.zare-theme-ui-button--destructive):active:not(:disabled):not([aria-disabled="true"]),
.wp-block-search__button:active:not(:disabled) {
	background: color-mix(in srgb, var(--wp--preset--color--primary) 84%, var(--wp--preset--color--background));
	color: var(--wp--preset--color--primary-foreground);
}

.wp-block-button.is-style-secondary .wp-block-button__link:active:not([aria-disabled="true"]),
.zare-theme-ui-button--secondary:active:not(:disabled):not([aria-disabled="true"]) {
	background: color-mix(in srgb, var(--wp--preset--color--secondary) 82%, var(--wp--preset--color--foreground));
	color: var(--wp--preset--color--secondary-foreground);
}

.wp-block-button:is(.is-style-outline, .is-style-ghost) .wp-block-button__link:active:not([aria-disabled="true"]),
.zare-theme-ui-button--outline:active:not(:disabled):not([aria-disabled="true"]),
.zare-theme-ui-button--ghost:active:not(:disabled):not([aria-disabled="true"]) {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 88%, var(--wp--preset--color--foreground));
	color: var(--wp--preset--color--accent-foreground);
}

.wp-block-button.is-style-destructive .wp-block-button__link:active:not([aria-disabled="true"]),
.zare-theme-ui-button--destructive:active:not(:disabled):not([aria-disabled="true"]) {
	background: color-mix(in srgb, var(--wp--preset--color--destructive) 84%, var(--wp--preset--color--background));
	color: var(--wp--preset--color--destructive-foreground);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-button__link,
	.wp-block-search__button,
	.zare-theme-ui-button,
	.zare-theme-ui-icon-button {
		transition: none;
	}
}
