/*
 * Topic chips: Plain Nav Tabs with the "Pills" style, drawn as the outlined
 * chips of the design (label + muted count). The plugin's own CSS is
 * zero-specificity, so these rules win without !important.
 */
.wp-block-plainplugins-nav-tab.is-style-pills {
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--border-radius--full);
	background: transparent;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	gap: 6px;
}

.wp-block-plainplugins-nav-tab.is-style-pills:hover {
	border-color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.wp-block-plainplugins-nav-tab.is-style-pills[aria-current="page"] {
	border-color: var(--wp--preset--color--action);
	background-color: var(--wp--preset--color--action);
	color: var(--wp--preset--color--on-action);
}

.wp-block-plainplugins-nav-tab.is-style-pills p {
	margin: 0;
}

.wp-block-plainplugins-nav-tabs__count {
	color: var(--wp--preset--color--muted);
	font-size: 0.75rem;
}

[aria-current="page"] .wp-block-plainplugins-nav-tabs__count {
	color: inherit;
	opacity: 0.8;
}

/* The block style is shared with the editor; only motion needs JavaScript. */
.wp-block-plainplugins-nav-tabs.is-style-gliding-underline {
	position: relative;
	box-shadow: none;
}

.is-style-gliding-underline .wp-block-plainplugins-nav-tab {
	opacity: 1;
}

/* Replace the plugin's bottom-edge rule with an indicator near the label. */
.is-style-gliding-underline .wp-block-plainplugins-nav-tab::before {
	content: none;
}

.is-style-gliding-underline .wp-block-plainplugins-nav-tab p {
	position: relative;
}

.is-style-gliding-underline .wp-block-plainplugins-nav-tab p::after {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	left: 0;
	height: 2px;
	border-radius: 2px;
	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 {
	opacity: 1;
}

.is-style-gliding-underline.is-pst-glide-ready .wp-block-plainplugins-nav-tab p::after {
	content: none;
}

/* One decorative pseudo-element moves across the existing navigation links. */
.is-style-gliding-underline.is-pst-glide-ready::after {
	position: absolute;
	top: var(--pst-glide-y, 0px);
	left: 0;
	width: var(--pst-glide-width, 0px);
	height: 2px;
	border-radius: 2px;
	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-style-gliding-underline.is-pst-glide-ready::after {
		transition: none;
	}
}
