/*
 * Theme buttons — the Sunset outline CTA from the Dapper design.
 *
 * theme.json (styles.elements.button) owns the geometry the block editor needs
 * to know about: the clipped bottom-right corner, the 1px #FFB162 border, the
 * transparent fill and the Rig Sans Bold / uppercase / 0.1em label. This file
 * adds what theme.json can't express — the gradient-clipped label, the hover
 * fill, and focus states — and makes non-block buttons (.theme-button, applied
 * to Gravity Forms submits by lwh_add_custom_css_classes) match.
 *
 * Comp: 248x60, border-radius 20px 20px 0 20px, label gradient #FFB162→#A35139.
 * Hover: fill becomes the vertical gradient, label goes solid white.
 */

.theme-button,
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 248px;
	min-height: 60px;
	padding: 18px 32px;
	border: 1px solid var(--lwh-sunset-solid, #ffb162);
	border-radius: var(--lwh-clip-corner, 20px) var(--lwh-clip-corner, 20px) 0 var(--lwh-clip-corner, 20px);
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: var(--wp--preset--font-size--eyebrow, 18px);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: 0.1em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background-image 0.3s ease, color 0.3s ease, border-color 0.3s ease;

	/* Gradient-clipped label: the gradient paints only where the glyphs are, so
	   the fill reads as transparent. On hover the clip moves to the padding box
	   and the gradient becomes the fill instead. */
	background-color: transparent;
	background-image: var(--lwh-sunset);
	background-clip: text;
	-webkit-background-clip: text;
	color: transparent;
}

.theme-button:hover,
.theme-button:focus-visible,
.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	/* padding-box clip puts the gradient back on the fill instead of the text */
	background-clip: padding-box;
	-webkit-background-clip: padding-box;
	background-image: linear-gradient(180deg, #ffb162 0%, #a35139 100%);
	color: var(--wp--preset--color--white, #fff);
}

.theme-button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--linen, #d7d0c7);
	outline-offset: 3px;
}

/* background-clip:text unsupported — fall back to a solid amber label */
@supports not ((background-clip: text) or (-webkit-background-clip: text)) {
	.theme-button,
	.wp-block-button__link {
		background-image: none;
		color: var(--lwh-sunset-solid, #ffb162);
	}
}

/* Windows high contrast: transparent text would disappear entirely */
@media (forced-colors: active) {
	.theme-button,
	.wp-block-button__link {
		background-image: none;
		color: ButtonText;
	}
}

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