.sitesearch {
	position: relative;
	margin: .75rem 0 1.5rem;
	font-size: 1rem;
}

.sitesearch-floating {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 1000;
	width: min(22rem, calc(100vw - 2rem));
	margin: 0;
}

.sitesearch input {
	box-sizing: border-box;
	width: 100%;
	padding: .5rem .75rem;
	border: 1px solid currentColor;
	border-radius: 4px;
	background: #fff;
	color: #222;
	font: inherit;
}

.sitesearch-results {
	position: absolute;
	z-index: 1000;
	top: 2.5rem;
	left: 0;
	box-sizing: border-box;
	width: max(100%, min(26rem, calc(100vw - 2rem)));
	max-height: 70vh;
	margin: .25rem 0 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	border: 1px solid #bbb;
	border-radius: 4px;
	background: #fff;
	color: #222;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}

.sitesearch-floating .sitesearch-results {
	right: 0;
	left: auto;
}

.sitesearch-results li {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #eee;
}

.sitesearch-results li:last-child {
	border-bottom: 0;
}

.sitesearch-results a {
	display: block;
	padding: .6rem .75rem;
	color: #222;
	text-decoration: none;
}

.sitesearch-results a:hover,
.sitesearch-results a:focus {
	outline: none;
	background: #eef3f8;
}

.sitesearch-results strong {
	display: block;
	margin-bottom: .15rem;
	font-weight: 600;
}

.sitesearch-results em {
	display: block;
	margin-bottom: .15rem;
	color: #0a6c74;
	font-size: .92em;
	font-style: normal;
	font-weight: 600;
}

.sitesearch-results span {
	display: block;
	color: #555;
	font-size: .85em;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.sitesearch-message {
	padding: .6rem .75rem !important;
	color: #555;
}

/* Used when the darkmode plugin is active, otherwise inert. */
@media screen {
	html[data-theme="dark"] .sitesearch input {
		border-color: #4a5057;
		background: #202427;
		color: #e6e6e6;
	}

	html[data-theme="dark"] .sitesearch-results {
		border-color: #4a5057;
		background: #202427;
		color: #e6e6e6;
		box-shadow: 0 4px 16px rgba(0, 0, 0, .6);
	}

	html[data-theme="dark"] .sitesearch-results li {
		border-color: #33383d;
	}

	html[data-theme="dark"] .sitesearch-results a {
		color: #e6e6e6;
	}

	html[data-theme="dark"] .sitesearch-results a:hover,
	html[data-theme="dark"] .sitesearch-results a:focus {
		background: #2c3237;
	}

	html[data-theme="dark"] .sitesearch-results em {
		color: #5fd4cf;
	}

	html[data-theme="dark"] .sitesearch-results span,
	html[data-theme="dark"] .sitesearch-message {
		color: #aeb4ba;
	}
}

/* On phones Cyanine floats the menu and language switcher over the header. Sit below them. */
@media screen and (max-width: 49.99em) {
	.grid-container:has(.contentnav > .flex) .grid-header .sitesearch {
		margin-top: 3.75rem;
	}
}
