/**
 * PSAS: List tooltips (editor-friendly).
 *
 * Markup (block editor, no custom HTML): a List block with the class `psas-tooltip-list`.
 * Under any item, INDENT one sub-item (Tab in the editor) and give that nested List block
 * the class `psas-tooltip`. The sub-item's text becomes the tooltip on the front end;
 * in the editor it simply shows as an indented bullet, so admins can edit it in place.
 *
 *   - Administrative Assistance
 *       - Apply now for more information.   <- nested list, class "psas-tooltip"
 *
 * Shows on hover, keyboard focus and tap (psas-tooltips.js adds tabindex + tap toggle).
 * Loaded only on pages whose content contains `psas-tooltip-list` (includes/assets.php).
 * Hide all tooltips later with: .psas-tooltip-list .psas-tooltip { display: none; }
 */

.psas-tooltip-list > li:has(> .psas-tooltip) {
	position: relative;
	cursor: help;
	text-decoration: underline dotted;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.psas-tooltip-list > li:has(> .psas-tooltip):focus-visible {
	outline: 2px solid var(--blue-dark, #2b3b4c);
	outline-offset: 3px;
	border-radius: 4px;
}

/* The bubble (the nested list). Resting values declared explicitly for smooth transitions. */
.psas-tooltip-list .psas-tooltip {
	position: absolute;
	left: 0;
	bottom: calc(100% + 10px);
	z-index: 30;
	width: max-content;
	max-width: min(280px, 80vw);
	margin: 0;
	padding: 0.7rem 0.95rem;
	list-style: none;
	background: var(--blue-dark, #2b3b4c);
	color: #fff;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
	text-align: left;
	border-radius: 10px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
	cursor: default;
	opacity: 0;
	visibility: hidden;
	transform: translate3d(0, 4px, 0);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
}

/* Arrow */
.psas-tooltip-list .psas-tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 1.25rem;
	border: 7px solid transparent;
	border-top-color: var(--blue-dark, #2b3b4c);
}

.psas-tooltip-list .psas-tooltip > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.psas-tooltip-list .psas-tooltip > li::before,
.psas-tooltip-list .psas-tooltip > li::marker {
	content: none;
}

.psas-tooltip-list > li:hover > .psas-tooltip,
.psas-tooltip-list > li:focus-within > .psas-tooltip,
.psas-tooltip-list > li.is-tooltip-open > .psas-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translate3d(0, 0, 0);
	transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
	.psas-tooltip-list .psas-tooltip {
		transition: none;
	}
}
