/**
 * Categories tree: folders — right expand triangle; nested folders — left chevron; posts — dot.
 */

.art-categories {
	--art-chevron-svg: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22white%22%20d%3D%22M8%205.14v14l11-7z%22%2F%3E%3C%2Fsvg%3E");
	--art-tree-indent: 0.5rem;
}

.art-categories .count {
	display: none;
}

.art-categories li > a {
	color: #5d5d5d;
	line-height: 26px;
	font-size: 14px;
	padding: 6px 0;
	display: flex;
	align-items: center;
}

/* Folder row: label fills space; expand chevron pinned to the right (original). */
.art-categories .art-cat-toggle {
	display: flex;
	align-items: center;
	flex-direction: row;
	flex-wrap: nowrap;
	width: 100%;
	box-sizing: border-box;
	color: #5d5d5d;
	line-height: 26px;
	font-size: 14px;
	padding: 6px 0;
	cursor: pointer;
	user-select: none;
	gap: 6px;
}

.art-categories .art-cat-toggle .art-cat-label {
	flex: 1;
	min-width: 0;
	text-align: left;
}

.art-categories li.art-cat-parent > .art-cat-toggle .art-child-indicator {
	display: inline-block;
	flex-shrink: 0;
	margin-left: auto;
	line-height: 1;
	color: inherit;
}

/* Right chevron: points right closed, rotates down when open */
.art-categories li.art-cat-parent > .art-cat-toggle .art-child-indicator::before {
	content: "";
	display: inline-block;
	width: 1.125em;
	height: 1.125em;
	vertical-align: middle;
	background-color: currentColor;
	-webkit-mask-image: var(--art-chevron-svg);
	mask-image: var(--art-chevron-svg);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-position: center;
	mask-position: center;
	transform-origin: 50% 50%;
	transition: transform 0.2s ease;
	transform: rotate(0deg);
}

.art-categories li.art-cat-parent > .art-cat-toggle .art-child-indicator.open::before {
	transform: rotate(90deg);
}

/* Nested folders: small left prefix (top-level folders have no left prefix). */
.art-categories ul.art-tree-branch > li.art-cat-parent > .art-cat-toggle::before {
	content: "";
	display: block;
	flex-shrink: 0;
	width: 1.125em;
	height: 1.125em;
	background-color: currentColor;
	opacity: 0.55;
	-webkit-mask-image: var(--art-chevron-svg);
	mask-image: var(--art-chevron-svg);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-position: center;
	mask-position: center;
	transform: rotate(0deg);
}

.art-categories ul.art-tree-branch > li.art-cat-parent > .art-cat-toggle:hover::before {
	opacity: 0.85;
}

/*
 * Nested branch indent
 */
ul.art-categories ul.art-tree-branch,
.art-categories-post-tree ul.art-tree-branch {
	display: none;
	list-style: none !important;
	margin: 0 !important;
	margin-block: 0 !important;
	box-sizing: border-box;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	padding-right: 0 !important;
	padding-left: var(--art-tree-indent) !important;
	padding-inline-start: var(--art-tree-indent) !important;
}

.widget ul.art-categories ul.art-tree-branch,
.widget .art-categories-post-tree ul.art-tree-branch,
.wp-block-widget ul.art-categories ul.art-tree-branch {
	padding-left: var(--art-tree-indent) !important;
	padding-inline-start: var(--art-tree-indent) !important;
}

/* Posts: small round dot prefix (not an expand arrow). */
.art-categories .children li.art-post-item > a::before {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin: 0 0.55em 0 0;
	vertical-align: middle;
	background-color: currentColor;
	opacity: 0.55;
	border-radius: 50%;
	transition: margin 0.3s ease, opacity 0.2s ease;
}

.art-categories .children li.art-post-item > a:hover::before {
	margin-right: 10px;
	opacity: 0.85;
}

.art-categories .current-cat > .art-cat-toggle .art-cat-label {
	font-weight: 700;
}

.art-categories .art-post-item.current-post > a {
	font-weight: 700;
}
