/**
 * Inoforest Search Form
 *
 * Contents
 * 1. Defaults (variables)
 * 2. Form and field
 * 3. Button
 *
 * Colours read the Design System (--inoforest-color-*) with fallbacks. The defaults sit in :where() blocks (no
 * specificity), so the Style tab controls always win.
 */

/* 1. Defaults ------------------------------------------------------------------ */
:where(.inoforest-search-form) {
	--ino-sf-height: 56px;
	--ino-sf-button: 44px;
	--ino-sf-primary: var(--inoforest-color-primary, #0b7a75);
	--ino-sf-accent: var(--inoforest-color-accent, #ff6a3d);
	--ino-sf-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 2. Form and field ------------------------------------------------------------------ */
.inoforest-search-form {
	position: relative;
	margin: 0;
}

/* Two classes: out-rank the theme's and the kit's input styles. */
.inoforest-search-form .inoforest-search-form__field {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: var(--ino-sf-height);
	margin: 0;
	padding: 0 calc(var(--ino-sf-button) + (var(--ino-sf-height) - var(--ino-sf-button)) / 2 + 10px) 0 20px;
	font-family: inherit;
	font-size: 1rem;
	line-height: normal;
	color: var(--inoforest-color-heading, #0d1b2a);
	background-color: var(--inoforest-color-surface, #f4f8f8);
	border: 1px solid transparent;
	border-radius: 999px;
	outline: 0;
	box-shadow: none;
	transition: border-color 0.35s var(--ino-sf-ease), background-color 0.35s var(--ino-sf-ease);
	-webkit-appearance: none;
	appearance: none;
}

.inoforest-search-form .inoforest-search-form__field::placeholder {
	color: var(--inoforest-color-muted, #8b99a6);
	opacity: 1;
}

.inoforest-search-form .inoforest-search-form__field:focus {
	background-color: var(--inoforest-color-background, #fff);
	border-color: var(--ino-sf-primary);
}

.inoforest-search-form__field::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* 3. Button ------------------------------------------------------------------ */
.inoforest-search-form .inoforest-search-form__button {
	position: absolute;
	top: calc((var(--ino-sf-height) - var(--ino-sf-button)) / 2);
	right: calc((var(--ino-sf-height) - var(--ino-sf-button)) / 2);
	display: grid;
	place-items: center;
	width: var(--ino-sf-button);
	height: var(--ino-sf-button);
	margin: 0;
	padding: 0;
	font-size: 18px;
	line-height: 1;
	color: #fff;
	background-color: var(--ino-sf-primary);
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.35s var(--ino-sf-ease), color 0.35s var(--ino-sf-ease);
}

.inoforest-search-form button.inoforest-search-form__button:hover,
.inoforest-search-form button.inoforest-search-form__button:focus-visible {
	color: #fff;
	background-color: var(--ino-sf-accent);
}

.inoforest-search-form__button svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

@media (prefers-reduced-motion: reduce) {
	.inoforest-search-form .inoforest-search-form__field,
	.inoforest-search-form .inoforest-search-form__button {
		transition: none;
	}
}
