.spotlight-is-open {
	overflow: hidden;
}

.cultivate-spotlight {
	inset: 0;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100%;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--spotlight-background, #fff);
	color: var(--wp--preset--color--foreground, inherit);
	font: inherit;
	overscroll-behavior: contain;
}

:where(.cultivate-spotlight) [hidden] {
	display: none;
}

.spotlight-top {
	background: #fff;
	border-bottom: 1px solid var(--wp--custom--color--neutral-200, #ddd);
}

.spotlight-bar,
.spotlight-body {
	box-sizing: border-box;
	width: min(100%, var(--wp--custom--layout--wide, 1200px));
	margin-inline: auto;
	padding-inline: var(--wp--custom--layout--padding, 20px);
}

.spotlight-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: 70px;
	padding-block: 12px;
}

.spotlight-logo {
	display: block;
	width: min(52%, var(--wp--custom--header-logo--desktop-width, 220px));
	color: inherit;
	text-decoration: none;
}

:where(.spotlight-logo) img,
:where(.spotlight-logo) svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: var(--wp--custom--header-logo--desktop-height, 48px);
	object-fit: contain;
	object-position: left;
}

.spotlight-body {
	padding-block: clamp(28px, 5vw, 68px);
}

:where(.spotlight-body) h1 {
	margin: 0 0 0.55em;
	text-align: center;
	font-size: clamp(2rem, 4vw, var(--wp--preset--font-size--huge, 3.5rem));
}

:where(.spotlight-form, .spotlight-bar) button {
	cursor: pointer;
	color: inherit;
	font-family: inherit;
}

.spotlight-form {
	display: flex;
	align-items: center;
	gap: .5rem;
	max-width: var(--wp--custom--layout--content, 800px);
	margin: 0 auto;
	padding: .3rem .8rem;
	border: 1px solid var(--wp--custom--color--border, currentColor);
	border-radius: var(--wp--custom--border-radius--small, 4px);
	background: var(--wp--preset--color--background, white);
}

.spotlight-form:focus-within {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

:where(.spotlight-form) input[type="search"] {
	flex: 1;
	width: 0;
	min-width: 0;
	height: 48px;
	padding: 0;
	outline: none;
	border: 0;
	box-shadow: none;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: max(16px, 1.1em);
}

:where(.spotlight-form) input::-webkit-search-cancel-button {
	display: none;
}

.spotlight-submit,
.spotlight-close,
.spotlight-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	gap: .5em;
	padding: 0 .4em;
	border: 0;
	background: transparent;
	font-size: 1rem;
}

.spotlight-clear[hidden] {
	display: none;
}

:where(.spotlight-submit) span {
	position: relative;
	width: 19px;
	height: 19px;
	border: 2px solid currentColor;
	border-radius: 50%;
}

:where(.spotlight-submit) span::after {
	position: absolute;
	right: -6px;
	bottom: -3px;
	width: 8px;
	height: 2px;
	background: currentColor;
	content: '';
	transform: rotate(45deg);
}

:where(.spotlight-close) span {
	font-size: 1.6em;
}

.spotlight-terms {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	justify-content: center;
	margin-block: 1.2rem;
}

.spotlight-section,
.spotlight-matches {
	margin-block-start: var(--wp--custom--layout--block-gap-large, 2rem);
}

:where(.spotlight-section) h2 {
	margin: 0 0 .65em;
}

.spotlight-grid,
.spotlight-list {
	display: grid;
	gap: var(--wp--custom--layout--column-gap, 1.25rem);
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.spotlight-list {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.spotlight-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .65em;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	line-height: var(--wp--custom--line-height--small, 1.35);
}

.spotlight-card:hover {
	text-decoration: underline;
}

:where(.spotlight-card) img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--spotlight-image-ratio, auto);
	object-fit: cover;
	border-radius: var(--wp--custom--border-radius--small, 0);
}

:where(.spotlight-list) .spotlight-card {
	flex-direction: row;
	align-items: center;
	padding-block: .5rem;
	border-bottom: 1px solid var(--wp--custom--color--neutral-200, #ddd);
}

:where(.spotlight-list .spotlight-card) img {
	width: clamp(52px, 8vw, 90px);
	flex: none;
}

.spotlight-matches {
	max-width: var(--wp--custom--layout--content, 800px);
	margin-inline: auto;
}

.spotlight-results-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: .25rem 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--wp--custom--color--border, #ccc);
}

.spotlight-results-head h2,
.spotlight-results-head p {
	margin: 0;
}

.spotlight-results-head p {
	font-size: .875rem;
}

.spotlight-result-list .spotlight-card {
	display: grid;
	grid-template-columns: var(--spotlight-result-size, 60px) minmax(0, 1fr);
	align-items: center;
	gap: 15px;
	font-family: var(--wp--custom--typography--heading--font-family, inherit);
	font-size: clamp(1.125rem, 2vw, 1.3125rem);
	padding-block: 10px;
	border-bottom: 1px solid var(--wp--custom--color--border, #ccc);
}

.spotlight-result-thumb {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--wp--custom--border-radius--small, 4px);
	background: #ccc;
}

.spotlight-result-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Older archive styles keep every link on one line. Allow them to wrap in the dialog. */
:where(.spotlight-pages) .pagination ul {
	flex-wrap: wrap;
}

@media (max-width: 700px) {
	.spotlight-result-list {
		--spotlight-result-size: 48px;
	}

	.spotlight-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.spotlight-list {
		grid-template-columns: 1fr;
	}

	.spotlight-bar {
		min-height: 56px;
	}

	.spotlight-logo {
		max-width: var(--wp--custom--header-logo--mobile-width, 170px);
	}

	:where(.spotlight-logo) img,
	:where(.spotlight-logo) svg {
		max-height: var(--wp--custom--header-logo--mobile-height, 36px);
	}
}
