/**
 * Tomanland Blog Category Filter — UI
 *
 * Hover: #f0fdf4 / #047857
 * Selected: tick only (no row background)
 */

.tbf-filter {
	direction: rtl;
	text-align: right;
	--tbf-hover-bg: #f0fdf4;
	--tbf-hover-text: #047857;
	--tbf-accent: #047857;
	--tbf-text: #2d3748;
	--tbf-text-muted: #4a5568;
	--tbf-border: #e2e8f0;
}

.tbf-filter__list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.tbf-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 10px 12px;
	margin: 0 0 4px;
	border: none !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 0;
	cursor: pointer;
	text-decoration: none !important;
	color: inherit;
	font: inherit;
	box-sizing: border-box;
	user-select: none;
	outline: none !important;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, color 0.15s ease;
}

/* Kill theme/browser purple/pink focus & active fills (buttons + links) */
.tbf-filter .tbf-row:focus,
.tbf-filter .tbf-row:focus-visible,
.tbf-filter .tbf-row:active,
.tbf-filter .tbf-row:visited,
.tbf-filter button.tbf-row:focus,
.tbf-filter button.tbf-row:active,
.tbf-filter a.tbf-row:focus,
.tbf-filter a.tbf-row:active,
.tbf-filter a.tbf-row:visited {
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	outline: none !important;
	color: inherit;
}

.tbf-row:active {
	transform: scale(0.985);
}

.tbf-row__label {
	display: flex;
	align-items: center;
	font-size: 14px;
	font-weight: 500;
	color: var(--tbf-text);
	transition: color 0.15s ease;
}

.tbf-row--child .tbf-row__label::before,
.tbf-row--all .tbf-row__label::before {
	content: '';
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-left: 10px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
	background-size: cover;
	opacity: 0;
	transform: scale(0.5);
	transition: opacity 0.15s ease, transform 0.15s ease;
	flex-shrink: 0;
}

.tbf-is-checked .tbf-row__label::before,
.tbf-row--all.tbf-is-checked .tbf-row__label::before,
.tbf-row--child.tbf-is-checked .tbf-row__label::before {
	opacity: 1;
	transform: scale(1);
}

.tbf-row--parent .tbf-row__label::before {
	display: none !important;
}

.tbf-row--parent {
	width: 100%;
	text-align: right;
}

.tbf-row--child {
	position: relative;
	margin-right: 32px;
	padding-top: 6px;
	padding-bottom: 6px;
	padding-right: 16px;
	width: calc(100% - 32px);
}

.tbf-row--child .tbf-row__label {
	font-weight: 400;
	font-size: 13px;
	color: var(--tbf-text-muted);
}

.tbf-row--child::before {
	content: '';
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 12px;
	background-color: var(--tbf-border);
	border-radius: 999px;
	transition: background-color 0.2s ease, height 0.2s ease;
	pointer-events: none;
}

.tbf-row--child.tbf-is-checked::before {
	background-color: var(--tbf-accent);
	height: 14px;
}

.tbf-toggle-arrow {
	margin-right: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s ease;
	padding: 2px;
	opacity: 0.75;
	pointer-events: none;
	flex-shrink: 0;
}

.tbf-toggle-arrow svg {
	display: block;
}

.tbf-is-open > .tbf-row--parent .tbf-toggle-arrow {
	transform: rotate(180deg);
}

.tbf-counter {
	display: inline-block;
	margin-right: 6px;
	color: #718096;
	font-size: 12px;
	direction: ltr;
}

.tbf-row--all {
	margin-bottom: 8px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--tbf-border);
}

.tbf-row--all .tbf-row__label {
	font-weight: 600;
	font-size: 14px;
	color: var(--tbf-text);
}

/* Selected: tick (+ child pill) only — no row background */
.tbf-filter .tbf-row--all.tbf-is-checked,
.tbf-filter .tbf-row--child.tbf-is-checked,
.tbf-filter .tbf-group.tbf-parent-active > .tbf-row--parent {
	background: transparent !important;
	background-color: transparent !important;
}

.tbf-row--all.tbf-is-checked .tbf-row__label,
.tbf-row--child.tbf-is-checked .tbf-row__label {
	color: var(--tbf-accent);
}

.tbf-group.tbf-parent-active > .tbf-row--parent .tbf-row__label {
	color: var(--tbf-accent);
	font-weight: 600;
}

/* Hover only (mint) — also covers focus-visible so purple never shows */
.tbf-filter .tbf-row:hover,
.tbf-filter .tbf-row:focus-visible,
.tbf-filter .tbf-row--all:hover,
.tbf-filter .tbf-row--all:focus-visible,
.tbf-filter .tbf-row--child:hover,
.tbf-filter .tbf-row--child:focus-visible,
.tbf-filter .tbf-row--parent:hover,
.tbf-filter .tbf-row--parent:focus-visible,
.tbf-filter .tbf-row--all.tbf-is-checked:hover,
.tbf-filter .tbf-row--child.tbf-is-checked:hover,
.tbf-filter .tbf-group.tbf-parent-active > .tbf-row--parent:hover,
.tbf-filter .tbf-group.tbf-parent-active > .tbf-row--parent:focus-visible {
	background: var(--tbf-hover-bg) !important;
	background-color: var(--tbf-hover-bg) !important;
}

.tbf-filter .tbf-row:hover .tbf-row__label,
.tbf-filter .tbf-row:focus-visible .tbf-row__label,
.tbf-filter .tbf-row--all:hover .tbf-row__label,
.tbf-filter .tbf-row--child:hover .tbf-row__label,
.tbf-filter .tbf-row--parent:hover .tbf-row__label,
.tbf-filter .tbf-row--all.tbf-is-checked:hover .tbf-row__label,
.tbf-filter .tbf-row--child.tbf-is-checked:hover .tbf-row__label,
.tbf-filter .tbf-group.tbf-parent-active > .tbf-row--parent:hover .tbf-row__label {
	color: var(--tbf-hover-text) !important;
}

.tbf-filter .tbf-row--child:hover::before,
.tbf-filter .tbf-row--child.tbf-is-checked:hover::before {
	background-color: var(--tbf-accent);
}

.tbf-children[hidden] {
	display: none !important;
}

.tbf-filter[data-tbf-navigating] {
	pointer-events: none;
	opacity: 0.72;
}
