.staemme-grid {
	--staemme-bg: #0b3a7e;
	--staemme-text: #fff;
	--staemme-link: #3fb4f0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 28px;
}

.staemme-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px;
	background: var(--staemme-bg);
	color: var(--staemme-text);
	border-radius: 6px;
}

.staemme-card__title {
	margin: 0;
	color: var(--staemme-text);
	font-size: 1.4rem;
}

.staemme-card__image {
	position: relative;
	min-height: 120px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 4px;
}

.staemme-card__image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 4px;
}

.staemme-card__meta,
.staemme-card__info,
.staemme-card__stufen {
	margin: 0;
}

.staemme-badge {
	display: inline-block;
	padding: 1px 10px;
	margin: 0 6px 4px 0;
	border-radius: 999px;
	font-size: 0.85rem;
	color: #fff;
}

.staemme-status {
	position: absolute;
	top: 8px;
	right: 8px;
	margin: 0;
	z-index: 1;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.staemme-status--aktiv { background: #4aa71f; }
.staemme-status--im-aufbau { background: #f5b82e; color: #222; }
.staemme-status--in-planung { background: #1ea5e0; }

.staemme-stufe--woelflinge { background: #e0301e; }
.staemme-stufe--jupfis { background: #4aa71f; }
.staemme-stufe--pfadis { background: #1b7a3a; }
.staemme-stufe--erwachsene { background: #5a2a6e; }

.staemme-card__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	color: var(--staemme-link);
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
}

/* Doppelpfeil wie auf der bisherigen Seite */
.staemme-card__link::after {
	content: "";
	width: 28px;
	height: 16px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 16' fill='none' stroke='%23d9cfc0' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 2 6 6-6 6'/%3E%3Cpath d='m11 2 6 6-6 6'/%3E%3Cpath d='m19 2 6 6-6 6'/%3E%3C/svg%3E") no-repeat center / contain;
	transition: transform 0.15s;
}

.staemme-card__link:hover::after,
.staemme-card__link:focus-visible::after {
	transform: translateX(4px);
}

/* Das hidden-Attribut muss gegen display:grid/flex gewinnen. */
.staemme [hidden] {
	display: none !important;
}

/* Toolbar: Filter + Ansichtsumschalter */
.staemme {
	--staemme-accent: #0b3a7e;
	--staemme-border: #c9d3e3;
	--staemme-panel: #f3f6fb;
}

.staemme-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 24px;
	align-items: flex-end;
	justify-content: space-between;
	margin-bottom: 8px;
	padding: 16px 18px;
	background: var(--staemme-panel);
	border: 1px solid var(--staemme-border);
	border-radius: 10px;
}

.staemme-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: flex-end;
	flex: 1 1 auto;
}

.staemme-filter__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 150px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--staemme-accent);
}

.staemme-filter input[type="search"],
.staemme-filter select {
	box-sizing: border-box;
	width: 100%;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--staemme-border);
	border-radius: 8px;
	background-color: #fff;
	color: #1d2733;
	font-size: 0.95rem;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.staemme-filter input[type="search"] {
	padding-left: 36px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230b3a7e' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 12px center;
}

.staemme-filter select {
	padding-right: 34px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%230b3a7e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	cursor: pointer;
}

.staemme-filter input[type="search"]:focus,
.staemme-filter select:focus {
	outline: none;
	border-color: var(--staemme-accent);
	box-shadow: 0 0 0 3px rgba(11, 58, 126, 0.18);
}

/* Buttons */
.staemme-btn {
	height: 42px;
	padding: 0 18px;
	border: 1px solid var(--staemme-accent);
	border-radius: 8px;
	background: #fff;
	color: var(--staemme-accent);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.staemme-btn:hover {
	background: var(--staemme-accent);
	color: #fff;
}

.staemme-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(11, 58, 126, 0.3);
}

.staemme-btn[data-reset] {
	border-color: transparent;
	background: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.staemme-btn[data-reset]:hover {
	background: transparent;
	color: #e0301e;
}

/* Umschalter Kacheln/Karte als Segment-Control */
.staemme-views {
	display: inline-flex;
	border: 1px solid var(--staemme-accent);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.staemme-views .staemme-btn {
	border: 0;
	border-radius: 0;
}

.staemme-views .staemme-btn + .staemme-btn {
	border-left: 1px solid var(--staemme-accent);
}

.staemme-btn.is-active {
	background: var(--staemme-accent);
	color: #fff;
}

.staemme-count {
	margin: 0 0 20px;
	padding-left: 4px;
	font-size: 0.9rem;
	color: #4a5a70;
}

@media (max-width: 640px) {
	.staemme-toolbar {
		padding: 14px;
	}

	.staemme-filter__field {
		flex: 1 1 100%;
	}

	.staemme-views,
	.staemme-views .staemme-btn {
		width: 100%;
	}

	.staemme-views .staemme-btn {
		flex: 1;
	}
}

.staemme-map__canvas {
	height: clamp(520px, 78vh, 800px);
	border-radius: 10px;
	border: 1px solid var(--staemme-border);
	z-index: 0;
}

/* Marker: Pin in Statusfarbe (ohne Bilddatei) */
.staemme-pin span {
	display: block;
	width: 26px;
	height: 26px;
	margin: 0 3px;
	border-radius: 50% 50% 50% 0;
	background: var(--staemme-accent);
	border: 2px solid #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
	transform: rotate(-45deg);
}

.staemme-pin span::after {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin: 7px;
	border-radius: 50%;
	background: #fff;
}

.staemme-pin--aktiv span { background: #4aa71f; }
.staemme-pin--im-aufbau span { background: #f5b82e; }
.staemme-pin--in-planung span { background: #1ea5e0; }

/* Popup */
.staemme .leaflet-popup-content-wrapper {
	border-radius: 10px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.staemme-popup {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	min-width: 160px;
}

.staemme-popup__title {
	color: var(--staemme-accent);
	font-size: 1rem;
}

.staemme-popup .staemme-badge {
	margin: 0;
}

.staemme-popup__link {
	color: var(--staemme-accent);
	font-weight: 600;
}

.staemme .leaflet-control-layers {
	border-radius: 8px;
}

.staemme-map__consent {
	padding: 28px 24px;
	background: var(--staemme-panel);
	border: 1px dashed var(--staemme-accent);
	border-radius: 10px;
	text-align: center;
}

.staemme-map__consent p {
	max-width: 52ch;
	margin: 0 auto 16px;
}
