/*
 * The header search panel (site search v1). A flat surface-1 panel under the
 * field, hairline border, no shadow tint beyond the menus' own (design.md).
 * The active option is a hairline brightening and a recessed fill, never a
 * coloured bar; accent only on nothing here.
 */
.pfg-search.has-sp {
	position: relative;
}

/* The field stays open while the panel is: focus never leaves the input, but
   hovering the panel must not collapse the field under the pointer either. */
.pfg-search.is-sp-open .wp-block-search__inside-wrapper {
	width: min(280px, 42vw);
}

.pfg-sp {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 90;
	box-sizing: border-box;
	width: min(380px, calc(100vw - 32px));
	max-height: min(70vh, 520px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px;
	border-radius: 14px;
	background: var(--surface-1, #14171E);
	border: 1px solid var(--wp--preset--color--grid-line, #2A3040);
	box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.pfg-sp[hidden] {
	display: none;
}

.pfg-sp__head {
	margin: 6px 8px 4px;
	color: var(--wp--preset--color--text-3, #979CAD);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pfg-sp__head:not(:first-child) {
	margin-top: 12px;
}

.pfg-sp__opt {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 6px 8px;
	border: 1px solid transparent;
	border-radius: 10px;
	color: var(--wp--preset--color--text-1, #F2F3F8);
	text-decoration: none;
}

.pfg-sp__opt:hover,
.pfg-sp__opt[aria-selected="true"] {
	border-color: var(--border-strong, rgba(255, 255, 255, 0.22));
	background: var(--recess, rgba(13, 15, 22, 0.6));
}

.pfg-sp__tile {
	flex: none;
	width: 32px;
	height: 32px;
}

.pfg-sp__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.pfg-sp__name {
	overflow: hidden;
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.pfg-sp__meta {
	color: var(--wp--preset--color--text-3, #979CAD);
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
}

.pfg-sp__empty {
	margin: 8px;
	color: var(--wp--preset--color--text-3, #979CAD);
	font-size: 14px;
}

/* On a phone the field spans the header; the panel spans with it. */
@media (max-width: 760px) {
	.pfg-sp {
		position: fixed;
		top: var(--pfg-sp-top, 72px);
		right: 16px;
		left: 16px;
		width: auto;
	}
}
