/* Tierheim Tiersuche – nutzt die Elementor-Globalfarben, mit Fallbacks */
.ths {
	--ths-gruen: var(--e-global-color-primary, #A0CC52);
	--ths-dunkel: var(--e-global-color-secondary, #144525);
	--ths-text: var(--e-global-color-text, #1b1b1b);
	--ths-grau: #6b7066;
	--ths-linie: #dfe5d8;
	--ths-flaeche: #f5f8f1;
	--ths-rot: #b3261e;
	--ths-radius: 12px;
	color: var(--ths-text);
	font-size: 16px;
	line-height: 1.45;
	max-width: 1240px;
	margin: 0 auto;
}
.ths *, .ths *::before, .ths *::after { box-sizing: border-box; }
.ths-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ths-titel { color: var(--ths-dunkel); margin: 0 0 16px; }

/* Suchzeile */
.ths-suchzeile { position: relative; display: flex; gap: 8px; }
.ths-lupe { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%);
	fill: none; stroke: var(--ths-grau); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.ths .ths-q {
	flex: 1; min-width: 0; height: 52px; padding: 0 16px 0 46px; font-size: 17px;
	border: 2px solid var(--ths-linie); border-radius: 999px; background: #fff; color: inherit;
}
.ths .ths-q:focus { outline: none; border-color: var(--ths-gruen); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ths-gruen) 25%, transparent); }
.ths-filter-toggle { display: none; }

/* Buttons allgemein – Theme-Stile (z. B. Hello Elementor: rosa Hover/Fokus) neutralisieren */
.ths button { font: inherit; cursor: pointer; text-transform: none; letter-spacing: normal; }
.ths .ths-status button:hover, .ths .ths-status button:focus,
.ths .ths-arten button:hover, .ths .ths-arten button:focus,
.ths .ths-filter-toggle:hover, .ths .ths-filter-toggle:focus { background: #fff; color: var(--ths-text); border-color: var(--ths-gruen); }
.ths .ths-chip:hover, .ths .ths-chip:focus { background: color-mix(in srgb, var(--ths-gruen) 35%, #fff); color: var(--ths-dunkel); }
.ths .ths-link:hover, .ths .ths-link:focus { background: none; color: var(--ths-dunkel); }
.ths .ths-mehr:hover, .ths .ths-mehr:focus { background: var(--ths-dunkel); color: #fff; }
.ths button:focus-visible { outline: 3px solid var(--ths-gruen); outline-offset: 2px; }
.ths-status, .ths-arten { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ths-status button, .ths-arten button, .ths-filter-toggle {
	border: 1.5px solid var(--ths-linie); background: #fff; color: var(--ths-text);
	border-radius: 999px; padding: 8px 14px; line-height: 1.2; font-size: 15px;
	transition: background .15s, border-color .15s, color .15s;
}
.ths-status button:hover, .ths-arten button:hover { border-color: var(--ths-gruen); }
.ths .ths-status button[aria-pressed="true"] { background: var(--ths-dunkel); border-color: var(--ths-dunkel); color: #fff; }
.ths .ths-arten button[aria-pressed="true"] { background: var(--ths-gruen); border-color: var(--ths-gruen); color: #10240f; font-weight: 600; }
.ths-n { display: inline-block; min-width: 1.6em; padding: 1px 6px; margin-left: 4px; border-radius: 999px;
	background: rgba(0,0,0,.07); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.ths-status button[aria-pressed="true"] .ths-n { background: rgba(255,255,255,.22); }
.ths-status button { font-weight: 600; }

/* Detailfilter */
.ths-filter {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px;
	margin-top: 16px; padding: 16px; background: var(--ths-flaeche); border-radius: var(--ths-radius);
}
.ths-filter > label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ths-grau); }
.ths-filter select {
	height: 42px; padding: 0 10px; font-size: 15px; font-weight: 400; color: var(--ths-text);
	border: 1.5px solid var(--ths-linie); border-radius: 8px; background-color: #fff; width: 100%;
}
.ths-filter select:focus { outline: 2px solid var(--ths-gruen); outline-offset: 1px; }
.ths-merkmale { grid-column: 1 / -1; border: 0; padding: 0; margin: 4px 0 0; min-width: 0; }
.ths-merkmale legend { font-size: 13px; font-weight: 600; color: var(--ths-grau); padding: 0; margin-bottom: 6px; }
.ths-merkmale-liste { display: contents; }
.ths-merkmale { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ths-merkmale legend { flex-basis: 100%; }
.ths-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.ths-check input { width: 17px; height: 17px; accent-color: var(--ths-dunkel); margin: 0; }
.ths [hidden] { display: none !important; }

/* Aktive Filter */
.ths-aktiv { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ths-aktiv:empty { display: none; }
.ths-chip { border: 0; background: color-mix(in srgb, var(--ths-gruen) 22%, #fff); color: var(--ths-dunkel);
	border-radius: 999px; padding: 5px 10px 5px 12px; font-size: 14px; }
.ths-chip span { margin-left: 4px; font-weight: 700; }
.ths-link { background: none; border: 0; padding: 0; color: var(--ths-dunkel); text-decoration: underline; font-size: 14px; }

/* Ergebnisse */
.ths-zaehler { margin: 22px 0 12px; font-weight: 600; color: var(--ths-grau); }
.ths-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ths-karte a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit;
	background: #fff; border: 1px solid var(--ths-linie); border-radius: var(--ths-radius); overflow: hidden;
	transition: transform .15s, box-shadow .15s; }
.ths-karte a:hover, .ths-karte a:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(20,69,37,.13); }
.ths-karte a:focus-visible { outline: 3px solid var(--ths-gruen); outline-offset: 2px; }
.ths-bild { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ths-flaeche); }
.ths .ths-bild img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 0; display: block; }
.ths-kein-bild { display: grid; place-items: center; height: 100%; }
.ths-kein-bild svg { width: 34%; fill: color-mix(in srgb, var(--ths-gruen) 45%, #fff); }
.ths-badge { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px;
	font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.ths-badge-vermittlung { background: var(--ths-dunkel); color: #fff; }
.ths-badge-fund { background: #fff3c4; color: #5a4400; }
.ths-badge-dringend { left: auto; right: 10px; background: var(--ths-rot); color: #fff; }
.ths-inhalt { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.ths-inhalt h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.25; color: var(--ths-dunkel); }
.ths-inhalt dl { margin: 0; display: grid; gap: 3px; font-size: 14px; }
.ths-inhalt dl div { display: flex; gap: 6px; }
.ths-inhalt dt { color: var(--ths-grau); min-width: 92px; flex-shrink: 0; }
.ths-inhalt dd { margin: 0; }
.ths-text { margin: 10px 0 0; font-size: 14px; color: #3d4239; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ths-mehr-info { margin-top: auto; padding-top: 12px; font-weight: 600; font-size: 14px; color: var(--ths-dunkel); }

.ths-leer { text-align: center; padding: 40px 16px; background: var(--ths-flaeche); border-radius: var(--ths-radius); }
.ths-leer p { margin: 4px 0; }
.ths-mehr { display: block; margin: 28px auto 0; padding: 12px 26px; border: 0; border-radius: 999px;
	background: var(--ths-dunkel); color: #fff; font-weight: 600; }
.ths-mehr:hover { filter: brightness(1.15); }

/* Platz für das spätere Suchabo */
.ths-abo { margin-top: 18px; padding: 16px; border: 2px dashed var(--ths-gruen); border-radius: var(--ths-radius); }

/* Tablet */
@media (max-width: 960px) {
	.ths-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Handy: Detailfilter einklappbar */
@media (max-width: 640px) {
	.ths-filter-toggle { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; flex-shrink: 0; }
	.ths-filter-anzahl { background: var(--ths-dunkel); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
	.ths .ths-q { height: 48px; font-size: 16px; }
	.ths-filter { display: none; grid-template-columns: 1fr; }
	.ths.ths-offen .ths-filter { display: grid; }
	.ths-arten { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
	.ths-arten button { flex-shrink: 0; }
	.ths-liste { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.ths-karte a { transition: none; }
}
