.block-toc {
	border: 1px solid var(--wp--preset--color--foreground);
	padding: 0 16px 16px;
	--wp--style--block-gap: 42px;
}

.block-toc > *:first-child {
	margin-top: 0;
}

.block-toc > *:last-child {
	margin-bottom: 0;
}

.block-toc p.block-toc__title {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--foreground);
	display: inline-block;
	margin-bottom: 0;
	padding: 0 16px;
	transform: translateY(-14px);

	font-size: var(--wp--preset--font-size--normal);
	font-weight: 800;
	line-height: var(--wp--custom--line-height--small);
	letter-spacing: var(--wp--custom--letter-spacing--small);
	text-transform: uppercase;
}

.block-toc p.block-toc__title + p,
.block-toc h2:first-child + p,
.block-toc h3:first-child + p {
	margin-top: 0;
}

.block-toc ol {
	list-style-type: disc;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: var(--wp--custom--letter-spacing--medium);
	text-transform: uppercase;
	font-weight: 800;
}

.block-toc > .block-toc__toggle {
	background: var(--wp--preset--color--foreground);
	border: none;
	box-shadow: none;
	cursor: pointer;
	color: var(--wp--preset--color--background);
	display: block;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: var(--wp--custom--letter-spacing--small);
	text-transform: uppercase;
	padding: 13px;
	margin: 0 -16px -16px -16px;
	width: calc( 100% + 32px );
}

.block-toc__toggle svg {
	fill: #fff;
	transform: rotate(90deg);
	margin-left: 8px;
}

.block-toc--has-toggle:not(.active) ol *:nth-child(n+4) {
	display: none;
}

.block-toc--has-toggle.active > .block-toc__toggle {
	display: none;
}
