/*
 * CS Mitlaufendes Inhaltsverzeichnis – gemeinsame Frontend-Regeln.
 * Individuelle Werte werden aus einer extern erzeugten settings.css geladen.
 */

.cs-sticky-toc {
	--cs-toc-accent: #f44647;
	--cs-toc-text: #555555;
	--cs-toc-width: 280px;
	--cs-toc-gap: 40px;
	--cs-toc-extension: 320px;
	--cs-toc-top-offset: 100px;
	--cs-toc-max-height-offset: 130px;
	--cs-toc-scroll-offset-desktop: 110px;
	--cs-toc-scroll-offset-mobile: 110px;
	--cs-toc-level-indent: 2px;
	--cs-toc-font-size: 14px;
	--cs-toc-title-font-size: 16px;
	--cs-toc-line-height: 1.45;
}

.cs-sticky-toc-sidebar {
	display: none;
}

.cs-sticky-toc-top-anchor {
	display: block;
	position: relative;
	visibility: hidden;
}

.cs-sticky-toc-content {
	min-width: 0;
}

.cs-sticky-toc-nav,
.cs-sticky-toc-panel {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.cs-sticky-toc-title {
	display: block;
	width: 100%;
	margin: 0 0 10px;
	padding: 0 22px 10px 0;
	box-sizing: border-box;
	border: 0;
	border-bottom: 2px solid var(--cs-toc-accent);
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-family: inherit;
	font-size: var(--cs-toc-title-font-size);
	font-weight: 700;
	line-height: 1.4;
	text-align: left;
}

button.cs-sticky-toc-title {
	position: relative;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

button.cs-sticky-toc-title::after {
	content: "▾";
	position: absolute;
	top: 0;
	right: 2px;
	color: var(--cs-toc-text);
	font-size: 14px;
	line-height: 1.4;
	transform: rotate(0deg);
	transition: transform 0.15s ease;
}

button.cs-sticky-toc-title[aria-expanded="false"]::after {
	transform: rotate(-90deg);
}

button.cs-sticky-toc-title:hover,
button.cs-sticky-toc-title:focus-visible {
	color: var(--cs-toc-accent);
}

button.cs-sticky-toc-title:focus-visible {
	outline: 1px dotted var(--cs-toc-accent);
	outline-offset: 3px;
}

.cs-sticky-toc-panel[hidden] {
	display: none !important;
}

.cs-sticky-toc-top-link,
.cs-sticky-toc-top-link:link,
.cs-sticky-toc-top-link:visited {
	display: block;
	width: 100%;
	margin: 0 0 13px;
	padding: 0;
	box-sizing: border-box;
	color: var(--cs-toc-text) !important;
	font-size: var(--cs-toc-font-size);
	font-weight: 600;
	line-height: var(--cs-toc-line-height);
	white-space: normal;
	overflow-wrap: break-word;
	text-decoration: none !important;
}

.cs-sticky-toc-list {
	width: 100%;
	max-width: 100%;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box;
	list-style: none !important;
}

.cs-sticky-toc-item {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	column-gap: 6px;
	width: 100%;
	max-width: 100%;
	margin: 0 0 7px !important;
	box-sizing: border-box;
	list-style: none !important;
	font-size: var(--cs-toc-font-size);
	line-height: var(--cs-toc-line-height);
}

.cs-sticky-toc-depth-1 {
	padding-left: 0 !important;
}

.cs-sticky-toc-depth-2 {
	padding-left: var(--cs-toc-level-indent) !important;
}

.cs-sticky-toc-depth-3 {
	padding-left: calc(2 * var(--cs-toc-level-indent)) !important;
}

.cs-sticky-toc-depth-4 {
	padding-left: calc(3 * var(--cs-toc-level-indent)) !important;
}

.cs-sticky-toc-depth-5 {
	padding-left: calc(4 * var(--cs-toc-level-indent)) !important;
}

.cs-sticky-toc-number {
	color: var(--cs-toc-text) !important;
	font-size: inherit;
	font-weight: 600;
	line-height: inherit;
	white-space: nowrap;
}

.cs-sticky-toc-link,
.cs-sticky-toc-link:link,
.cs-sticky-toc-link:visited,
.cs-sticky-toc-link:active,
.cs-sticky-toc-link:focus {
	min-width: 0;
	max-width: 100%;
	color: var(--cs-toc-text) !important;
	font-size: inherit;
	font-weight: 400;
	line-height: inherit;
	white-space: normal !important;
	overflow-wrap: anywhere;
	word-break: normal;
	hyphens: auto;
	border: 0 !important;
	box-shadow: none !important;
	background-image: none !important;
	text-decoration: none !important;
	text-shadow: none !important;
	transition: color 0.15s ease;
}

.cs-sticky-toc-link:hover,
.cs-sticky-toc-top-link:hover,
.cs-sticky-toc-link:focus-visible,
.cs-sticky-toc-top-link:focus-visible,
.cs-sticky-toc-link.is-active,
.cs-sticky-toc-top-link.is-active {
	color: var(--cs-toc-accent) !important;
	text-decoration: none !important;
}

.cs-sticky-toc-link:focus-visible,
.cs-sticky-toc-top-link:focus-visible {
	outline: 1px dotted var(--cs-toc-accent);
	outline-offset: 2px;
}

.cs-sticky-toc-top-anchor,
.cs-sticky-toc-scroll-target,
.cs-sticky-toc-content h1[id],
.cs-sticky-toc-content h2[id],
.cs-sticky-toc-content h3[id],
.cs-sticky-toc-content h4[id],
.cs-sticky-toc-content h5[id] {
	scroll-margin-top: var(--cs-toc-scroll-offset-desktop, 110px);
}
