/*
 * Sits directly below .search-form (same sibling level inside
 * .search-screen) -- width/centering must mirror .search-form's own
 * max-width:1200px;margin:0 auto exactly, otherwise the dropdown reads
 * as a disconnected floating card instead of an extension of the input.
 */
.journal-live-search__results {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	margin-top: clamp(12px, 2vh, 20px);
	max-height: 55vh;
	overflow-y: auto;
	text-align: left;
	font-size: 1rem;
	background: var(--js-surface, #fff);
	border: 1px solid var(--js-line, #e5e7eb);
	border-top: 2px solid var(--js-accent, #e85d3f);
	border-radius: 0 0 var(--js-radius, 12px) var(--js-radius, 12px);
	box-shadow: 0 16px 40px rgba(23, 23, 23, 0.1);
}

.journal-live-search__group {
	padding: 14px 0;
}

.journal-live-search__group + .journal-live-search__group {
	border-top: 1px solid var(--js-line, #e5e7eb);
}

.journal-live-search__group-title {
	margin: 0;
	padding: 4px 24px 10px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--js-muted, #6b7280);
}

.journal-live-search__item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 10px 24px;
	text-decoration: none;
	color: inherit;
	border-left: 2px solid transparent;
	transition: background-color .15s ease, border-color .15s ease;
}

.journal-live-search__item:hover,
.journal-live-search__item:focus {
	background-color: var(--js-canvas, #f3f1f0);
	border-left-color: var(--js-accent, #e85d3f);
}

.journal-live-search__thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	border-radius: calc(var(--js-radius, 12px) - 4px);
	overflow: hidden;
	background: var(--js-canvas, #f3f1f0);
}

.journal-live-search__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.journal-live-search__item-body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.journal-live-search__item-title {
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: var(--js-ink, #171717);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.journal-live-search__item-excerpt {
	font-size: 13px;
	color: var(--js-muted, #6b7280);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.journal-live-search__empty {
	margin: 0;
	padding: 28px 24px;
	text-align: center;
	color: var(--js-muted, #6b7280);
}

@media (max-width: 782px) {
	.journal-live-search__results {
		max-height: 70vh;
	}

	.journal-live-search__group-title {
		padding-left: 16px;
		padding-right: 16px;
	}

	.journal-live-search__item {
		padding-left: 16px;
		padding-right: 16px;
	}

	.journal-live-search__empty {
		padding-left: 16px;
		padding-right: 16px;
	}
}

/*
 * Vendor's .search-screen carries padding-top/padding-bottom:20vh below
 * the 768px breakpoint (it only drops to 5vh at min-width:768px) -- on a
 * phone that's ~320px of empty space above/below the input alone, and
 * the panel has no bottom/overflow set, so anything pushed past the
 * viewport (like this results dropdown) is simply unreachable, not just
 * cramped. Reclaim that space and make the panel itself scrollable.
 */
@media (max-width: 767px) {
	.search-screen {
		padding-top: 16px;
		padding-bottom: 16px;
		bottom: 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
	}

	.journal-live-search__results {
		margin-top: 12px;
	}
}
