/*
 * Hubka Theme
 *
 * Phase: 11B.2 — Global Foundation
 * Purpose: Generic form-element foundation: inputs, textarea, select, labels, focus states, placeholders.
 *
 * Rules:
 * - Reuse theme.json tokens.
 * - Use logical properties.
 * - Keep selectors shallow.
 * - Do not duplicate component styling.
 */

/*
 * Base forms — generic form-element foundation.
 *
 * Covers raw HTML form elements (input, textarea, select) that theme.json
 * cannot style directly — it only reaches block-level markup (e.g. the
 * Search block), not plain elements rendered by WooCommerce's own forms
 * or the native product-search block's <input>. WooCommerce checkout
 * fields and any component-specific form styling belong to their own
 * dedicated phases, not here.
 *
 * The 0.375rem radius intentionally matches the button/image radius
 * already set in theme.json (styles.elements.button.border.radius); that
 * value isn't exposed as a reusable custom property by WordPress's global
 * styles engine, so it's restated here rather than invented as a new one.
 */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
textarea,
select {
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--text);
	background-color: var(--wp--preset--color--background);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.375rem;
	padding-block: var(--wp--preset--spacing--30);
	padding-inline: var(--wp--preset--spacing--40);
	max-inline-size: 100%;
}

textarea {
	min-block-size: 6em;
}

label {
	display: block;
	margin-block-end: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--text);
}

::placeholder {
	color: var(--wp--preset--color--muted);
	opacity: 1;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 1px;
}
