/* Search overlay + results form. Uses theme tokens from style.css. */

.dl-search-open,
.dl-search-open body {
	overflow: hidden;
}

/* Overlay */
.dl-search {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(5rem, 18vh, 12rem) 20px 2rem;
	background: rgba(0, 139, 152, 0.97); /* --teal */
	color: #fff;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.dl-search[hidden] {
	display: none;
}

.dl-search.is-open {
	opacity: 1;
}

.dl-search__inner {
	width: 100%;
	max-width: 800px;
	transform: translateY(-12px);
	transition: transform 0.3s ease;
}

.dl-search.is-open .dl-search__inner {
	transform: none;
}

.dl-search .dl-search__title {
	margin: 0 0 1.25rem;
	font-family: var(--wide);
	font-weight: 900;
	font-size: .9em;
	text-transform: uppercase;
	color: #fff;
}

.dl-search__close {
	position: fixed;
	top: 20px;
	right: 20px;
	display: grid;
	place-items: center;
	width: 50px;
	height: 50px;
	padding: 0;
	border: 0;
	background: var(--orange);
	color: #fff;
	cursor: pointer;
}

.dl-search__close:hover {
	opacity: .8;
}

/* Form (shared by overlay and results page) */
.dl-search-form {
	display: flex;
	align-items: stretch;
	gap: 0;
	border-bottom: 3px solid currentColor;
}

.dl-search-form input.dl-search-form__field {
	flex: 1;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: .5rem 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	color: inherit;
	font-family: var(--wide);
	font-weight: 900;
	font-size: clamp(1.5rem, 4.5vw, 2.6rem);
	line-height: 1.2;
	-webkit-appearance: none;
	appearance: none;
}

.dl-search-form input.dl-search-form__field::placeholder {
	color: inherit;
	opacity: .5;
}

.dl-search-form input.dl-search-form__field:focus {
	border: 0;
	box-shadow: none;
	background: transparent;
	outline: none;
}

.dl-search-form input.dl-search-form__field::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.dl-search-form:focus-within {
	border-bottom-color: var(--orange);
}

.dl-search-form__submit {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	margin: 0 0 .5rem;
	padding: 1.2rem 1.8rem;
	border: 0;
	background: var(--orange);
	color: #fff;
	font-family: var(--wide);
	font-weight: 900;
	font-size: .9em;
	text-transform: uppercase;
	cursor: pointer;
}

.dl-search-form__submit:hover {
	opacity: .8;
}

.dl-search__close:focus-visible,
.dl-search-form__submit:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

@media (max-width: 640px) {
	.dl-search-form__submit span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.dl-search-form__submit {
		padding: 1rem;
	}
}

/* Results page */
.dl-results-form {
	margin: 0 0 30px;
	color: var(--teal);
}

.dl-results-form input.dl-search-form__field {
	color: #565656;
	font-size: clamp(1.2rem, 3vw, 1.6rem);
}

.dl-results-form .dl-search-form__submit {
	padding: 1rem 1.4rem;
}

.dl-results-form .dl-search-form__submit:focus-visible {
	outline-color: var(--teal);
}

@media (prefers-reduced-motion: reduce) {
	.dl-search,
	.dl-search__inner {
		transition: none;
	}
}
