/**
 * Defyne Glossary — tooltip popup styling.
 *
 * Same rule as the rest of the plugin: structure, not identity. Colors and
 * font come from the same --defyne-* custom properties defyne-glossary.css
 * already defines, with the same fallback values, so a tooltip looks
 * consistent with the glossary pages themselves without a theme having to
 * configure anything twice. If a theme has already redeclared --defyne-*
 * on :root or body, the tooltip picks that up automatically.
 */

.defyne-tip {
	--defyne-accent: #2c5f8a;
	--defyne-border: #e2e2e2;
	--defyne-muted: #6b6b6b;
	--defyne-radius: 6px;

	position: absolute;
	top: 0;
	left: 0;
	z-index: 100000;
	display: none;
	width: 280px;
	max-width: calc(100vw - 24px);
	padding: 0.85rem 1rem;
	background: #fff;
	color: #1a1a1a;
	border: 1px solid var(--defyne-border);
	border-radius: var(--defyne-radius);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	font-family: inherit;
	font-size: 0.9rem;
	line-height: 1.5;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.12s ease, transform 0.12s ease;
	pointer-events: none;
}

.defyne-tip.is-defyne-tip-visible {
	display: block;
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.defyne-tip-title {
	font-weight: 700;
	margin-bottom: 0.3rem;
	color: #1a1a1a;
}

.defyne-tip-body {
	color: var(--defyne-muted);
	margin-bottom: 0.5rem;
}

.defyne-tip-more {
	display: inline-block;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--defyne-accent);
	text-decoration: none;
}

.defyne-tip-more:hover,
.defyne-tip-more:focus {
	text-decoration: underline;
}

/* The trigger link itself gets a subtle, always-visible affordance so
   visitors have some signal a term is "enhanced" before they ever hover. */
a.defyne-tooltip-trigger {
	text-decoration-style: dotted;
	text-underline-offset: 2px;
	cursor: help;
}

@media (prefers-reduced-motion: reduce) {
	.defyne-tip {
		transition: none;
	}
}

@media (max-width: 480px) {
	.defyne-tip {
		width: calc(100vw - 24px);
	}
}
