/**
 * TutsVela Core search panel: styles for the live results this module renders (V4 tv.css .sres, .kind, .textlink).
 * Why not Kadence: the results are rendered by JavaScript, not by blocks, so no block or Customizer control can
 * style them. Colours use the Kadence palette variables so the dark palette follows. Everything else in the panel
 * (chips, "Jump to", empty state, key hints) is a Kadence Element styled in the block editor.
 */

/* Panel order: results first, then the Element sections (V4 order: start or results or empty, then key hints). */
.tv-search-panel {
	display: flex;
	flex-direction: column;
}
.tv-search-panel > .tv-search-foot {
	order: 10;
}

/* Which part shows in each state. Start = popular searches and "Jump to" (no query). */
.tv-search-panel .tv-search-count,
.tv-search-panel .tv-search-results,
.tv-search-panel .tv-search-all,
.tv-search-panel .tv-search-empty {
	display: none;
}
.tv-search-panel:not([data-state="idle"]) .tv-search-start {
	display: none;
}
.tv-search-panel[data-state="loading"] .tv-search-count,
.tv-search-panel[data-state="error"] .tv-search-count,
.tv-search-panel[data-state="results"] .tv-search-count {
	display: block;
}
.tv-search-panel[data-state="results"] .tv-search-results,
.tv-search-panel[data-state="results"] .tv-search-all {
	display: block;
}
.tv-search-panel[data-state="empty"] .tv-search-empty {
	display: flex;
}

.tv-search-count {
	margin: 0;
	padding: 14px 24px 0;
	font-size: 14px;
	color: var(--global-palette5);
}
.tv-search-results {
	list-style: none;
	margin: 0;
	padding: 8px;
}
.tv-search-results a {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 14px;
	align-items: baseline;
	padding: 12px;
	border-radius: 12px;
	color: var(--global-palette3);
	font-weight: 700;
	text-decoration: none;
}
.tv-search-panel .tv-search-results a:hover,
.tv-search-panel .tv-search-results a:focus-visible {
	background: var(--global-palette8);
	color: var(--global-palette3);
}
.tv-search-kind {
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--global-palette5);
}
.tv-search-all {
	margin: 0;
	padding: 8px 20px 20px;
}
.tv-search-all a {
	color: var(--global-palette10);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.tv-search-all a:hover {
	color: var(--global-palette15);
}
@media (max-width: 560px) {
	.tv-search-results a {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}
}
@media (prefers-reduced-motion: no-preference) {
	.tv-search-results a {
		transition: background-color 0.15s;
	}
}
