/**
 * Brand escape hatch.
 *
 * RULES (enforced by scripts/lint-tokens.mjs):
 *   1. No hex colours. No rgb()/hsl() literals.
 *   2. No px/rem/em literals for spacing, radius or font size.
 *   3. No !important.
 *   4. Every value references var(--wp--preset--*) or var(--wp--custom--*).
 *
 * If a change cannot be expressed with a token, the token set is wrong —
 * fix theme.json instead of writing an exception here.
 *
 * Only things theme.json genuinely cannot express belong in this file:
 * transitions on non-element blocks, pseudo-elements, sticky behaviour.
 */

/* Smooth interactions that theme.json has no vocabulary for. */
.wp-element-button,
.wp-block-button__link,
a {
	transition: color var(--wp--custom--transition),
		background-color var(--wp--custom--transition),
		box-shadow var(--wp--custom--transition),
		transform var(--wp--custom--transition);
}

/* Every button hovers, no exceptions. theme.json's button :hover only reaches
   buttons without explicit colours — a preset background class wins with core's
   !important, so recolouring cannot be the universal cue. Motion and shadow
   can: nothing overrides them, whatever colours the block carries. */
.wp-element-button:hover,
.wp-block-button__link:hover {
	transform: translateY(var(--wp--custom--hover--lift));
	box-shadow: var(--wp--custom--shadow--soft);
}

/* Outline buttons have no background to swap, so theme.json's hover never
   shows on them either. Fill them on hover — reads correctly over photos
   (hero) and on light sections alike. */
.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/* Top-level blocks get an automatic margin from blockGap; full-bleed sections
   must butt straight up against the header. */
.wp-site-blocks > main,
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* The header holds both a logo and a text title. Once a logo is set, the text
   would repeat the same words beside the image. */
.has-site-logo .base-title-fallback {
	display: none;
}

/* Header CTA: a button block inside a flex row wants to fill its track. */
.base-header-cta .wp-block-button__link {
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
}

/* Phones (same breakpoint as the navigation overlay, 600px): one row with
   the logo at a fixed height and the menu button; the Contacto button moves
   into the menu (a link marked base-solo-movil) since the floating WhatsApp
   is already the contact on mobile. Range syntax keeps the lint honest. */
@media (width < 600px) {
	.base-header-cta {
		display: none;
	}

	.wp-site-blocks > header .wp-block-site-logo img {
		width: auto;
		height: var(--wp--custom--header--logo-movil);
	}
}

@media (width >= 600px) {
	.base-solo-movil {
		display: none;
	}
}

/* Anchor links land under the sticky header unless the scroll box is padded.
   Smooth scrolling too — a jump cut on a one-page site reads as a page load. */
html {
	scroll-behavior: smooth;
	scroll-padding-top: var(--wp--custom--header--offset);
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.wp-element-button:hover,
	.wp-block-button__link:hover,
	.is-style-card:hover {
		transform: none;
	}
}

/* Sticky header. Behaviour, not style. */
.wp-site-blocks > header {
	position: sticky;
	top: 0;
	z-index: 100;
	backdrop-filter: blur(8px);
}

/* Floating WhatsApp button. The number lives in the link's href so the client
   can change it in the editor; only the positioning is here. */
.is-whatsapp-float {
	position: fixed;
	right: var(--wp--preset--spacing--40);
	bottom: var(--wp--preset--spacing--40);
	z-index: 200;
}

.is-whatsapp-float .wp-block-button__link,
.is-whatsapp-float .wp-block-button__link:hover {
	box-shadow: var(--wp--custom--shadow--lift);
}

/* Fluent Forms ships its own markup, which theme.json cannot reach. Pull its
   fields onto our tokens so the form does not look bolted on. */
.fluentform .ff-el-form-control {
	background: var(--wp--preset--color--base);
	border: var(--wp--custom--border--hairline) solid var(--wp--preset--color--base-alt);
	border-radius: var(--wp--custom--radius--sm);
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	padding: var(--wp--preset--spacing--30);
	width: 100%;
}

.fluentform .ff-el-form-control:focus {
	border-color: var(--wp--preset--color--primary);
	outline: none;
}

.fluentform .ff-el-input--label label {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.fluentform .ff-el-input--content {
	margin-bottom: var(--wp--preset--spacing--30);
}

/* Fluent Forms colours its button from its own custom property:
       form.fluent_form_N .ff-btn-submit { background-color: var(--fluentform-primary) }
   So feed it our token instead of overriding the declaration. No specificity
   fight, and it recolours every accent the plugin derives from that property. */
.fluentform,
.fluentform form,
.frm-fluent-form {
	--fluentform-primary: var(--wp--preset--color--primary);
}

/* Shape and type do need to win: the plugin's rule is 3 classes + 1 element,
   this is 4 classes + 1. Still no !important. */
.fluentform form .ff-btn.ff-btn-submit.ff_btn_style {
	border-radius: var(--wp--custom--radius--pill);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	padding: var(--wp--custom--button--padding-y) var(--wp--custom--button--padding-x);
}

.fluentform form .ff-btn.ff-btn-submit.ff_btn_style:hover {
	background-color: var(--wp--preset--color--secondary);
}

/* Small pill label above a section heading. A paragraph block styled as a
   badge — theme.json cannot express inline-block or the pill shape here. */
.is-style-eyebrow {
	background: var(--wp--preset--color--base);
	border-radius: var(--wp--custom--radius--pill);
	box-shadow: var(--wp--custom--shadow--soft);
	display: inline-block;
	font-weight: 600;
	letter-spacing: var(--wp--custom--tracking--wide);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
	text-transform: uppercase;
}

/* Cards lift on hover — a state theme.json cannot target on group blocks. */
.is-style-card {
	box-shadow: var(--wp--custom--shadow--soft);
	border-radius: var(--wp--custom--radius--md);
	transition: box-shadow var(--wp--custom--transition),
		transform var(--wp--custom--transition);
}

.is-style-card:hover {
	box-shadow: var(--wp--custom--shadow--lift);
	transform: translateY(var(--wp--custom--hover--lift));
}
