/*
 * Buttons — one system for the whole site.
 *
 * Loaded after main.css on every template, so it overrides the compiled rules there
 * without touching that file.
 *
 * What it replaces, and why:
 *
 *   pulse-glow / pulse-blue / pulse-series — three infinite keyframe animations that
 *   repainted a 40px box-shadow twice a second on every button, on every page, forever.
 *   Buttons that throb do not read as "click me", they read as "advert".
 *
 *   transform: scale(1.1) on hover — grew the button by 10%, nudged whatever sat beside
 *   it and left the label blurred mid-transform. Replaced by a 1px lift and a shadow,
 *   which is the same signal without the layout jitter.
 *
 * The palette stays the site's: orange for the primary action, blue for the secondary,
 * outline for tertiary. The change is in weight and behaviour, not in hue.
 */

:root {
	--btn-radius: 10px;
	--btn-pad-y: 0.8rem;
	--btn-pad-x: 1.75rem;

	--btn-primary: var(--button_main_background, #f69104);
	--btn-primary-hover: #ffa524;
	--btn-primary-ink: #0b1020;

	--btn-secondary: #1c3bff;
	--btn-secondary-hover: #2f4cff;
	--btn-secondary-ink: #ffffff;

	--btn-ghost-ink: #dee1ff;
	--btn-ghost-line: rgba(175, 183, 255, 0.4);

	--btn-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
	--btn-shadow-hover: 0 10px 24px rgba(0, 0, 0, 0.4);
	--btn-ease: 0.18s ease;
}

/* ---------- Base ---------- */

.btn,
.hero__cta,
.single-button .btn,
.download-link .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: var(--btn-pad-y) var(--btn-pad-x);
	border: 1px solid transparent;
	border-radius: var(--btn-radius);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;

	/* The one line that stops all three pulse animations. */
	animation: none;
	transition: background-color var(--btn-ease), border-color var(--btn-ease),
		color var(--btn-ease), transform var(--btn-ease), box-shadow var(--btn-ease);
}

/* ---------- Primary ---------- */

.btn,
.hero__cta {
	background: var(--btn-primary);
	color: var(--btn-primary-ink);
	box-shadow: var(--btn-shadow);
}

.btn:hover,
.hero__cta:hover {
	background: var(--btn-primary-hover);
	color: var(--btn-primary-ink);
	transform: translateY(-1px);
	box-shadow: var(--btn-shadow-hover);
}

/* ---------- Secondary ---------- */

.btn.btn-white {
	background: var(--btn-secondary);
	color: var(--btn-secondary-ink);
	animation: none;
	box-shadow: var(--btn-shadow);
}

.btn.btn-white:hover {
	background: var(--btn-secondary-hover);
	color: var(--btn-secondary-ink);
	transform: translateY(-1px);
	box-shadow: var(--btn-shadow-hover);
}

/* ---------- Tertiary / outline ---------- */

.hero__ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1.5rem;
	border: 1px solid var(--btn-ghost-line);
	border-radius: var(--btn-radius);
	background: transparent;
	color: var(--btn-ghost-ink);
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	animation: none;
	transition: background-color var(--btn-ease), border-color var(--btn-ease),
		color var(--btn-ease);
}

.hero__ghost:hover {
	border-color: var(--btn-primary);
	background: rgba(246, 145, 4, 0.1);
	color: #ffffff;
	transform: none;
}

/* ---------- Buttons that hold a promo code ---------- */

/*
 * .btn .span and .btn .code come from the header CTA markup. The divider used to be a
 * black 1px border with 1rem of padding, which on the orange fill read as a crack.
 */
.btn .span {
	min-width: 0;
	padding: 0;
	gap: 0.4rem;
	font: inherit;
}

.btn .code {
	padding: 0 0 0 0.7rem;
	margin-left: 0.2rem;
	border-left: 1px solid rgba(11, 16, 32, 0.28);
	font-weight: 700;
}

.btn.btn-white .code {
	border-left-color: rgba(255, 255, 255, 0.35);
}

/* ---------- Header ---------- */

.header__list-btn .btn {
	padding: 0.6rem 1.35rem;
	font-size: 0.875rem;
}

/*
 * The nav-item variant keeps its !important colour from main.css; only the animation and
 * the scale hover are overridden here.
 */
.header nav ul .btn a {
	animation: none;
	border-radius: var(--btn-radius);
}

.header__list-btn .list-b-i a {
	animation: none;
}

.header__list-btn .list-b-i a:hover {
	transform: translateY(-1px);
}

/* ---------- Back to top ---------- */

.scroll-btn {
	width: 42px;
	height: 42px;
	border-radius: var(--btn-radius);
	background-color: rgba(0, 20, 44, 0.9);
	border: 1px solid var(--btn-ghost-line);
	color: var(--btn-ghost-ink);
	box-shadow: var(--btn-shadow);
	opacity: 1;
	transition: background-color var(--btn-ease), color var(--btn-ease),
		border-color var(--btn-ease);
}

.scroll-btn:hover {
	background-color: var(--btn-primary);
	border-color: var(--btn-primary);
	color: var(--btn-primary-ink);
}

.scroll-btn:active {
	transform: none;
}

/* ---------- Focus ---------- */

/*
 * main.css sets outline:0 on everything, which left keyboard users with no focus ring at
 * all. :focus-visible restores one without showing it on mouse clicks.
 */
.btn:focus-visible,
.hero__cta:focus-visible,
.hero__ghost:focus-visible,
.scroll-btn:focus-visible,
.slider__nav:focus-visible {
	outline: 2px solid var(--btn-primary);
	outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.btn,
	.btn:hover,
	.hero__cta,
	.hero__cta:hover,
	.hero__ghost,
	.scroll-btn {
		transform: none;
		transition: none;
	}
}

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
	:root {
		--btn-pad-x: 1.25rem;
		--btn-pad-y: 0.7rem;
	}

	.btn,
	.hero__cta {
		font-size: 0.875rem;
	}
}
