/**
 * Theme form fields — match SFW Forms UI (search, comments, widgets, etc.).
 */

:root {
	--sfw-field-paper: #ffffff;
	--sfw-field-ink: #333130;
	--sfw-field-faint: #6a665c;
	--sfw-field-soil: #4f3433;
	--sfw-field-line: rgba(79, 52, 51, 0.22);
	--sfw-field-line-strong: rgba(79, 52, 51, 0.55);
	--sfw-field-accent: #156826;
	--sfw-field-accent-hover: #22371f;
	--sfw-field-radius-input: 1.1em 0.4em;
	--sfw-field-radius-btn: 1.9em 0.6em;
	--sfw-field-radius-btn-hover: 0.6em 1.9em;
	--sfw-field-display: Montserrat, "Helvetica Neue", Arial, sans-serif;
	--sfw-field-sans: "Source Sans 3", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
	--sfw-field-t0: 0.9375rem;
	--sfw-field-dur: 320ms;
	--sfw-field-ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* Scope to page content; skip header chrome and off-canvas. */
#ajax-content-wrap input[type="text"],
#ajax-content-wrap input[type="email"],
#ajax-content-wrap input[type="search"],
#ajax-content-wrap input[type="url"],
#ajax-content-wrap input[type="tel"],
#ajax-content-wrap input[type="number"],
#ajax-content-wrap input[type="password"],
#ajax-content-wrap input[type="date"],
#ajax-content-wrap select,
#ajax-content-wrap textarea,
.container-wrap input[type="text"],
.container-wrap input[type="email"],
.container-wrap input[type="search"],
.container-wrap input[type="url"],
.container-wrap input[type="tel"],
.container-wrap input[type="number"],
.container-wrap input[type="password"],
.container-wrap input[type="date"],
.container-wrap select,
.container-wrap textarea,
#sidebar input[type="text"],
#sidebar input[type="email"],
#sidebar input[type="search"],
#sidebar input[type="url"],
#sidebar input[type="tel"],
#sidebar select,
#sidebar textarea,
.wp-block-search .wp-block-search__input,
.widget_search input[type="text"],
.widget_search input[type="search"],
.search-form input[type="text"],
.search-form input[type="search"],
#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	min-height: 3.5rem;
	margin: 0;
	padding: 0.7em 0.9em !important;
	border: 1px solid var(--sfw-field-line-strong) !important;
	border-radius: var(--sfw-field-radius-input) !important;
	background: var(--sfw-field-paper) !important;
	background-color: var(--sfw-field-paper) !important;
	color: var(--sfw-field-ink) !important;
	font-family: var(--sfw-field-sans) !important;
	font-size: var(--sfw-field-t0) !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	box-shadow: none !important;
	appearance: none;
	-webkit-appearance: none;
}

#ajax-content-wrap textarea,
.container-wrap textarea,
#sidebar textarea,
#commentform textarea,
.comment-form textarea {
	min-height: 8rem;
	height: auto;
	resize: vertical;
}

#ajax-content-wrap select,
.container-wrap select,
#sidebar select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234F3433' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 0.85rem center !important;
	background-size: 12px 8px !important;
	padding-right: 2.2rem !important;
}

#ajax-content-wrap input::placeholder,
#ajax-content-wrap textarea::placeholder,
.container-wrap input::placeholder,
.container-wrap textarea::placeholder,
#sidebar input::placeholder,
#sidebar textarea::placeholder,
.wp-block-search .wp-block-search__input::placeholder,
.search-form input::placeholder,
#commentform input::placeholder,
#commentform textarea::placeholder {
	color: var(--sfw-field-faint);
	opacity: 1;
}

#ajax-content-wrap input:focus,
#ajax-content-wrap input:focus-visible,
#ajax-content-wrap select:focus,
#ajax-content-wrap select:focus-visible,
#ajax-content-wrap textarea:focus,
#ajax-content-wrap textarea:focus-visible,
.container-wrap input:focus,
.container-wrap input:focus-visible,
.container-wrap select:focus,
.container-wrap select:focus-visible,
.container-wrap textarea:focus,
.container-wrap textarea:focus-visible,
#sidebar input:focus,
#sidebar input:focus-visible,
#sidebar select:focus,
#sidebar select:focus-visible,
#sidebar textarea:focus,
#sidebar textarea:focus-visible,
.wp-block-search .wp-block-search__input:focus,
.wp-block-search .wp-block-search__input:focus-visible,
.search-form input:focus,
.search-form input:focus-visible,
#commentform input:focus,
#commentform textarea:focus {
	outline: 3px solid var(--sfw-field-accent) !important;
	outline-offset: 2px;
	border-color: var(--sfw-field-line-strong) !important;
	box-shadow: none !important;
}

/* Labels */
#ajax-content-wrap label,
.container-wrap label,
#sidebar label,
#commentform label,
.comment-form label,
.wp-block-search__label {
	font-family: var(--sfw-field-sans);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--sfw-field-faint);
}

#ajax-content-wrap input[type="checkbox"],
#ajax-content-wrap input[type="radio"],
.container-wrap input[type="checkbox"],
.container-wrap input[type="radio"],
#commentform input[type="checkbox"] {
	width: 1.1rem;
	height: 1.1rem;
	min-height: 0;
	accent-color: var(--sfw-field-accent);
	border-radius: 0.2em;
}

/* Submit / search buttons (theme + block search), not custom .btn classes. */
#ajax-content-wrap input[type="submit"]:not(.btn):not(.sfw-forms-submit),
#ajax-content-wrap button[type="submit"]:not(.btn):not(.sfw-forms-submit),
.container-wrap input[type="submit"]:not(.btn):not(.sfw-forms-submit),
.container-wrap button[type="submit"]:not(.btn):not(.sfw-forms-submit),
#sidebar input[type="submit"],
#sidebar button[type="submit"],
.wp-block-search__button,
.widget_search button[type="submit"],
.widget_search input[type="submit"],
.search-form button[type="submit"],
.search-form input[type="submit"],
#commentform input[type="submit"],
.comment-form input[type="submit"],
#respond input[type="submit"] {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: auto;
	max-width: 100%;
	min-height: 0;
	height: auto !important;
	margin: 0;
	padding: 0.88em 1.5em !important;
	border: 1px solid var(--sfw-field-accent) !important;
	border-radius: var(--sfw-field-radius-btn) !important;
	background: var(--sfw-field-accent) !important;
	background-color: var(--sfw-field-accent) !important;
	color: var(--sfw-field-paper) !important;
	font-family: var(--sfw-field-display) !important;
	font-size: var(--sfw-field-t0) !important;
	font-weight: 600 !important;
	line-height: 1 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: none !important;
	transition:
		background var(--sfw-field-dur) var(--sfw-field-ease),
		color var(--sfw-field-dur) var(--sfw-field-ease),
		border-color var(--sfw-field-dur) var(--sfw-field-ease),
		border-radius var(--sfw-field-dur) var(--sfw-field-ease),
		transform 140ms var(--sfw-field-ease),
		box-shadow var(--sfw-field-dur) var(--sfw-field-ease);
}

#ajax-content-wrap input[type="submit"]:not(.btn):hover,
#ajax-content-wrap input[type="submit"]:not(.btn):focus-visible,
#ajax-content-wrap button[type="submit"]:not(.btn):hover,
#ajax-content-wrap button[type="submit"]:not(.btn):focus-visible,
.container-wrap input[type="submit"]:not(.btn):hover,
.container-wrap button[type="submit"]:not(.btn):hover,
#sidebar input[type="submit"]:hover,
#sidebar button[type="submit"]:hover,
.wp-block-search__button:hover,
.wp-block-search__button:focus-visible,
.widget_search button[type="submit"]:hover,
.search-form button[type="submit"]:hover,
#commentform input[type="submit"]:hover,
#respond input[type="submit"]:hover {
	background: var(--sfw-field-accent-hover) !important;
	background-color: var(--sfw-field-accent-hover) !important;
	border-color: var(--sfw-field-accent-hover) !important;
	color: var(--sfw-field-paper) !important;
	border-radius: var(--sfw-field-radius-btn-hover) !important;
	transform: translateY(-1px);
	box-shadow: 0 3px 10px rgba(34, 55, 31, 0.18) !important;
	opacity: 1;
}

/* Block search layout */
.wp-block-search {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.5rem;
}

.wp-block-search .wp-block-search__label {
	margin: 0 0 0.15rem;
}

.wp-block-search .wp-block-search__inside-wrapper {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0.5rem;
	width: 100%;
}

.wp-block-search.wp-block-search__button-outside .wp-block-search__inside-wrapper,
.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper {
	border: 0 !important;
	padding: 0 !important;
	background: transparent !important;
}

.wp-block-search .wp-block-search__input {
	flex: 1 1 10rem;
	min-width: 0;
}

.wp-block-search .wp-block-search__button {
	flex: 0 0 auto;
	white-space: nowrap;
}

/* Classic widget search */
.widget_search .search-form,
#sidebar .widget_search .search-form,
.search-form {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0.5rem;
}

.widget_search .search-form input[type="text"],
.widget_search .search-form input[type="search"],
.search-form input[type="text"],
.search-form input[type="search"] {
	flex: 1 1 10rem;
}

.widget_search .search-form button[type="submit"] .icon-salient-search,
.widget_search .search-form button[type="submit"] .text {
	color: inherit;
}

/* Comment form spacing */
#commentform p,
.comment-form p {
	margin: 0 0 1rem;
}

#commentform .form-submit,
.comment-form .form-submit {
	margin-bottom: 0;
}

/* Don’t force full-width on Woo quantity / tiny controls if present. */
#ajax-content-wrap .quantity input.qty,
.container-wrap .quantity input.qty {
	width: 4rem;
	min-height: 2.5rem;
	text-align: center;
}
