form[name="search"] input {
	width: 100%;
	font-size: 2em;
	border-style: none none solid none;
}

#search-sections {
	display: flex;
	gap: 1em;
	margin: 1em 0;
	white-space: nowrap;
	overflow-y: auto;
}

#search-sections > label {
	background-color: var(--btn-primary-bg);
	border-style: solid;
	border-width: 1px;
	border-radius: 2em;
	padding: .5em 1em;
}

#search-sections > label.active {
	cursor: pointer;
	border-color: var(--btn-primary-border);
}

#search-sections > label.inactive {
	color: var(--subtext);
	border-color: var(--subtext);
}

input[value="guides"]:checked ~ #search-results > .search-section-guides,
input[value="items"]:checked ~ #search-results > .search-section-items,
input[value="pages"]:checked ~ #search-results > .search-section-pages,
input[value="maps"]:checked ~ #search-results > .search-section-maps,
input[value="markers"]:checked ~ #search-results > .search-section-markers,
input[value="reviews"]:checked ~ #search-results > .search-section-reviews {
	display: block;
}

#search-sections > label.active:hover,
input[value="guides"]:checked ~ #search-sections > label[for="search-page-guides"],
input[value="items"]:checked ~ #search-sections > label[for="search-page-items"],
input[value="pages"]:checked ~ #search-sections > label[for="search-page-pages"],
input[value="maps"]:checked ~ #search-sections > label[for="search-page-maps"],
input[value="markers"]:checked ~ #search-sections > label[for="search-page-markers"],
input[value="reviews"]:checked ~ #search-sections > label[for="search-page-reviews"] {
	background-color: var(--maggenta);
}

/* Search results */

.search-results {
	background-color: var(--bg);
	color: var(--text);
	z-index: 10;
}

.search-results a.result {
	display: grid;
	gap: .5em 1em;
	grid-template-columns: 40px auto;
	margin-bottom: 1em;
	color: var(--text);
}

.search-results .search-section-reviews a.result {
	grid-template-columns: 40px auto min-content;
}

.search-results a.result > * {
	grid-column: 2;
	margin: 0;
}

.search-results a.result > .cover {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.search-results a.result em {
	color: var(--maggenta);
}

.search-results a.result p {
	color: var(--subtext);
	font-size: .85em;
}

.search-results .search-section-reviews a.result p {
	grid-column: 3;
	grid-row: 1 / span 2;
	display: flex;
	align-items: center;
}

.search-results .search-section-reviews a.result p > .preview-blurb,
.search-results .search-section-reviews a.result p > .short-preview-blurb {
	background-color: var(--gg-purple);
	white-space: nowrap;
	color: white;
	border-radius: 5px;
	padding: 3px;
	font-weight: bold;
	text-transform: uppercase;
}

.search-results .search-section-reviews a.result p > .preview-blurb {
	display: none;
}

.search-results a.see-more {
	padding-left: 50px;
}

.search-results > div {
	display: none;
}

.search-results > div > a.result .gg-icon {
	margin-right: .5em;
}

.search-results > div > a.result .icon-return {
	transform: scaleX(-1);
	display: inline-block;
}

.guide-helper-menu .search-results {
	left: 0;
	right: 0;
	position: absolute;
}

#navbar-search-wrap > .search-results {
	overflow-y: auto;
	position: fixed;
	top: 48px;
	max-height: calc(100vh - 48px - 5px);
	margin-left: -12px;
	box-shadow: 0 3px 10px #777;
	display: none;
}

#navbar-wrap.search #navbar-search-wrap > .search-results {
	display: block;
}

#navbar-search-wrap #search-bar-top-guides {
	display: none;
}

#navbar-wrap.search #navbar-search-wrap .search-results.empty #search-bar-top-guides {
	display: block;
}

#navbar-search-wrap #search-bar-top-guides > h3 {
	margin-bottom: 0;
}

#navbar-search-wrap #search-bar-top-guides > div{
	padding: 1em;
	display: grid;
	grid-gap: 1em;
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

#navbar-search-wrap #search-bar-top-guides > div > a:nth-child(11),
#navbar-search-wrap #search-bar-top-guides > div > a:nth-child(12) {
	display: none;
}

#navbar-search-wrap #search-bar-top-guides > div > a {
	padding: 0;
}

#navbar-search-wrap #search-bar-top-guides > div > a > img {
	aspect-ratio: 314/478;
	width: 100%;
	height: auto;
}

body.nonsubscriber #navbar-search-wrap > .search-results {
	/* Space for bottom ad */
	max-height: calc(100vh - 48px - 90px - 5px);
}

form > .search-results.empty > p {
	margin-left: 12px;
	margin-right: 12px;
}

form > .search-results > div {
	display: block;
}

form > .search-results > div > * {
	padding: .5em 12px;
}

form > .search-results > div > a.result {
	margin-bottom: 0;
	color: var(--text);
}

form > .search-results > div > a.result:hover {
	background-color: var(--active);
}

form > .search-results > div > a.result:hover > p {
	/* Make this more legible on dark mode */
	color: var(--text);
}

form > .search-results > div > label {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 1em;
	background-color: var(--gray-bg);
	border-bottom: 1px solid var(--bg);
	margin-bottom: 0;
}

form > .search-results > div > label > h3 {
	flex: 1 0 auto;
	margin: 0;
	font-size: 1em;
}

form > .search-results > div > label > .icon-triangle-left {
	transform: rotate(90deg);
	transition-property: transform;
	transition-duration: .25s;
	font-size: smaller;
}

form > .search-results .result,
form > .search-results .see-more,
form > .search-results > div > p {
	display: none;
}

form > .search-results input.section-toggle:checked ~ .result {
	display: grid;
}

form > .search-results input.section-toggle:checked ~ .see-more {
	display: block;
}

form > .search-results input.section-toggle:checked ~ label > .icon-triangle-left {
	transform: rotate(-90deg);
}

@media (min-width: 768px) {
	#navbar-search-wrap #search-bar-top-guides > div{
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	#navbar-search-wrap #search-bar-top-guides > div > a:nth-child(11),
	#navbar-search-wrap #search-bar-top-guides > div > a:nth-child(12) {
		display: block;
	}

	.search-results .search-section-reviews a.result p > .preview-blurb {
		display: inline;
	}

	.search-results .search-section-reviews a.result p > .short-preview-blurb {
		display: none;
	}
}

@media (min-width: 1280px) {
	#navbar-search-wrap #search-bar-top-guides > div{
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	#navbar-search-wrap #search-bar-top-guides > div > a:nth-child(11),
	#navbar-search-wrap #search-bar-top-guides > div > a:nth-child(12) {
		display: none;
	}
}
