/* Infografik „Selten ist häufig — auch bei den Insekten".
   Nutzt die gemeinsamen Basis-Tokens (assets/basis.css) und die Export-Leiste
   (assets/export.css). Aufbau/Klassen wie `selten-haeufig` (.rwif-sh-*); eigene
   ID #rwif-selten-haeufig-insekten. Zusätzlich .rwif-shi- für Stamm/Boden. */

.rwif-grafik.rwif-sh {
	gap: 14px;
	--rwif-softgreen: #DEEAD7;
	--rwif-softgreen-line: #C4D6B8;
	--rwif-sh-cell-fill: #F6F8F3;
	--rwif-sh-cell-line: #E3E8DD;
}
@media (prefers-color-scheme: dark) {
	.rwif-grafik.rwif-sh {
		--rwif-softgreen: #17241A;
		--rwif-softgreen-line: #294031;
		--rwif-sh-cell-fill: #191F19;
		--rwif-sh-cell-line: #28311F;
	}
}

/* — Große Kennzahl (Hero) — */
.rwif-sh-hero {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: -4px 0 -2px;
}
.rwif-sh-hero-num {
	font-family: var(--rwif-display);
	font-weight: 700;
	font-size: clamp(40px, 7.5vw, 64px);
	line-height: 1;
	color: var(--rwif-forest);
	letter-spacing: -.01em;
}
.rwif-sh-hero-txt {
	font-family: var(--rwif-body);
	font-size: 18px;
	color: var(--rwif-ink-soft);
}
@media (max-width: 640px) {
	.rwif-sh-hero-txt { white-space: normal; }
}

/* — Umschalter — */
.rwif-sh-ctrl {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	font-family: var(--rwif-ui);
	margin-top: 12px;
	margin-bottom: -8px;
}
.rwif-sh-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.rwif-sh-toggle button {
	font-family: var(--rwif-ui);
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
	padding: 8px 14px;
	border-radius: 9px;
	border: 1px solid var(--rwif-line);
	background: var(--rwif-paper-2);
	color: var(--rwif-ink-soft);
	transition: border-color .15s, color .15s, background .15s;
}
.rwif-sh-toggle button:hover { border-color: var(--rwif-leaf); color: var(--rwif-forest); }
.rwif-sh-toggle button.on {
	background: var(--rwif-forest);
	border-color: var(--rwif-forest);
	color: #fff;
}
.rwif-sh-toggle button:focus-visible { outline: 2px solid var(--rwif-forest); outline-offset: 2px; }

/* — Bühne: Krone links, Listen rechts — */
.rwif-sh-view { display: none; }
.rwif-sh-view.on { display: block; }
.rwif-sh-stage {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	gap: 20px;
}
.rwif-sh-hektar { flex: 1 1 auto; min-width: 0; }
.rwif-sh-svg { display: block; width: 100%; height: auto; }
.rwif-sh-hnote {
	font-family: var(--rwif-ui);
	font-size: 12px;
	color: var(--rwif-ink-faint);
	margin: 4px 0 0;
	line-height: 1.4;
}

/* — Rasterkacheln — */
.rwif-sh-cell { fill: var(--rwif-sh-cell-fill); stroke: var(--rwif-sh-cell-line); stroke-width: 1; }
.rwif-sh-selbox { fill: none; stroke: none; pointer-events: none; }
.rwif-sh-use.sel ~ .rwif-sh-selbox { stroke: var(--rwif-ink); stroke-width: 2; }

/* — Stamm + Boden (Baumkrone) — */
.rwif-shi-trunk { fill: var(--rwif-dust); }
.rwif-shi-ground { stroke: var(--rwif-line); stroke-width: 1.4; stroke-linecap: round; }

/* — Insekten — */
.rwif-sh-use { cursor: pointer; transition: opacity .15s; }
.rwif-sh-use:focus { outline: none; }
.rwif-sh-use:focus-visible { outline: 2px solid var(--rwif-forest); outline-offset: 1px; }
.rwif-sh-trees.has-sel .rwif-sh-use { opacity: .26; }
.rwif-sh-trees.has-sel .rwif-sh-use.sel { opacity: 1; }

/* — Listen rechts — */
.rwif-sh-lists {
	flex: 0 0 204px;
	/* min-width:0 hebt den automatischen Flex-Mindestboden (min-content) auf —
	   sonst wächst die Listenspalte je nach Artnamen über 204px und die Krone
	   springt beim Umschalten kleiner (Regenwaldbaum ↔ Stieleiche). */
	min-width: 0;
	max-width: 204px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	align-self: flex-start;
}
.rwif-sh-list {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-radius: 12px;
	padding: 9px 10px 7px;
}
.rwif-sh-list-kurz {
	flex: 0 0 auto;
	background: var(--rwif-paper-2);
	border: 1px solid var(--rwif-line);
}
.rwif-sh-list-lang {
	flex: 1 1 auto;
	min-height: 72px;
	background: var(--rwif-softgreen);
	border: 1px solid var(--rwif-softgreen-line);
}
.rwif-sh-listhead {
	font-family: var(--rwif-ui);
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--rwif-titel);
	margin: 0 0 5px;
	padding: 1px 3px 0;
}
.rwif-sh-list-kurz .rwif-sh-listhead { color: var(--rwif-savanna); }
.rwif-sh-list-lang .rwif-sh-listhead { color: var(--rwif-titel); }
.rwif-sh-listcount { color: var(--rwif-ink-faint); font-weight: 600; }
.rwif-sh-listbody {
	display: flex;
	flex-direction: column;
	gap: 0;
}
.rwif-sh-list-lang .rwif-sh-listbody { flex: 1 1 auto; }
.rwif-sh-scroll {
	overflow-y: scroll;
	max-height: 100%;
	scrollbar-width: thin;
	scrollbar-color: var(--rwif-leaf) transparent;
}
.rwif-sh-scroll::-webkit-scrollbar { width: 9px; }
.rwif-sh-scroll::-webkit-scrollbar-track { background: transparent; }
.rwif-sh-scroll::-webkit-scrollbar-thumb {
	background: var(--rwif-leaf);
	border-radius: 6px;
	border: 2px solid var(--rwif-softgreen);
}
.rwif-sh-listsub {
	font-family: var(--rwif-ui);
	font-size: 11.5px;
	color: var(--rwif-ink-soft);
	margin: -1px 0 6px;
	padding: 0 3px;
}

/* — Listenzeile — */
.rwif-sh-row {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	border-radius: 6px;
	padding: 1px 6px;
	cursor: pointer;
	font-family: var(--rwif-ui);
	color: var(--rwif-ink);
	line-height: 1.2;
}
/* Theme-Reset: viele WP-Themes geben <button> eigene Höhe/Abstände/Zeilenhöhe.
   Die ID-Spezifität schlägt solche Regeln (eigene ID dieser Grafik). */
#rwif-selten-haeufig-insekten .rwif-sh-row {
	flex: 0 0 auto;
	margin: 0;
	min-height: 0;
	height: auto;
	padding: 1px 6px;
	line-height: 1.2;
	font-weight: 400;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}
#rwif-selten-haeufig-insekten .rwif-sh-rowname { line-height: 1.2; font-weight: 400; }
#rwif-selten-haeufig-insekten .rwif-sh-rownum { line-height: 1.2; font-weight: 700; }
.rwif-sh-row:hover { background: rgba(31, 92, 60, .10); }
.rwif-sh-row.sel { background: rgba(31, 92, 60, .18); }
.rwif-sh-row:focus-visible { outline: 2px solid var(--rwif-forest); outline-offset: -1px; }
.rwif-sh-dot {
	flex: 0 0 auto;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.rwif-sh-rowname {
	flex: 1 1 auto;
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.rwif-sh-rownum {
	flex: 0 0 auto;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--rwif-ink-soft);
	font-variant-numeric: tabular-nums;
}

/* — Detailzeile — */
.rwif-sh-detail {
	font-family: var(--rwif-body);
	font-size: 15.5px;
	color: var(--rwif-ink-soft);
	margin: 0;
	min-height: 2.4em;
}
.rwif-sh-detail strong { color: var(--rwif-titel); font-weight: 600; }
.rwif-sh-detail em { font-style: italic; }

/* — Stat-Kacheln — */
.rwif-sh-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}
.rwif-sh-stat {
	background: var(--rwif-paper-2);
	border: 1px solid var(--rwif-line);
	border-radius: 10px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.rwif-sh-stat-lbl {
	font-family: var(--rwif-ui);
	font-size: 12px;
	color: var(--rwif-ink-soft);
	line-height: 1.3;
}
.rwif-sh-stat-num {
	font-family: var(--rwif-ui);
	font-weight: 800;
	font-size: 26px;
	line-height: 1.1;
	margin: 2px 0 1px;
	color: var(--rwif-forest);
	font-variant-numeric: tabular-nums;
}
.rwif-sh-stat-sub {
	font-family: var(--rwif-ui);
	font-size: 11.5px;
	color: var(--rwif-ink-faint);
	line-height: 1.3;
}
@media (max-width: 560px) {
	.rwif-sh-stats { grid-template-columns: 1fr; }
}

/* — Merksatz — */
.rwif-sh-punch {
	background: var(--rwif-paper-3);
	border-radius: 10px;
	padding: 14px 16px;
	margin: 0;
	font-family: var(--rwif-body);
	font-size: 16px;
	color: var(--rwif-ink);
	line-height: 1.5;
}

/* — Quellzeile — */
.rwif-sh-note {
	font-family: var(--rwif-ui);
	font-size: 12px;
	color: var(--rwif-ink-faint);
	margin: 0;
	line-height: 1.45;
}

/* — Responsiv: unter 640px Krone über den Listen — */
@media (max-width: 640px) {
	.rwif-sh-stage { flex-direction: column; }
	.rwif-sh-svg { max-width: none; margin: 0 auto; }
	.rwif-sh-lists { flex: 1 1 auto; margin-top: 4px; }
	.rwif-sh-list-lang .rwif-sh-listbody { max-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
	.rwif-sh-use { transition: none; }
}
