/**
 * Site-Suche: globale Styles (Treffer werden per JS eingefügt – ohne Astro-scoped Attribute).
 */

html.suche-offen {
	overflow: hidden;
}

.suche {
	z-index: 120;
}

.suche .suche-in {
	max-width: min(720px, 100% - 32px);
	margin-inline: auto;
	padding: 0 0 16px;
	box-shadow:
		0 24px 64px rgba(0, 0, 0, 0.28),
		0 0 0 1px rgba(0, 0, 0, 0.06);
}

.suche .suche-zeile {
	border-bottom: 1px solid var(--k-200, #dcdcdc);
	padding: 12px 16px 10px;
	gap: 10px;
}

.suche .suche-zeile input[type="search"] {
	font-size: clamp(17px, 4vw, 20px);
	font-weight: 500;
}

.suche .suche-zeile input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.suche .suche-clear {
	display: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: var(--k-100, #ededed);
	color: var(--k-600, #4a4a4a);
	cursor: pointer;
	flex: none;
	font-size: 18px;
	line-height: 1;
}

.suche .suche-clear.is-visible {
	display: grid;
}

.suche .suche-clear:hover {
	background: var(--k-black, #0a0a0a);
	color: #fff;
}

.suche .suche-hinweis {
	padding: 10px 20px 6px;
	font-size: 13.5px;
	line-height: 1.45;
}

.suche .suche-hinweis[hidden] {
	display: none !important;
}

.suche .suche-treffer {
	list-style: none;
	margin: 0;
	padding: 4px 8px 8px;
	max-height: min(58vh, 520px);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* Ein Treffer – Kartenzeile (Kategorie | 2 Textzeilen | Pfeil) */
.suche .suche-treffer > li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.suche .suche-treffer .suche-hit,
.suche .suche-treffer > li > a.suche-hit,
.suche .suche-treffer > li > a {
	display: grid;
	grid-template-columns: minmax(76px, 96px) minmax(0, 1fr) 28px;
	grid-template-rows: minmax(1.25em, auto) minmax(1.25em, auto);
	align-items: center;
	column-gap: 12px;
	row-gap: 2px;
	padding: 12px 12px 12px 10px;
	border-radius: 10px;
	text-decoration: none !important;
	color: inherit;
	border: 1px solid transparent;
	min-width: 0;
	transition:
		background 0.14s ease,
		border-color 0.14s ease,
		box-shadow 0.14s ease;
}

.suche .suche-treffer .suche-hit:hover,
.suche .suche-treffer .suche-hit:focus-visible,
.suche .suche-treffer > li > a:hover,
.suche .suche-treffer > li > a:focus-visible {
	background: var(--k-50, #f6f6f6);
	border-color: var(--k-200, #dcdcdc);
	outline: none;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.suche .suche-treffer .suche-hit.is-active,
.suche .suche-treffer > li > a.is-active {
	background: var(--green-50, #edfaf0);
	border-color: var(--green-300, #6bd085);
}

.suche .tr-bereich,
.suche .suche-hit-kat {
	grid-column: 1;
	grid-row: 1 / span 2;
	align-self: center;
	justify-self: start;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--k-400, #8a8a8a);
	line-height: 1.2;
	padding-top: 0;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.suche .tr-bereich[data-kat="Meldung"],
.suche .suche-hit-kat[data-kat="Meldung"] {
	color: var(--green-600, #0c7521);
}

.suche .tr-bereich[data-kat="Mannschaft"],
.suche .suche-hit-kat[data-kat="Mannschaft"] {
	color: var(--anthrazit, #24272c);
}

/* Zeile 1: Titel – genau eine Zeile mit … */
.suche .tr-titel,
.suche .suche-hit-titel,
.suche .suche-treffer > li > a > strong {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	max-width: 100%;
	font-family: var(--display, "Oswald", sans-serif);
	font-size: clamp(15px, 3.6vw, 18px);
	font-weight: 600;
	line-height: 1.25;
	color: var(--k-black, #0a0a0a);
	text-decoration: none !important;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.suche .suche-hit-titel mark.suche-mark {
	display: inline;
	white-space: nowrap;
}

/* Zeile 2: Kurztext – genau eine Zeile mit … */
.suche .tr-zeile,
.suche .suche-hit-meta {
	grid-column: 2;
	grid-row: 2;
	min-width: 0;
	max-width: 100%;
	font-size: 13px;
	line-height: 1.35;
	color: var(--k-600, #4a4a4a);
	text-decoration: none !important;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.suche .suche-hit-arrow {
	grid-column: 3;
	grid-row: 1 / span 2;
	align-self: center;
	justify-self: end;
	color: var(--k-400, #8a8a8a);
	opacity: 0.45;
	flex: none;
	pointer-events: none;
	transition:
		opacity 0.14s ease,
		transform 0.14s ease;
}

.suche .suche-hit:hover .suche-hit-arrow,
.suche .suche-hit:focus-visible .suche-hit-arrow,
.suche .suche-hit.is-active .suche-hit-arrow {
	opacity: 1;
	transform: translateX(2px);
}

.suche mark.suche-mark {
	background: rgba(15, 141, 40, 0.18);
	color: inherit;
	padding: 0 0.12em;
	border-radius: 2px;
	font-weight: inherit;
}

.suche .suche-gruppe {
	margin: 0;
	padding: 0;
}

.suche .suche-gruppe-titel {
	margin: 12px 12px 4px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--k-400, #8a8a8a);
}

.suche .suche-leer {
	padding: 28px 20px 20px;
	text-align: center;
	color: var(--k-600, #4a4a4a);
	font-size: 15px;
	line-height: 1.5;
}

.suche .suche-leer strong {
	display: block;
	color: var(--k-black, #0a0a0a);
	font-family: var(--display, "Oswald", sans-serif);
	font-size: 18px;
	margin-bottom: 6px;
}

/* Tablet: etwas mehr Luft, schmalere Kategorie-Spalte */
@media (max-width: 900px) {
	.suche .suche-in {
		max-width: min(640px, 100% - 24px);
	}

	.suche .suche-treffer .suche-hit,
	.suche .suche-treffer > li > a {
		grid-template-columns: minmax(68px, 82px) minmax(0, 1fr) 24px;
		padding: 11px 10px;
	}
}

/* Mobile: Kategorie als Badge über den beiden Zeilen */
@media (max-width: 520px) {
	.suche {
		padding-top: clamp(56px, 10vh, 100px);
	}

	.suche .suche-in {
		max-width: none;
		width: calc(100% - 20px);
		margin-inline: 10px;
		border-radius: 12px;
	}

	.suche .suche-treffer {
		max-height: min(62vh, 480px);
		padding-inline: 4px;
	}

	.suche .suche-treffer .suche-hit,
	.suche .suche-treffer > li > a {
		grid-template-columns: minmax(0, 1fr) 22px;
		grid-template-rows: auto minmax(1.2em, auto) minmax(1.2em, auto);
		row-gap: 3px;
		padding: 10px 10px 10px 12px;
	}

	.suche .tr-bereich,
	.suche .suche-hit-kat {
		grid-column: 1 / -1;
		grid-row: 1;
		align-self: start;
		font-size: 9.5px;
		letter-spacing: 0.14em;
		margin-bottom: 2px;
	}

	.suche .tr-titel,
	.suche .suche-hit-titel,
	.suche .suche-treffer > li > a > strong {
		grid-column: 1;
		grid-row: 2;
		font-size: 16px;
	}

	.suche .tr-zeile,
	.suche .suche-hit-meta {
		grid-column: 1;
		grid-row: 3;
		font-size: 12.5px;
	}

	.suche .suche-hit-arrow {
		grid-column: 2;
		grid-row: 2 / span 2;
		align-self: center;
		opacity: 0.35;
		width: 18px;
		height: 18px;
	}
}
