/**
 * MadTheme Blocks - Glossary Tooltip Styles
 *
 * Served only when the tooltip is enabled: the term styling and the floating
 * bubble both belong to it, so with the tooltip off neither reaches the page.
 */

/* ── 1. Glossary In-Content Autolink ────────────────────────────────── */
a.mw-glossary-term {
	text-decoration: none;
	border-bottom: 1.5px dotted var(--wp--preset--color--accent, #3740b9);
	cursor: help;
	color: inherit;
	transition: border-color 0.15s ease, color 0.15s ease;
}

a.mw-glossary-term:hover,
a.mw-glossary-term:focus-visible {
	border-bottom-style: solid;
	color: var(--wp--preset--color--accent, #3740b9);
}

body.dark-mode a.mw-glossary-term,
html[data-theme="dark"] a.mw-glossary-term {
	border-bottom-color: var(--wp--preset--color--accent, #6b9cff);
}

body.dark-mode a.mw-glossary-term:hover,
body.dark-mode a.mw-glossary-term:focus-visible,
html[data-theme="dark"] a.mw-glossary-term:hover,
html[data-theme="dark"] a.mw-glossary-term:focus-visible {
	color: var(--wp--preset--color--accent, #6b9cff);
}

	/* Explicit choice: the visitor picked dark, or the site starts dark.
	   Independent of the system preference. */
	body.dark-mode a.mw-glossary-term, html.dark-mode a.mw-glossary-term, body.editor-styles-wrapper:not(.dark-mode-off) a.mw-glossary-term {border-bottom-color: var(--wp--preset--color--accent, #6b9cff);}
	body.dark-mode a.mw-glossary-term:hover, html.dark-mode a.mw-glossary-term:hover, body.editor-styles-wrapper:not(.dark-mode-off) a.mw-glossary-term:hover, body.dark-mode a.mw-glossary-term:focus-visible, html.dark-mode a.mw-glossary-term:focus-visible, body.editor-styles-wrapper:not(.dark-mode-off) a.mw-glossary-term:focus-visible {color: var(--wp--preset--color--accent, #6b9cff);}
	@media (prefers-color-scheme: dark) {
		/* The site follows the system preference. */
		html:not(.dark-mode-off) body.dark-mode-auto a.mw-glossary-term {border-bottom-color: var(--wp--preset--color--accent, #6b9cff);}
		html:not(.dark-mode-off) body.dark-mode-auto a.mw-glossary-term:hover, html:not(.dark-mode-off) body.dark-mode-auto a.mw-glossary-term:focus-visible {color: var(--wp--preset--color--accent, #6b9cff);}
	}
/* ── 2. Glossary Floating Tooltip ──────────────────────────────────── */
.mw-glossary-tooltip {
	position: absolute;
	z-index: 99999;
	max-width: 320px;
	padding: 12px 16px;
	background: var(--wp--preset--color--base, #ffffff);
	color: var(--wp--preset--color--contrast, #101012);
	border: 1px solid var(--wp--preset--color--tertiary, rgba(16, 16, 18, 0.15));
	border-radius: 8px;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
	font-size: 0.875rem;
	line-height: 1.45;
	pointer-events: auto;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	transform: translateY(4px);
}

.mw-glossary-tooltip.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.mw-glossary-tooltip__title {
	font-weight: 700;
	font-size: 0.95rem;
	margin: 0 0 4px;
	color: var(--wp--preset--color--contrast, #101012);
}

.mw-glossary-tooltip__excerpt {
	margin: 0 0 8px;
	color: var(--wp--preset--color--secondary, rgba(16, 16, 18, 0.65));
}

.mw-glossary-tooltip__link {
	display: inline-block;
	font-weight: 600;
	font-size: 0.8rem;
	color: var(--wp--preset--color--accent, #3740b9);
	text-decoration: underline;
}

body.dark-mode .mw-glossary-tooltip,
html[data-theme="dark"] .mw-glossary-tooltip {
	background: var(--wp--preset--color--base-2, #1e232c);
	color: var(--wp--preset--color--contrast, #eceff4);
	border-color: var(--wp--preset--color--tertiary, #3b4252);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

body.dark-mode .mw-glossary-tooltip__title,
html[data-theme="dark"] .mw-glossary-tooltip__title {
	color: var(--wp--preset--color--contrast, #eceff4);
}

body.dark-mode .mw-glossary-tooltip__excerpt,
html[data-theme="dark"] .mw-glossary-tooltip__excerpt {
	color: var(--wp--preset--color--secondary, #a0aab6);
}

body.dark-mode .mw-glossary-tooltip__link,
html[data-theme="dark"] .mw-glossary-tooltip__link {
	color: var(--wp--preset--color--accent, #6b9cff);
}

	/* Explicit choice: the visitor picked dark, or the site starts dark.
	   Independent of the system preference. */
	body.dark-mode .mw-glossary-tooltip, html.dark-mode .mw-glossary-tooltip, body.editor-styles-wrapper:not(.dark-mode-off) .mw-glossary-tooltip {background: var(--wp--preset--color--base-2, #1e232c);
		color: var(--wp--preset--color--contrast, #eceff4);
		border-color: var(--wp--preset--color--tertiary, #3b4252);
		box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);}
	body.dark-mode .mw-glossary-tooltip__title, html.dark-mode .mw-glossary-tooltip__title, body.editor-styles-wrapper:not(.dark-mode-off) .mw-glossary-tooltip__title {color: var(--wp--preset--color--contrast, #eceff4);}
	body.dark-mode .mw-glossary-tooltip__excerpt, html.dark-mode .mw-glossary-tooltip__excerpt, body.editor-styles-wrapper:not(.dark-mode-off) .mw-glossary-tooltip__excerpt {color: var(--wp--preset--color--secondary, #a0aab6);}
	body.dark-mode .mw-glossary-tooltip__link, html.dark-mode .mw-glossary-tooltip__link, body.editor-styles-wrapper:not(.dark-mode-off) .mw-glossary-tooltip__link {color: var(--wp--preset--color--accent, #6b9cff);}
	@media (prefers-color-scheme: dark) {
		/* The site follows the system preference. */
		html:not(.dark-mode-off) body.dark-mode-auto .mw-glossary-tooltip {background: var(--wp--preset--color--base-2, #1e232c);
		color: var(--wp--preset--color--contrast, #eceff4);
		border-color: var(--wp--preset--color--tertiary, #3b4252);
		box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);}
		html:not(.dark-mode-off) body.dark-mode-auto .mw-glossary-tooltip__title {color: var(--wp--preset--color--contrast, #eceff4);}
		html:not(.dark-mode-off) body.dark-mode-auto .mw-glossary-tooltip__excerpt {color: var(--wp--preset--color--secondary, #a0aab6);}
		html:not(.dark-mode-off) body.dark-mode-auto .mw-glossary-tooltip__link {color: var(--wp--preset--color--accent, #6b9cff);}
	}
