/**
 * Brand Foundation base styles.
 *
 * Every value comes from theme.json presets (--wp--preset--*) or the theme's
 * custom properties (--wp--custom--bfnd--*). Do not add brand colours, font
 * names or text here. Logical properties keep the file direction-neutral.
 */

/*
 * Visible focus indicator. It is enforced and cannot be switched off
 * from Global Styles.
 */
:where(
a,
button,
input,
select,
textarea,
summary,
[tabindex],
.wp-element-button,
.wp-block-button__link
):focus-visible {
	outline:
		var(--wp--custom--bfnd--focus-width, 2px)
		solid
		var(--wp--custom--bfnd--focus-colour, currentcolor) !important;
	outline-offset: 2px !important;
}

/* Skip link (core adds the link; this keeps it legible with brand colours). */
.skip-link.screen-reader-text:focus {
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--body);
	z-index: 100000;
}

/* Logos. */
.wp-block-site-logo img,
.bfnd-logo img {
	block-size: auto;
	max-inline-size: var(--wp--custom--bfnd--logo-max-width, 200px);
}

.bfnd-logo--inverse img {
	max-inline-size: var(--wp--custom--bfnd--logo-max-width, 200px);
}

/* Brand placeholder text when no logo is set. */
.bfnd-logo-fallback {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
}

/* Cards (Group block style "Card"). */
.is-style-bfnd-card {
	border-radius: var(--wp--preset--border-radius--brand);
	box-shadow: var(--wp--preset--shadow--card);
}

/*
 * Form controls follow the brand radius and keep a 3:1 border contrast
 * via neutral dark.
 */
:where(
input:not([type="checkbox"], [type="radio"], [type="submit"]),
select,
textarea
) {
	border: 1px solid var(--wp--preset--color--text-muted);
	border-radius: var(--wp--preset--border-radius--brand);
	font: inherit;
	padding-block: 0.5em;
	padding-inline: 0.75em;
}

/* Third-party embeds (Jotform, Brevo) load only where their pattern is used. */
.bfnd-embed {
	inline-size: 100%;
}

.bfnd-embed iframe {
	border: 0;
	inline-size: 100%;
	min-block-size: 36rem;
}

.bfnd-embed__notice {
	background-color: var(--wp--preset--color--surface);
	border-inline-start: 4px solid var(--wp--preset--color--warning);
	padding: var(--wp--preset--spacing--40);
}

/* Contact list. */
.bfnd-contact-list {
	list-style: none;
	padding-inline-start: 0;
}

/* Reduced motion. */
@media (prefers-reduced-motion: reduce) {

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/*
 * Links on dark brand backgrounds take the contrast-checked "on-" text
 * colour of their section.
 */
:where(
.has-neutral-dark-background-color,
.has-primary-background-color,
.has-secondary-background-color
) a:where(:not(.wp-element-button)) {
	color: inherit;
}
