/* Bigham Agency Button widget — scoped styles for `.bigham-button`.
 * Mirrors the Figma `Button` component set (Style: Primary / Outline / Text /
 * Cream × State: Default / Hover). All colours, typography, spacing and radii
 * consume CSS Manager tokens. Zero hardcoded hex / font-family / spacing values.
 *
 * Each style only sets the private --_* variables; the base rules read them.
 * A new style = one modifier block of variables.
 *
 * Allowed exceptions (see references/token-system.md):
 *   - 2px focus-outline width / offset (project-wide focus-ring convention).
 *   - 1.25em arrow box: the Figma arrow is 20px beside 16px text, so it
 *     scales with the label rather than a fixed token. Its -0.125em block
 *     margin lets it overhang the 1em line box, so the button height matches
 *     Figma (strokes inside the 44px box) instead of growing by the arrow.
 *   - 0.2em underline offset on the Text style (typographic, relative to type).
 *
 * Hardening: Hello Elementor's reset and the kit style every <a> (colour,
 * hover colour, decoration); visual properties carry !important
 * (references/css-hardening.md).
 */

.bigham-button {
	/* Primary is the default look. */
	--_bg: var(--button-primary-background);
	--_border: var(--button-primary-border);
	--_text: var(--button-primary-text);
	--_bg-hover: var(--button-primary-background-hover);
	--_border-hover: var(--button-primary-border-hover);
	--_text-hover: var(--button-primary-text-hover);

	display: inline-flex !important;
	align-items: center;
	min-block-size: var(--button-height);
	gap: var(--space-2);
	padding: var(--space-2) var(--space-4) !important;
	font-family: var(--font-family-secondary);
	font-size: var(--font-size-text-small);
	font-weight: var(--font-weight-medium);
	line-height: var(--line-height-button);
	letter-spacing: var(--tracking-normal);
	color: var(--_text) !important;
	background-color: var(--_bg) !important;
	border: var(--border-width-main) solid var(--_border) !important;
	border-radius: var(--radius-small) !important;
	text-decoration: none !important;
	transition:
		color var(--duration-fast) var(--ease-standard),
		background-color var(--duration-fast) var(--ease-standard),
		border-color var(--duration-fast) var(--ease-standard);
}

.bigham-button:hover,
.bigham-button:focus-visible {
	color: var(--_text-hover) !important;
	background-color: var(--_bg-hover) !important;
	border-color: var(--_border-hover) !important;
}

.bigham-button__arrow {
	flex-shrink: 0;
	width: 1.25em;
	height: 1.25em;
	margin-block: -0.125em;
	transition: transform var(--duration-fast) var(--ease-standard);
}

.bigham-button:hover .bigham-button__arrow {
	transform: translateX(calc(var(--space-1) / 2));
}

/* --- Styles --- */

.bigham-button--outline {
	--_bg: var(--button-secondary-background);
	--_border: var(--button-secondary-border);
	--_text: var(--button-secondary-text);
	--_bg-hover: var(--button-secondary-background-hover);
	--_border-hover: var(--button-secondary-border-hover);
	--_text-hover: var(--button-secondary-text-hover);
}

/* Fixed look on any background (Figma binds it to the swatches directly). */
.bigham-button--cream {
	--_bg: var(--cream);
	--_border: var(--cream);
	--_text: var(--dark-900);
	--_bg-hover: var(--dark-900);
	--_border-hover: var(--dark-900);
	--_text-hover: var(--cream);
}

.bigham-button--text {
	--_bg: var(--transparent);
	--_border: var(--transparent);
	--_text: var(--text-link-text);
	--_bg-hover: var(--transparent);
	--_border-hover: var(--transparent);
	--_text-hover: var(--text-link-text-hover);

	gap: var(--space-1);
	padding: 0 !important; /* keeps the 44px min height: the whole row is the tap target (Figma hit area) */
	border-width: 0 !important;
	border-radius: 0 !important;
}

.bigham-button--text .bigham-button__label {
	text-decoration: underline;
	text-decoration-color: var(--transparent);
	text-decoration-thickness: var(--border-width-main);
	text-underline-offset: 0.2em;
	transition: text-decoration-color var(--duration-fast) var(--ease-standard);
}

.bigham-button--text:hover .bigham-button__label,
.bigham-button--text:focus-visible .bigham-button__label {
	text-decoration-color: var(--text-link-border-hover);
}

/* --- Sizes --- */

/* Large: the page's main call to action (Paul's hero mockup, 22 November 2026):
 * 18pt bold capitals on a pill. Combines with any style. */
.bigham-button--large {
	padding: var(--space-2) var(--space-7) !important;
	font-size: var(--font-size-button-large);
	font-weight: var(--font-weight-bold);
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	border-radius: var(--radius-round) !important;
}

/* Focus indicator — brand outline, project focus-ring convention. */
.bigham-button:focus-visible {
	outline: 2px solid var(--theme-accent);
	outline-offset: 2px;
}

/* Reduced motion: instant state changes, no arrow nudge. */
@media (prefers-reduced-motion: reduce) {
	.bigham-button,
	.bigham-button * {
		transition: none !important;
	}

	.bigham-button:hover .bigham-button__arrow {
		transform: none;
	}
}
