/* CZ Tooltips: Begriffe im Fliesstext + schwebende Karte. Praefix czg-, keine Enfold-Konflikte. */

/* Begriff: dezente gepunktete Unterstreichung in CannaZen-Gruen (#10c956). Aendert nie den Textfluss. */
.czg {
	position: relative;
	cursor: help;
	text-decoration: underline dotted #10c956;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
	text-decoration-skip-ink: none;
	outline: 0;
	-webkit-tap-highlight-color: transparent;
}
.czg:hover,
.czg[aria-expanded="true"] { text-decoration-style: solid; }
.czg:focus-visible {
	outline: 2px solid #0b7a35;
	outline-offset: 2px;
	border-radius: 3px;
}
/* Grosse Tippflaeche auf Touch: unsichtbare Flaeche per Pseudo-Element, ohne Einfluss auf den Textfluss. */
@media (pointer: coarse) {
	.czg::after {
		content: "";
		position: absolute;
		left: -3px;
		right: -3px;
		top: -14px;
		bottom: -14px;
	}
}
/* Definitionstext bleibt im DOM (Crawler, Screenreader), ist visuell aber versteckt. */
.czg-def[hidden] { display: none !important; }

/* Karte */
body .czg-card {
	--czg-bg: rgba(255, 255, 255, .94);
	--czg-fg: #1b1f1d;
	--czg-link: #0a6f30;
	--czg-line: rgba(16, 40, 25, .14);
	position: fixed;
	left: 0;
	top: 0;
	z-index: 9990;
	box-sizing: border-box;
	width: max-content;
	max-width: min(280px, calc(100vw - 16px));
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--czg-line);
	border-radius: 12px;
	background: var(--czg-bg);
	color: var(--czg-fg);
	box-shadow: 0 1px 2px rgba(10, 30, 18, .08), 0 8px 24px rgba(10, 30, 18, .16);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	font-weight: 400;
	font-style: normal;
	letter-spacing: 0;
	text-align: left;
	text-transform: none;
	text-shadow: none;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transform: scale(.96);
	transform-origin: var(--czg-ox, 50%) var(--czg-oy, 0);
	transition: opacity .12s ease, transform .12s ease, visibility 0s linear .12s;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	body .czg-card {
		-webkit-backdrop-filter: saturate(1.4) blur(12px);
		backdrop-filter: saturate(1.4) blur(12px);
	}
}
body .czg-card.czg-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transform: none;
	transition-delay: 0s;
}
body .czg-card .czg-body { margin: 0; padding: 0; overflow-wrap: anywhere; }
html body .czg-card a,
html body .czg-card a:visited {
	display: inline;
	margin: 0;
	padding: 0;
	color: var(--czg-link) !important; /* Enfold setzt Linkfarben mit #top a, daher !important */
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	border: 0;
}
body .czg-card a:hover { text-decoration-thickness: 2px; }
body .czg-card a:focus-visible,
body .czg-card .czg-x:focus-visible { outline: 2px solid var(--czg-link); outline-offset: 2px; border-radius: 3px; }

/* Pfeil zur Begriffsposition */
body .czg-card::before {
	content: "";
	position: absolute;
	left: calc(var(--czg-ax, 24px) - 6px);
	width: 10px;
	height: 10px;
	background: var(--czg-bg);
	border: 1px solid var(--czg-line);
	transform: rotate(45deg);
}
body .czg-card.czg-below::before { top: -6px; border-right: 0; border-bottom: 0; }
body .czg-card.czg-above::before { bottom: -6px; border-left: 0; border-top: 0; }
body .czg-card.czg-sheet::before { display: none; }

/* Schliessen-Knopf nur im Bottom-Sheet */
body .czg-card .czg-x { display: none; }
body .czg-card.czg-sheet {
	left: 8px;
	right: 8px;
	top: auto;
	bottom: calc(8px + env(safe-area-inset-bottom, 0px));
	width: auto;
	max-width: none;
	padding: 14px 52px 14px 14px;
	transform: translateY(8px);
}
body .czg-card.czg-sheet.czg-open { transform: none; }
body .czg-card.czg-sheet .czg-x {
	display: block;
	position: absolute;
	top: 0;
	right: 0;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--czg-fg);
	font: 400 26px/44px sans-serif;
	text-align: center;
	cursor: pointer;
	box-shadow: none;
}

@media (prefers-color-scheme: dark) {
	body .czg-card {
		--czg-bg: rgba(27, 32, 29, .94);
		--czg-fg: #eef3ef;
		--czg-link: #4be08c;
		--czg-line: rgba(255, 255, 255, .16);
		box-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .5);
	}
}
@media (prefers-reduced-motion: reduce) {
	body .czg-card { transition: none !important; transform: none !important; }
}
