.ngaze-toc {
	box-sizing: border-box;
	width: 100%;
	padding: 0;
	color: inherit;
}

.ngaze-toc__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 0;
	padding-bottom: 0.55rem;
	border-bottom: 1px solid rgba(15, 23, 42, 0.16);
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.35;
}

summary.ngaze-toc__title {
	cursor: pointer;
	list-style: none;
}

summary.ngaze-toc__title::-webkit-details-marker {
	display: none;
}

summary.ngaze-toc__title::after {
	width: 0.5rem;
	height: 0.5rem;
	content: "";
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 160ms ease;
}

.ngaze-toc__details[open] > summary.ngaze-toc__title::after {
	transform: rotate(225deg);
}

.ngaze-toc__list {
	margin: 0.7rem 0 0;
	padding-left: 1.1rem;
	list-style: square;
}

.ngaze-toc__item {
	margin: 0 0 0 calc(var(--ngaze-toc-depth, 0) * 0.8rem);
	padding: 0 0 0.4rem;
	font-size: 0.825rem;
	line-height: 1.4;
}

.ngaze-toc__item::marker {
	color: #d8534e;
	font-size: 0.85em;
}

.ngaze-toc__item:last-child {
	padding-bottom: 0;
}

.ngaze-toc__link {
	color: inherit;
	text-decoration: none;
	text-underline-offset: 0.16em;
}

.ngaze-toc__link:hover,
.ngaze-toc__link:focus-visible {
	text-decoration: underline;
}

[data-ngaze-toc-heading] {
	scroll-margin-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
	summary.ngaze-toc__title::after {
		transition: none;
	}
}
