.text-content {
	--text-content-top: clamp(3rem, 2.4rem + 2.1vw, 5rem);
	--text-content-bottom: clamp(4rem, 2.6rem + 5.6vw, 8.75rem);

	padding-block: var(--text-content-top) var(--text-content-bottom);
}

.text-content.is-hidden-preview {
	opacity: 0.4;
}

.text-content__inner {
	display: block;
	align-items: start;
}

.text-content__aside {
	margin-bottom: 32px;
}

/* Mobile: the box sticks below the header; the overlay hides text scrolling behind it */
.text-content__aside {
	position: sticky;
	top: calc(var(--header-h-mobile) + var(--admin-bar-h, 0px));
	z-index: 10;
	margin-top: -12px;
	padding-top: 12px;
}

.text-content__aside::before {
	content: "";
	position: absolute;
	inset: 0 calc(-1 * var(--gutter));
	background: var(--neutral-0);
	z-index: -1;
}

/* Body: editor-authored legal text */
.text-content__body {
	min-width: 0;
	max-width: 896px;
	color: var(--neutral-600);
	font-size: var(--fs-body-l);
	line-height: var(--lh-body-l);
	overflow-wrap: anywhere;
}

.text-content__body > * + * {
	margin-top: 20px;
}

.text-content__body h2 {
	margin-top: 60px;
	color: var(--neutral-900);
	font-size: var(--fs-h4);
	line-height: var(--lh-h4);
	letter-spacing: var(--ls-h4);
	font-weight: 600;
	scroll-margin-top: calc(var(--header-h-mobile) + 24px);
}

.text-content__body h3 {
	margin-top: 36px;
	color: var(--neutral-900);
	font-size: var(--fs-h5);
	line-height: var(--lh-h5);
	font-weight: 600;
	scroll-margin-top: calc(var(--header-h-mobile) + 24px);
}

.text-content__body > :first-child {
	margin-top: 0;
}

.text-content__body strong {
	color: var(--neutral-900);
	font-weight: 600;
}

.text-content__body a {
	color: var(--red-dark);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.text-content__body a:hover {
	color: var(--red);
}

.text-content__body ul,
.text-content__body ol {
	display: grid;
	gap: 10px;
	margin-bottom: 0;
	padding: 0;
	list-style: none;
}

.text-content__body ol {
	counter-reset: item;
}

.text-content__body li {
	position: relative;
	padding-left: 22px;
}

.text-content__body ul > li::before {
	content: "";
	position: absolute;
	top: 0.7em;
	left: 0;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--red);
}

.text-content__body ol > li {
	counter-increment: item;
}

.text-content__body ol > li::before {
	content: counter(item) ".";
	position: absolute;
	left: 0;
	color: var(--neutral-900);
	font-weight: 600;
}

/* Key/value table ("Angaben") */
.text-content__body table {
	display: block;
	width: 100%;
	overflow: hidden;
	border: 1px solid var(--neutral-200);
	border-radius: 16px;
	border-collapse: separate;
	border-spacing: 0;
	font-size: var(--fs-body-m);
	line-height: var(--lh-body-m);
}

.text-content__body tbody,
.text-content__body tr {
	display: block;
}

.text-content__body tr + tr {
	border-top: 1px solid var(--neutral-200);
}

.text-content__body tr {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 20px;
}

.text-content__body th {
	color: var(--neutral-500);
	font-weight: 400;
	text-align: left;
}

.text-content__body td {
	color: var(--neutral-900);
	font-weight: 500;
}

/* Sidebar card */
.text-content__aside {
	min-width: 0;
}

.text-content__card {
	padding: 20px 16px;
	border-radius: 16px;
	background: var(--neutral-50);
}

.text-content__card-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 12px;
	padding-inline: 12px;
	color: var(--neutral-500);
}

.text-content__links {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.text-content__links a {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 46px;
	padding: 10px 12px 10px 27px;
	border-radius: var(--radius-field);
	color: var(--neutral-600);
	font-size: var(--fs-body-m);
	line-height: var(--lh-body-m);
	text-decoration: none;
}

.text-content__links a::before {
	content: "";
	position: absolute;
	top: 13px;
	left: 12px;
	width: 3px;
	height: 20px;
	border-radius: 2px;
	background: transparent;
}

.text-content__links a:hover {
	color: var(--neutral-900);
}

.text-content__links a[aria-current] {
	background: var(--neutral-0);
	color: var(--neutral-900);
	font-weight: 500;
}

.text-content__links a[aria-current]::before {
	background: var(--red);
}

.text-content__links .menu-icon {
	--icon-px: 18;
	color: var(--neutral-500);
}

/* TOC box (details) */
.text-content__box {
	gap: 0;
	padding: 0;
	overflow: hidden;
	box-shadow: var(--shadow-card);
}

.text-content__box > .text-content__card-title,
.text-content__links a {
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
}

.text-content__box > .text-content__card-title {
	-webkit-user-select: none;
	user-select: none;
}

.text-content__box > .text-content__card-title {
	min-height: 56px;
	margin: 0;
	padding: 16px 28px;
	cursor: pointer;
	list-style: none;
}

.text-content__box > nav {
	max-height: calc(100svh - var(--header-h-mobile) - var(--admin-bar-h, 0px) - 96px);
	padding: 0 16px 16px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.text-content--toc .text-content__body h2,
.text-content--toc .text-content__body h3 {
	scroll-margin-top: calc(var(--header-h-mobile) + 84px);
}

.text-content__box > .text-content__card-title::-webkit-details-marker {
	display: none;
}

.text-content__box[open]:not(.is-closing) .text-content__chevron {
	transform: rotate(180deg);
}

.text-content__chevron {
	--icon-px: 18;
}

@media (prefers-reduced-motion: no-preference) {
	.text-content__chevron {
		transition: transform 200ms var(--ease);
	}
}

@media (min-width: 1024px) {
	.text-content__inner {
		display: grid;
		grid-template-columns: minmax(0, 896px) minmax(0, 440px);
		justify-content: space-between;
		column-gap: 104px;
	}

	.text-content__body {
		grid-column: 1;
		grid-row: 1;
	}

	.text-content__aside {
		margin: 0;
		padding-top: 0;
	}

	.text-content__aside::before {
		content: none;
	}

	.text-content__aside {
		grid-column: 2;
		grid-row: 1;
		position: sticky;
		top: calc(var(--header-h) + 24px + var(--admin-bar-h, 0px));
	}

	.text-content__card {
		padding: 28px 24px;
	}

	.text-content__body h2,
	.text-content__body h3 {
		scroll-margin-top: calc(var(--header-h) + 24px);
	}

	.text-content__body table {
		display: table;
	}

	.text-content__body tbody {
		display: table-row-group;
	}

	.text-content__body tr {
		display: table-row;
		padding: 0;
	}

	.text-content__body th,
	.text-content__body td {
		padding: 18px 24px;
		vertical-align: top;
	}

	.text-content__body th {
		width: 252px;
		white-space: nowrap;
	}

	.text-content__body tr + tr {
		border-top: 0;
	}

	.text-content__body tr + tr > * {
		border-top: 1px solid var(--neutral-200);
	}

	.text-content__box {
		padding: 28px 24px;
		overflow: visible;
		box-shadow: none;
	}

	.text-content__box > .text-content__card-title {
		min-height: 0;
		margin-bottom: 20px;
		padding: 0 12px;
		pointer-events: none;
		cursor: default;
	}

	.text-content__box > nav {
		max-height: none;
		padding: 0;
		overflow: visible;
	}

	.text-content--toc .text-content__body h2,
	.text-content--toc .text-content__body h3 {
		scroll-margin-top: calc(var(--header-h) + 24px);
	}

	.text-content__chevron {
		display: none;
	}
}
