.caltrout-search-toggle .wp-block-button__link::before,
.caltrout-search-toggle .wp-block-button__link::after {
	content: none;
}

.caltrout-search-toggle .ct-header-search-icon {
	display: block;
	flex: 0 0 34px;
	height: 34px;
	line-height: 1;
	transition: color 160ms ease, transform 160ms ease;
	width: 34px;
}

.caltrout-search-toggle .wp-block-button__link:hover .ct-header-search-icon,
.caltrout-search-toggle .wp-block-button__link:focus-visible .ct-header-search-icon {
	transform: scale(1.05);
}

html.has-search-dialog-open {
	overflow: hidden;
}

.ct-search-context-menu {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 7px;
	box-shadow: 0 14px 42px rgb(8 28 38 / 24%);
	max-width: min(360px, calc(100vw - 24px));
	padding: 5px;
	position: fixed;
	z-index: 100000;
}

.ct-search-context-menu[hidden] { display: none; }

.ct-search-context-menu button {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 4px;
	color: var(--wp--preset--color--ink-2);
	cursor: pointer;
	display: grid;
	font-family: var(--wp--preset--font-family--sans);
	font-size: .86rem;
	gap: 10px;
	grid-template-columns: 22px minmax(0, 1fr);
	line-height: 1.35;
	padding: 10px 12px;
	text-align: left;
	width: 100%;
}

.ct-search-context-menu button:hover,
.ct-search-context-menu button:focus-visible {
	background: rgb(30 139 181 / 9%);
	outline: 1px solid var(--wp--preset--color--river-2);
}

.ct-search-context-menu .dashicons { color: var(--wp--preset--color--river); }
.ct-search-context-menu strong { font-weight: 700; }

.ct-search-dialog {
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--ink-2);
	max-height: min(820px, calc(100vh - 64px));
	max-width: 1040px;
	padding: 0;
	width: calc(100% - 64px);
}

.ct-search-dialog::backdrop {
	background: rgb(8 28 38 / 72%);
	backdrop-filter: blur(3px);
}

.ct-search-shell {
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	box-shadow: 0 24px 80px rgb(8 28 38 / 28%);
	display: grid;
	grid-template-rows: auto minmax(240px, 1fr) auto;
	max-height: inherit;
	overflow: hidden;
}

.ct-search-form {
	align-items: center;
	border-bottom: 1px solid var(--wp--preset--color--line);
	display: grid;
	gap: 16px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	padding: 24px;
}

.ct-search-form > .dashicons {
	color: var(--wp--preset--color--river);
	font-size: 32px;
	height: 32px;
	width: 32px;
}

.ct-search-form input[type="search"] {
	appearance: none;
	background: transparent;
	border: 0;
	box-shadow: none;
	color: var(--wp--preset--color--ink-2);
	font-family: var(--wp--preset--font-family--sans);
	font-size: clamp(1.35rem, 2.1vw, 2rem);
	line-height: 1.25;
	min-width: 0;
	outline: 0;
	padding: 0;
}

.ct-search-form input[type="search"]::-webkit-search-cancel-button { display: none; }

.ct-search-close {
	align-items: center;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 999px;
	color: var(--wp--preset--color--ink-2);
	cursor: pointer;
	display: inline-flex;
	height: 44px;
	justify-content: center;
	padding: 0;
	width: 44px;
}

.ct-search-close:hover,
.ct-search-close:focus-visible {
	background: var(--wp--preset--color--paper-2);
	border-color: var(--wp--preset--color--line);
}

.ct-search-close .dashicons { font-size: 28px; height: 28px; width: 28px; }

.ct-search-body {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	min-height: 0;
}

.ct-search-filters {
	background: var(--wp--preset--color--paper-2);
	border-right: 1px solid var(--wp--preset--color--line);
	overflow-y: auto;
	padding: 12px 0;
}

.ct-search-filters button {
	align-items: center;
	background: transparent;
	border: 0;
	border-left: 3px solid transparent;
	color: var(--wp--preset--color--ink-2);
	cursor: pointer;
	display: grid;
	font-family: var(--wp--preset--font-family--sans);
	font-size: .78rem;
	font-weight: 700;
	grid-template-columns: 22px 1fr auto;
	letter-spacing: .04em;
	padding: 15px 18px;
	text-align: left;
	text-transform: uppercase;
	width: 100%;
}

.ct-search-filters button:not(:first-child) span:first-child { grid-column: 2; }
.ct-search-filters button:hover { background: rgb(14 90 123 / 7%); }
.ct-search-filters button[aria-pressed="true"] { background: var(--wp--preset--color--paper); border-left-color: var(--wp--preset--color--river); color: var(--wp--preset--color--river); }
.ct-search-filters b { font-weight: 600; }

.ct-search-results {
	overflow-y: auto;
	padding: 0 24px;
	transition: opacity 100ms ease, transform 160ms cubic-bezier(.22, .75, .25, 1);
	will-change: opacity, transform;
}

.ct-search-results.is-leaving {
	opacity: 0;
	transform: translateY(3px);
}

.ct-search-results.is-entering {
	opacity: 0;
	transform: translateY(-4px);
}

.ct-search-prompt {
	color: var(--wp--preset--color--body-text);
	font-family: var(--wp--preset--font-family--sans);
	margin: 0;
	padding: 44px 12px;
}

.ct-search-result {
	align-items: center;
	border-bottom: 1px solid var(--wp--preset--color--line);
	color: inherit;
	display: grid;
	gap: 18px;
	grid-template-columns: 126px minmax(0, 1fr) auto;
	padding: 16px 4px;
	text-decoration: none;
}

.ct-search-result img,
.ct-search-result__placeholder {
	background: var(--wp--preset--color--paper-2);
	border-radius: 4px;
	height: 84px;
	object-fit: cover;
	width: 126px;
}

.ct-search-result__placeholder { align-items: center; color: var(--wp--preset--color--shallow); display: flex; font-size: 30px; justify-content: center; }
.ct-search-result__content { display: grid; gap: 4px; min-width: 0; }
.ct-search-result small { color: var(--wp--preset--color--river); font-family: var(--wp--preset--font-family--sans); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ct-search-result strong { color: var(--wp--preset--color--ink-2); font-family: var(--wp--preset--font-family--serif); font-size: 1.45rem; font-weight: 400; line-height: 1.12; }
.ct-search-result__content > span:last-child { color: var(--wp--preset--color--body-text); font-family: var(--wp--preset--font-family--sans); font-size: .88rem; line-height: 1.35; }
.ct-search-result__arrow { font-size: 1.25rem; }
.ct-search-result:hover,
.ct-search-result:focus-visible,
.ct-search-result.is-active { background: rgb(30 139 181 / 9%); outline: 1px solid var(--wp--preset--color--river-2); outline-offset: -1px; }

.ct-search-footer {
	align-items: center;
	border-top: 1px solid var(--wp--preset--color--line);
	display: grid;
	font-family: var(--wp--preset--font-family--sans);
	font-size: .82rem;
	gap: 24px;
	grid-template-columns: auto auto 1fr;
	padding: 14px 24px;
}

.ct-search-keyboard { align-items: center; display: flex; gap: 6px; white-space: nowrap; }
.ct-search-footer kbd { background: var(--wp--preset--color--paper-2); border: 1px solid var(--wp--preset--color--line); border-radius: 4px; box-shadow: 0 1px 0 var(--wp--preset--color--line); font-family: inherit; padding: 4px 7px; }
.ct-search-all { color: var(--wp--preset--color--river); font-weight: 700; justify-self: end; text-decoration: none; }

.ct-search-page { padding-block: var(--wp--preset--spacing--70); }
.ct-search-page__query .wp-block-post-template { display: grid; gap: 0; }
.ct-search-page__result { border-top: 1px solid var(--wp--preset--color--line); padding-block: var(--wp--preset--spacing--40); }
.ct-search-page__result::before { color: var(--wp--preset--color--river); display: block; font-family: var(--wp--preset--font-family--sans); font-size: var(--wp--preset--font-size--eyebrow); font-weight: 700; letter-spacing: .08em; margin-bottom: var(--wp--preset--spacing--20); text-transform: uppercase; }
.ct-search-page__query .wp-block-post.type-ct_species .ct-search-page__result::before { content: "Species"; }
.ct-search-page__query .wp-block-post.type-ct_project .ct-search-page__result::before { content: "Project"; }
.ct-search-page__query .wp-block-post.type-post .ct-search-page__result::before { content: "Story"; }
.ct-search-page__query .wp-block-post.type-ct_event .ct-search-page__result::before { content: "Event"; }
.ct-search-page__query .wp-block-post.type-page .ct-search-page__result::before { content: "Page"; }

@media (max-width: 700px) {
	.ct-search-dialog { height: calc(100dvh - 24px); max-height: none; width: calc(100% - 24px); }
	.ct-search-shell { height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; }
	.ct-search-form { gap: 10px; padding: 16px; }
	.ct-search-form input[type="search"] { font-size: 1.15rem; }
	.ct-search-body { display: grid; grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
	.ct-search-filters { border-bottom: 1px solid var(--wp--preset--color--line); border-right: 0; display: flex; overflow-x: auto; padding: 0 12px; scrollbar-width: none; }
	.ct-search-filters::-webkit-scrollbar { display: none; }
	.ct-search-filters button { border-bottom: 3px solid transparent; border-left: 0; display: block; flex: 0 0 auto; font-size: .66rem; padding: 13px 10px 11px; width: auto; }
	.ct-search-filters button .dashicons,
	.ct-search-filters button b { display: none; }
	.ct-search-filters button[aria-pressed="true"] { border-bottom-color: var(--wp--preset--color--river); border-left: 0; }
	.ct-search-results { padding: 0 14px; }
	.ct-search-result { gap: 12px; grid-template-columns: 88px minmax(0, 1fr) auto; padding: 14px 2px; }
	.ct-search-result img,
	.ct-search-result__placeholder { height: 72px; width: 88px; }
	.ct-search-result strong { font-size: 1.05rem; }
	.ct-search-result__content > span:last-child { -webkit-box-orient: vertical; -webkit-line-clamp: 2; display: -webkit-box; font-size: .76rem; overflow: hidden; }
	.ct-search-footer { display: flex; justify-content: flex-end; padding: 14px 18px; }
	.ct-search-keyboard { display: none; }
	.ct-search-all { justify-self: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.ct-search-results { transition: none; }
}

.ct-search-result img.ct-search-result__fallback { object-fit: contain; padding: 10px; box-sizing: border-box; }
