/*
 * Course taxonomy navigation (DEV-411, OPS-151 decisions 12, 12b and 13).
 *
 * 1. The Categories facet as a tree on the course archive (tutor/archive-course.php).
 * 2. Child category chips under the hero on a category page with children.
 * 3. The Topics row of tag links under the category pills on a course (tutor/single-course.php).
 *
 * Builds on the archive and course kits in os-training-snippets
 * (onlysecurity-archive.css, onlysecurity-course.css); every token carries its
 * value as a fallback.
 */

/* 1. Category tree */
.os-a-fblock li[hidden],
.os-a-fblock .os-a-ftree-kids[hidden],
.os-a-fblock .os-a-fmore[hidden] { display: none !important; }

.os-a-fblock li.os-a-ftree { display: block; padding: 0; }
.os-a-ftree-row { display: flex; align-items: center; gap: 4px; padding: 6px 0; }
.os-a-ftree-row > label { flex: 1; min-width: 0; }
.os-a-ftree-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-width: 44px;
	min-height: 32px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--os-a-muted, #64748b);
	font: inherit;
	font-size: 13px;
	font-weight: 400;
	cursor: pointer;
}
.os-a-ftree-btn:hover { color: var(--os-a-text, #1e293b); background: var(--os-a-bg, #f7f8fb); }
.os-a-ftree-btn:focus-visible { outline: 2px solid var(--os-a-primary, #2F62AF); outline-offset: 2px; }
.os-a-ftree-btn .chev { display: inline-block; transition: transform .15s ease; }
.os-a-ftree-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
/* .os-a-fblock in front so it outranks the archive kit's .os-a-fblock ul { padding: 0 }. */
.os-a-fblock .os-a-ftree-kids { list-style: none; margin: 0; padding: 0 0 0 22px; }
/* The parent row's bold and colour, when the parent is ticked, stop at its children. */
.os-a-fblock li.os-a-ftree.active .os-a-ftree-kids li:not(.active) { font-weight: 400; color: var(--os-a-text, #1e293b); }
button.os-a-fmore,
button.os-a-fmore:hover,
button.os-a-fmore:focus { padding: 0; border: 0; background: none; color: var(--os-a-primary, #2F62AF); font-family: inherit; text-align: left; box-shadow: none; }
button.os-a-fmore:focus-visible { outline: 2px solid var(--os-a-primary, #2F62AF); outline-offset: 2px; }
@media (max-width: 900px) {
	.os-a-fblock li.os-a-ftree { min-height: 0; }
	.os-a-ftree-row { min-height: 44px; padding: 0; }
	.os-a-ftree-btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
	.os-a-ftree-btn .chev { transition: none; }
}

/* 2. Child category chips: one row, scrolls sideways when it does not fit */
.os-a-subcats {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	margin: 14px 0 0;
	padding-bottom: 4px;
	overflow-x: auto;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}
.os-a-subcats a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--os-a-border, #e5e7eb);
	border-radius: 999px;
	background: var(--os-a-panel, #ffffff);
	color: var(--os-a-text, #1e293b);
	font-size: 14px;
	white-space: nowrap;
	text-decoration: none;
}
.os-a-subcats a:hover { border-color: var(--os-a-primary, #2F62AF); color: var(--os-a-primary, #2F62AF); }
.os-a-subcats a:focus-visible { outline: 2px solid var(--os-a-primary, #2F62AF); outline-offset: 2px; }
.os-a-subcats .n { color: var(--os-a-muted, #64748b); font-size: 12px; font-variant-numeric: tabular-nums; }

/* 3. Topics row on a course, lighter than the category pills */
.os-c-topics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 12px;
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--os-c-muted, #64748b);
}
.os-c-topics a {
	color: var(--os-c-text, #1e293b);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.os-c-topics a:hover { color: var(--os-c-primary, #2F62AF); }
