/* Infografik „Stockwerkbau des tropischen Regenwaldes".
   Nutzt die gemeinsamen Basis-Tokens (assets/basis.css) und die Export-Leiste
   (assets/export.css). Eigene Klassen tragen das Präfix .rwif-sb-. */

.rwif-grafik.rwif-sb { gap: 18px; }

/* — Große Kennzahl (Hero) — */
.rwif-sb-hero {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 16px;
	margin: 0 0 12px;
}
.rwif-sb-hero-num {
	font-family: var(--rwif-display);
	font-weight: 700;
	font-size: clamp(44px, 8vw, 68px);
	line-height: .86;
	color: var(--rwif-forest);
	letter-spacing: -.01em;
	/* Versalziffern: die Display-Schrift (Enriqueta) nutzt sonst Mediävalziffern
	   mit Unterlänge → die „5" hinge unter die Grundlinie und läge nicht bündig
	   mit dem Text daneben. */
	font-variant-numeric: lining-nums;
	font-feature-settings: "lnum" 1, "onum" 0;
}
.rwif-sb-hero-txt {
	font-family: var(--rwif-body);
	font-size: 18px;
	line-height: 1.1;
	color: var(--rwif-ink-soft);
}

/* — Tipp-Zeile — */
.rwif-sb-tipp {
	font-family: var(--rwif-body);
	font-size: 15.5px;
	color: var(--rwif-ink-soft);
	margin: 0;
}

/* — Zweispaltiges Layout: Bühne + Panel — */
.rwif-sb-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 258px;
	gap: 8px;
	align-items: start;
}

/* — Bühne (SVG + Schieber-Overlay + Probe-Box) — */
.rwif-sb-stage { position: relative; }
.rwif-sb-svg {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	overflow: hidden;
	background: var(--rwif-paper-2);
}

/* SVG: Lichtskala-Beschriftungen */
.rwif-sb-scalecap {
	font-family: var(--rwif-ui);
	font-size: 13px;
	font-weight: 700;
	fill: #16324a;
}
.rwif-sb-scaleval {
	font-family: var(--rwif-ui);
	font-size: 16px;
	font-weight: 800;
	fill: #fff;
	paint-order: stroke;
	stroke: rgba(0, 0, 0, .5);
	stroke-width: 3.5;
	stroke-linejoin: round;
}

/* SVG: Schicht-Labels im Bild */
.rwif-sb-lab-bg { fill: rgba(18, 38, 20, .78); }
.rwif-sb-lab-name {
	font-family: var(--rwif-ui);
	font-size: 19px;
	font-weight: 700;
	fill: #fff;
	paint-order: stroke;
	stroke: rgba(0, 0, 0, .35);
	stroke-width: 2.5;
	stroke-linejoin: round;
}
.rwif-sb-lab-h {
	font-family: var(--rwif-ui);
	font-size: 13px;
	fill: #e4efe0;
	paint-order: stroke;
	stroke: rgba(0, 0, 0, .3);
	stroke-width: 2;
	stroke-linejoin: round;
}
.rwif-sb-band { fill: #fff; fill-opacity: 0; cursor: pointer; transition: fill-opacity .15s; }
.rwif-sb-band:hover, .rwif-sb-band.on { fill-opacity: .14; }
.rwif-sb-band:focus { outline: none; }
.rwif-sb-band:focus-visible { outline: 2px solid var(--rwif-forest); outline-offset: -3px; }
.rwif-grafik.rwif-sb.is-interactive .rwif-sb-lab { cursor: pointer; }

/* — Schieber-Overlay (deckungsgleich mit der SVG-Skala: x 8..54 von 848) — */
.rwif-sb-slider {
	position: absolute;
	left: 0.96%;
	width: 5.50%;
	top: 0;
	height: 100%;
	cursor: pointer;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.rwif-sb-handle {
	position: absolute;
	left: -5px;
	right: -5px;
	top: 25.5%;
	height: 0;
	pointer-events: none;
}
.rwif-sb-handle::before {
	content: "";
	position: absolute;
	left: 0; right: 0; top: -2px;
	height: 4px;
	background: #fff;
	border-radius: 3px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 1px 5px rgba(0, 0, 0, .4);
}
.rwif-sb-knob {
	position: absolute;
	left: 50%; top: 0;
	transform: translate(-50%, -50%);
	width: 24px; height: 24px;
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--rwif-forest);
	box-shadow: 0 1px 5px rgba(0, 0, 0, .4);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rwif-forest);
	font-family: var(--rwif-ui);
	font-size: 12px;
	font-weight: 700;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

/* — Mitlaufende Mess-Box (dezentes Dunkelgrün wie die Schicht-Labels im Bild).
   Erscheint nur bei Bedienung des Schiebers: grafik.js blendet sie über die
   Klasse .is-visible ein und nach kurzer Zeit wieder aus. — */
.rwif-sb-probe {
	position: absolute;
	left: 7.5%;
	top: 25.5%;
	transform: translateY(-50%);
	width: 126px;
	max-width: 40%;
	pointer-events: none;
	background: rgba(20, 40, 24, .82);
	color: #fff;
	border-radius: 10px;
	padding: 7px 9px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
	font-family: var(--rwif-ui);
	backdrop-filter: saturate(1.1) blur(1px);
	opacity: 0;
	transition: opacity .18s ease;
}
.rwif-sb-probe.is-visible { opacity: 1; }
.rwif-sb-probe-name {
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	margin: 0;
	line-height: 1.2;
}
.rwif-sb-probe-h {
	font-size: 10.5px;
	color: #cfe6cf;
	margin: 0 0 5px;
	line-height: 1.1;
}
.rwif-sb-probe-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 11.5px;
	margin: 2.5px 0;
}
.rwif-sb-probe-row span { color: #e6efe4; }
.rwif-sb-probe-row b { font-weight: 700; color: #fff; }

/* — Rechtes Panel — */
.rwif-sb-panel {
	background: var(--rwif-paper-2);
	border: 1px solid var(--rwif-line);
	border-radius: 12px;
	padding: 14px;
	overflow-y: auto;
	font-family: var(--rwif-ui);
}
.rwif-sb-foto {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: 10px;
	overflow: hidden;
	margin: 0 0 12px;
	background: var(--rwif-paper-3);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rwif-ink-faint);
	font-size: 12px;
	text-align: center;
}
.rwif-sb-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rwif-sb-panel h3 {
	font-family: var(--rwif-display);
	font-size: 19px;
	font-weight: 700;
	color: var(--rwif-titel);
	margin: 0 0 2px;
}
.rwif-sb-meta { font-size: 12px; color: var(--rwif-ink-faint); margin: 0 0 10px; }
.rwif-sb-stat { display: flex; gap: 8px; font-size: 13px; margin: 5px 0; }
.rwif-sb-stat b { min-width: 82px; color: var(--rwif-ink-soft); font-weight: 600; }
.rwif-sb-glab {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--rwif-ink-faint);
	margin: 12px 0 4px;
}
.rwif-sb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rwif-sb-chip {
	background: var(--rwif-paper-3);
	color: var(--rwif-forest);
	font-size: 11.5px;
	padding: 3px 9px;
	border-radius: 20px;
}
/* Verlinkte Pille (Glossar-Eintrag vorhanden). */
a.rwif-sb-chip-link {
	text-decoration: none;
	box-shadow: inset 0 0 0 1px var(--rwif-leaf);
	transition: background .15s, box-shadow .15s;
}
a.rwif-sb-chip-link:hover,
a.rwif-sb-chip-link:focus-visible {
	background: var(--rwif-leaf);
	color: #fff;
	box-shadow: inset 0 0 0 1px var(--rwif-leaf);
	outline: none;
}
.rwif-sb-fakt {
	background: var(--rwif-paper-3);
	border-radius: 10px;
	padding: 9px 11px;
	font-size: 13.5px;
	line-height: 1.5;
	margin: 12px 0 0;
	color: var(--rwif-ink);
	font-family: var(--rwif-ui);
}
.rwif-sb-fakt b { color: var(--rwif-forest); }

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

/* — Mobil: Panel unter das Bild, volle Breite — */
@media (max-width: 760px) {
	.rwif-sb-main { grid-template-columns: 1fr; }
	.rwif-sb-panel { height: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
	.rwif-sb-band, a.rwif-sb-chip-link { transition: none; }
}
