/* Activinsights Publications and Trials Search. Layout carried over from the Activinsights Publications plugin. */

.air-search {
	margin: 20px 0;
	font-family: sans-serif;
}

.air-search-form {
	background: #f9f9f9;
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin-bottom: 20px;
}

.air-search-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
}

.air-field {
	flex: 1 1 200px;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* Title Search is a little wider, so its placeholder fits. */
.air-search .air-field-keywords {
	flex: 1.6 1 320px;
}

.air-search-form label {
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 0.85em;
	letter-spacing: 0.01em;
	color: #222;
}

/* Fields: same height as each other (the theme makes selects 50px tall). */
.air-search .air-search-form select,
.air-search .air-search-form input[type="search"],
.air-search .air-search-form input[type="text"] {
	width: 100%;
	height: 50px;
	min-height: 0;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #8f8ca8;
	border-radius: 8px;
	background-color: #fff;
	color: #222;
	font-size: 1em;
	line-height: normal;
	box-sizing: border-box;
	box-shadow: 0 1px 2px rgba(37, 32, 96, 0.06);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.air-search .air-search-form select:hover,
.air-search .air-search-form input[type="search"]:hover,
.air-search .air-search-form input[type="text"]:hover {
	border-color: #252060;
}

.air-search .air-search-form select:focus,
.air-search .air-search-form input[type="search"]:focus,
.air-search .air-search-form input[type="text"]:focus {
	outline: none;
	border-color: #5045cc;
	box-shadow: 0 0 0 3px rgba(80, 69, 204, 0.25);
}

/* Dropdowns: custom chevron, set in from the edge. */
.air-search .air-search-form select {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	padding-right: 42px;
	cursor: pointer;
	text-overflow: ellipsis;
	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 d='M1 1.5l5 5 5-5' fill='none' stroke='%23252060' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 12px 8px;
}

/* A dropdown with a filter chosen is highlighted. */
.air-search .air-search-form select:not(:has(option[value=""]:checked)) {
	border-color: #252060;
	background-color: #f3f2fb;
	color: #252060;
	font-weight: 600;
}

/* Title search with a magnifying glass icon. */
.air-search .air-search-form input[type="search"] {
	-webkit-appearance: none;
	appearance: none;
	padding-left: 42px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='7' cy='7' r='5.25' fill='none' stroke='%23595670' stroke-width='1.6'/%3E%3Cpath d='M11 11l3.5 3.5' stroke='%23595670' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 15px center;
	background-size: 16px 16px;
}

.air-search .air-search-form input::placeholder {
	color: #6b6880;
	opacity: 1;
}

/* Browsers that allow it (Chrome, Edge) also get a custom-designed list when a dropdown
   opens. It is still a real dropdown, so keyboard and screen reader use is unchanged.
   Other browsers show their own list. */
@supports (appearance: base-select) {
	.air-search .air-search-form select,
	.air-search .air-search-form select::picker(select) {
		appearance: base-select;
	}

	.air-search .air-search-form select {
		display: flex;
		align-items: center;
		padding-right: 16px;
		background-image: none;
	}

	.air-search .air-search-form select::picker-icon {
		content: "";
		flex: none;
		width: 12px;
		height: 8px;
		margin-inline-start: auto;
		background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23252060' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 12px 8px;
		transition: rotate 0.2s ease;
	}

	.air-search .air-search-form select:open::picker-icon {
		rotate: 180deg;
	}

	.air-search .air-search-form select::picker(select) {
		margin-top: 6px;
		padding: 6px;
		max-height: min(320px, 60vh);
		overflow-y: auto;
		border: 1px solid #d9d7e6;
		border-radius: 10px;
		background: #fff;
		box-shadow: 0 14px 36px rgba(37, 32, 96, 0.18);
		/* Open below the box. If there is not enough room, show a shorter list below,
		   and only open above as a last resort. */
		position-try-order: normal;
		position-try-fallbacks: --air-picker-below-short, flip-block;
	}

	@position-try --air-picker-below-short {
		max-height: 200px;
	}

	.air-search .air-search-form select option {
		padding: 9px 12px;
		border-radius: 6px;
		font-weight: 400;
		color: #222;
	}

	.air-search .air-search-form select option:hover,
	.air-search .air-search-form select option:focus-visible {
		background: #f0effa;
		color: #252060;
		outline: none;
	}

	.air-search .air-search-form select option:checked {
		font-weight: 600;
		color: #252060;
	}

	.air-search .air-search-form select option::checkmark {
		color: #5045cc;
	}
}

.air-button:focus-visible,
.air-result-title a:focus-visible {
	outline: 2px solid #5045cc;
	outline-offset: 2px;
}

.air-note {
	margin: 0;
}

.air-search .air-button {
	margin-top: 15px;
	height: 50px;
	padding: 0 24px;
	background: #252060;
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1em;
	line-height: 1.4;
}

.air-search .air-button:hover,
.air-search .air-button:focus-visible {
	background: #5045cc;
	color: #fff;
}

.air-search .air-button[disabled] {
	opacity: 0.75;
	cursor: wait;
}

.air-search-results {
	min-height: 50px;
}

.air-status {
	margin: 0 0 10px;
	font-size: 0.95em;
	color: #333;
}

.air-status.is-error {
	color: #9b1c1c;
	font-weight: bold;
}

.air-list {
	transition: opacity 0.2s ease;
}

.air-search.is-loading .air-list {
	opacity: 0.5;
}

.air-results {
	list-style: none;
	margin: 0;
	padding: 0;
}

.air-results .air-result {
	padding: 15px;
	border-bottom: 1px solid #eee;
	margin: 0;
}

.air-results .air-result-title {
	margin: 0 0 5px 0;
}

/* Readable titles: the theme's orange link colour fails contrast guidelines on white. */
.air-search .air-results .air-result-title a,
.air-search .air-results .air-result-title a:visited {
	color: #252060;
	text-decoration: none;
}

.air-search .air-results .air-result-title a:hover,
.air-search .air-results .air-result-title a:focus {
	color: #252060;
	text-decoration: underline;
}

.air-results .air-meta {
	font-size: 0.85em;
	color: #595959;
	margin: 0;
}

.air-results .air-trial-number {
	font-size: 0.9em;
	font-style: italic;
	margin: 0 0 5px 0;
	color: #333;
}

.air-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media (max-width: 600px) {
	.air-search-form {
		padding: 15px;
	}

	.air-field,
	.air-search .air-field-keywords {
		flex-basis: 100%;
	}

	.air-button {
		width: 100%;
	}

	.air-results .air-result {
		padding: 12px 0;
	}
}
