/* healthSciencesDoi: compact dropdowns and a header search box.
   The parent theme opens every dropdown as a full-width panel in capitals on desktop;
   with short grouped menus an ordinary dropdown under its heading reads better. */

.hs-search {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.5rem 0;
}

.hs-search input[type="search"] {
	min-width: 0;
	flex: 1 1 auto;
}

.hs-search .hs-search-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #ced4da;
	background: #fff;
	color: inherit;
	line-height: 1;
	padding: 0.35rem 0.55rem;
}

@media (min-width: 992px) {
	.main-header .navbar-collapse {
		align-items: center;
	}

	#primaryNav {
		width: auto;
		flex: 1 1 auto;
	}

	#primaryNav .nav-item.dropdown {
		position: relative;
	}

	#primaryNav .dropdown-menu.show {
		display: block;
		width: auto;
		min-width: 15rem;
		top: 100%;
		left: 0;
		right: auto;
		padding: 0.35rem 0;
		box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
	}

	/* the last two headings sit near the right edge: open their lists leftwards */
	#primaryNav > .nav-item:nth-last-child(-n+2) .dropdown-menu.show {
		left: auto;
		right: 0;
	}

	#primaryNav .dropdown-menu .dropdown-item {
		display: block;
		width: 100%;
		text-align: left;
		text-transform: none;
		font-size: 15px;
		line-height: 1.4;
		padding: 0.5rem 1.1rem;
		border: 0;
		white-space: nowrap;
	}

	#primaryNav .dropdown-menu .dropdown-item:hover,
	#primaryNav .dropdown-menu .dropdown-item:focus {
		background-color: rgba(255, 255, 255, 0.14);
	}

	.hs-search {
		flex: 0 0 auto;
		margin-left: 1rem;
		padding: 0;
	}

	.hs-search input[type="search"] {
		width: 11rem;
	}
}
