@media (prefers-reduced-motion: no-preference) {
	html:has(body.single-kunskapshub) {
		scroll-behavior: smooth;
	}
}

body.single-kunskapshub {
	overflow-x: hidden;
}

body.single-kunskapshub main#site-content [id] {
	scroll-margin-top: 120px;
}

/* TOC Drawer */
.kh-toc-drawer-trigger {
	position: absolute;
	top: 42%;
	right: 0;
	transform: translate(100%, -50%);
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 20px 12px;
	background: #3ADCC9;
	border: none;
	cursor: pointer;
	border-radius: 0 28px 28px 0;
	box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.15);
	color: #0A2E59;
	transition: background-color 0.2s ease;
}

.kh-toc-drawer-trigger:hover {
	background: rgba(237, 134, 224, 1);
}

.kh-toc-drawer-trigger:focus-visible {
	outline: 3px solid #0A2E59;
	outline-offset: 2px;
}

.kh-toc-drawer-trigger__text {
	writing-mode: vertical-lr;
	color: var(--brand-500, #0A2E59);
	font-family: var(--font-family-heading, "Barlow Condensed");
	font-size: var(--text-h5, 1.25rem);
	font-weight: var(--font-weight-semibold, 600);
	line-height: 125%;
	text-transform: uppercase;
}

.kh-toc-drawer-outer {
	position: fixed;
	z-index: 100;
	top: 0;
	left: 0;
	height: 100%;
	max-width: 360px;
	width: 100vw;
	pointer-events: none;
	transform: translateX(-100%);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kh-toc-drawer-outer.active {
	pointer-events: auto;
	transform: translateX(0);
}

.kh-toc-drawer {
	width: 100%;
	height: 100%;
	background: #001b39;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.kh-toc-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
	color: #fff;
	font-weight: 700;
	font-size: 18px;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	flex-shrink: 0;
}

.kh-toc-drawer-close {
	background: none;
	border: none;
	cursor: pointer;
	color: #9ca3af;
	display: flex;
	align-items: center;
	padding: 0;
	transition: color 0.2s ease;
}

.kh-toc-drawer-close:hover {
	color: #fff;
}

.kh-toc-drawer-close:focus-visible {
	color: #fff;
	outline: 2px solid #3ADCC9;
	outline-offset: 2px;
}

.kh-toc-drawer-nav {
	flex: 1;
	overflow-y: auto;
	padding: 16px 24px;
}

.kh-toc-drawer-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
}

.kh-toc-drawer-list li {
	margin: 0;
	padding: 0;
}

.kh-toc-drawer-list li::marker {
	content: "";
}

.kh-toc-drawer-link {
	display: block;
	padding: 12px 0 12px 12px;
	color: #3ADCC9;
	text-decoration: none;
	font-size: 1rem;
	border-left: 3px solid transparent;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	transition: color 0.2s ease, border-color 0.2s ease;
}

.kh-toc-drawer-link:hover {
	color: #fff;
}

.kh-toc-drawer-link:focus-visible {
	color: #fff;
	outline: 2px solid #3ADCC9;
	outline-offset: -2px;
}

.kh-toc-drawer-link--active {
	color: #fff;
	border-left-color: #3ADCC9;
}

.kh-toc-drawer-footer {
	padding: 20px 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	flex-shrink: 0;
}

.kh-toc-drawer-cta {
	display: block;
	text-align: center;
	background: #3ADCC9;
	color: #0A2E59;
	text-decoration: none;
	border-radius: 9999px;
	padding: 12px 24px;
	font-size: 1rem;
	line-height: 1.25;
	white-space: nowrap;
	transition: background-color 0.3s ease;
}

.kh-toc-drawer-cta:hover {
	background: rgba(237, 134, 224, 1);
	color: #0A2E59;
}

.kh-toc-drawer-cta:focus-visible {
	outline: 3px solid #3ADCC9;
	outline-offset: 2px;
}

@media (max-width: 768px) {
	.kh-toc-drawer-trigger {
		padding: 16px 10px;
		gap: 8px;
	}
}

@media (max-width: 400px) {
	.kh-toc-drawer-outer {
		max-width: 100vw;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kh-toc-drawer-outer {
		transition: none;
	}
	.kh-toc-drawer-trigger {
		transition: none;
	}
	.kh-toc-drawer-link,
	.kh-toc-drawer-link--active,
	.kh-toc-drawer-cta {
		transition: none;
	}
}
