/**
 * Form Styling — native fields
 *
 * Box styling for native <input>/<select> comes from theme.json
 * styles.elements (border, radius, padding, color), applied sitewide (core
 * search block, child-theme forms, etc.). theme.json (WP 6.9) can't express a
 * focus state and has no <textarea> element key, so those two pieces live here.
 *
 * Gravity Forms is branded separately — GF generates its own per-form CSS at a
 * specificity a stylesheet can't beat, so it's themed via the
 * `gform_default_styles` filter in inc/gravity-forms.php, not here.
 */

/* Gravity Forms field row gap. GF's foundation default is 40px, which reads
 * tall; 30px is tighter. This var isn't exposed through gform_default_styles
 * and (unlike the color/palette vars) isn't in GF's per-form inline <style>,
 * so it lives at the foundation layer (.gform-theme--foundation, 0,1,0) — a
 * `.gform-theme`-qualified rule (0,2,0) overrides it. Child themes override
 * with the same selector or higher. */
.gform_wrapper.gform-theme {
	--gf-form-gap-y: 30px;
}

/* Focus ring for native fields (theme.json can't set a focus state in WP 6.9).
 * The box-shadow lays a base-colored separator between field and ring so the
 * ring stays visible on dark section backgrounds, where primary-on-dark alone
 * falls below the 3:1 non-text-contrast threshold (WCAG 1.4.11). */
input:not([type="submit"]):not([type="button"]):not([type="reset"]):focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 1px;
	box-shadow: 0 0 0 1px var(--wp--preset--color--base);
}

/* <textarea> box styling to match the input/select tokens (no theme.json key).
 * Keep these values in sync with styles.elements.input/select in theme.json. */
textarea {
	color: var(--wp--preset--color--contrast);
	background-color: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 0.375rem;
	padding: 0.625rem 0.875rem;
}
