/**
 * Auto-Verlinkung: Begriffe im Fließtext + Hover-Tooltip.
 * Eigenständig, wird auf Einzelseiten geladen (unabhängig vom Glossar-CSS).
 */
:root {
	--wg-gloss-accent: #cf4b22;
	--wg-gloss-accent-rgb: 207, 75, 34;
}

a.wg-gloss {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient( transparent 92%, rgba( var(--wg-gloss-accent-rgb), 0.45 ) 0 );
	background-size: 100% 100%;
	border-radius: 2px;
	padding: 0 0.05em;
	cursor: help;
	transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

a.wg-gloss:hover,
a.wg-gloss:focus-visible {
	color: var(--wg-gloss-accent);
	background-image: none;
	background-color: rgba( var(--wg-gloss-accent-rgb), 0.1 );
	box-shadow: 0 0 0 2px rgba( var(--wg-gloss-accent-rgb), 0.15 );
	outline: none;
}

/* Tooltip */
.wg-gloss-tip {
	position: absolute;
	z-index: 100000;
	max-width: 300px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #1f2226;
	color: #f1f2f4;
	font-size: 13px;
	line-height: 1.45;
	box-shadow: 0 8px 28px rgba( 0, 0, 0, 0.28 );
	pointer-events: none;
	opacity: 0;
	transform: translateY( 4px );
	transition: opacity 0.14s ease, transform 0.14s ease;
}

.wg-gloss-tip.is-visible {
	opacity: 1;
	transform: translateY( 0 );
}

.wg-gloss-tip__label {
	display: block;
	margin: 0 0 3px;
	font-weight: 600;
	color: #fff;
}

.wg-gloss-tip__arrow {
	position: absolute;
	width: 10px;
	height: 10px;
	background: #1f2226;
	transform: rotate( 45deg );
}

@media ( prefers-reduced-motion: reduce ) {
	a.wg-gloss,
	.wg-gloss-tip { transition: none; }
}
