/*
 * Course Viewer — minimal structural styles only.
 * No fonts, colors, or sizing overrides beyond layout: the theme's
 * own typography and palette carry through via `inherit` / `currentColor`.
 */

.cv-course-viewer {
	display: flex;
	align-items: flex-start;
	gap: 2rem;
	font-family: inherit;
	color: inherit;
}

/* Sidebar */

.cv-sidebar {
	flex: 0 0 260px;
	max-width: 260px;
	padding-right: 1.5rem;
	border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.cv-course-title {
	margin: 0 0 1rem;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.65;
}

.cv-nav-group {
	margin-bottom: 0.35rem;
}

.cv-nav-item {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.4rem 0.5rem;
	line-height: 1.35;
	color: inherit;
	text-decoration: none;
	border-radius: 4px;
}

.cv-nav-item:hover,
.cv-nav-item:focus-visible {
	background: rgba(0, 0, 0, 0.045);
}

.cv-nav-item.is-active {
	background: rgba(0, 0, 0, 0.07);
	font-weight: 600;
}

.cv-nav-children {
	margin-left: 1.15rem;
}

.cv-nav-level3 {
	font-size: 0.93em;
}

.cv-check {
	position: relative;
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	opacity: 0.4;
}

.cv-nav-item.is-complete .cv-check {
	background: currentColor;
	opacity: 1;
}

.cv-nav-item.is-complete .cv-check::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 0;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

/* Main content */

.cv-main {
	flex: 1 1 auto;
	min-width: 0;
}

.cv-content-title {
	margin-top: 0;
}

.cv-content-body :first-child {
	margin-top: 0;
}

.cv-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cv-complete-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	cursor: pointer;
}

.cv-complete-checkbox:disabled + * ,
.cv-complete-toggle:has(.cv-complete-checkbox:disabled) {
	opacity: 0.6;
	cursor: default;
}

.cv-pagination {
	display: flex;
	gap: 1.5rem;
	margin-left: auto;
}

.cv-pagination a,
.cv-pagination .is-disabled {
	color: inherit;
	text-decoration: none;
}

.cv-pagination a:hover {
	text-decoration: underline;
}

.cv-pagination .is-disabled {
	opacity: 0.35;
}

/* Small screens: sidebar collapses above the content */

@media (max-width: 700px) {
	.cv-course-viewer {
		flex-direction: column;
	}

	.cv-sidebar {
		width: 100%;
		max-width: 100%;
		padding-right: 0;
		padding-bottom: 1rem;
		border-right: none;
		border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	}

	.cv-pagination {
		margin-left: 0;
	}
}
