/* The header links and Popular Now tabs use the same indicator. */
:is(.wp-block-plainplugins-nav-tabs.is-style-gliding-underline, .pst-popular-tabs.is-style-underline .wp-block-tab-list) {
	--pst-glide-offset: 6px;
	--pst-glide-thickness: 2px;

	position: relative;
}

/* Draw the same indicator under the label before the module is ready. */
.is-style-gliding-underline .wp-block-plainplugins-nav-tab > p {
	position: relative;
}

:where(.is-style-gliding-underline .wp-block-plainplugins-nav-tab > p, .pst-popular-tabs.is-style-underline .wp-block-tab-list > [role="tab"])::after {
	position: absolute;
	top: calc(100% + var(--pst-glide-offset) - var(--pst-glide-label-inset, 0px));
	right: 0;
	left: 0;
	height: var(--pst-glide-thickness);
	border-radius: var(--pst-glide-thickness);
	background: var(--wp--preset--color--action);
	content: "";
	opacity: 0;
	pointer-events: none;
}

.is-style-gliding-underline .wp-block-plainplugins-nav-tab:is([aria-current="page"], .is-editing-current, .is-editing-hover, :hover, :focus-visible) > p::after,
.pst-popular-tabs.is-style-underline .wp-block-tab-list > [role="tab"]:is([aria-selected="true"], :hover, :focus-visible)::after,
.pst-popular-tabs.is-style-underline .wp-block-tab-list:not(:has(> [aria-selected])) > [role="tab"]:first-child::after {
	opacity: 1;
}

.is-pst-glide-ready :is(.wp-block-plainplugins-nav-tab > p, [role="tab"])::after {
	content: none;
}

.is-pst-glide-ready::after {
	position: absolute;
	top: var(--pst-glide-y, 0px);
	left: 0;
	width: var(--pst-glide-width, 0px);
	height: var(--pst-glide-thickness);
	border-radius: var(--pst-glide-thickness);
	background: var(--wp--preset--color--action);
	content: "";
	opacity: var(--pst-glide-visible, 0);
	pointer-events: none;
	transform: translateX(var(--pst-glide-x, 0px));
	transition: transform var(--pst-glide-duration, 220ms) cubic-bezier(0.2, 0.8, 0.2, 1), width var(--pst-glide-duration, 220ms) cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {

	.is-pst-glide-ready::after {
		transition: none;
	}
}
