/**
 * Shared taxonomy sidebar categories chrome.
 *
 * API: .wsft-categories, .wsft-categories__title, .wsft-categories__list,
 *      .wsft-categories__item, .wsft-categories__link
 * Registered as `ws-form-categories` in includes/blocks.php.
 */

.wsft-categories {
	margin: 0;
}

.wsft-categories__title {
	color: var(--wp--preset--color--text-light);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	margin: 0 0 0.625rem;
	padding: 0 0.5rem;
	text-transform: uppercase;
}

.wsft-categories__list {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/*
 * Right padding keeps expand chevrons clear of the column edge.
 * Beat .list-unstyled { padding: 0 } when both classes are present.
 */
.wsft-categories__list.list-unstyled {
	padding: 0 1.25rem 0 0;
}

.wsft-categories__item {
	margin: 0;
}

.wsft-categories__link {
	border-radius: var(--wp--custom--border-radius, 0.125rem);
	color: var(--wp--preset--color--logo-blue);
	display: block;
	font-size: 0.9375rem;
	font-weight: 300;
	line-height: 1.3;
	padding: 0.375rem 0.5rem;
	text-decoration: none;
}

.wsft-categories__link:hover,
.wsft-categories__link.is-active {
	background: color-mix(in srgb, var(--wp--preset--color--accent-blue) 12%, white);
	color: var(--wp--preset--color--logo-blue);
	text-decoration: none;
}

.wsft-categories__link.is-active {
	font-weight: 600;
}

.wsft-categories__link:focus-visible {
	outline: 2px solid var(--wp--preset--color--logo-blue);
	outline-offset: 2px;
}

/*
 * When the sidebar is embedded in page post_content (e.g. Support), theme
 * .wp-block-post-content ul/li rules override the tree. Reset those here.
 */
.wp-block-post-content .wsft-categories__list {
	list-style: none;
	margin: 0;
}

.wp-block-post-content .wsft-categories__list.list-unstyled {
	padding: 0 1.25rem 0 0;
}

.wp-block-post-content .wsft-categories__item {
	margin-bottom: 0;
}
