/*! Table of Contents widget (v1.0.0) */

.avd-toc--aside {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px;
	border: 1px solid var(--avd-border);
	border-radius: 20px;
	background: var(--avd-gray);
}

.avd-toc--aside.is-sticky {
	position: sticky;
	top: calc(var(--toc-top, 24px) + var(--wp-admin--admin-bar--height, 0px));
	max-height: calc(100vh - var(--toc-top, 24px) - 24px);
	overflow-y: auto;
}

/* Inside the theme's sticky aside the column itself sticks. */
.avd-post-aside .avd-toc--aside.is-sticky {
	position: static;
	max-height: none;
}

.avd-toc__title {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--avd-text-muted);
}

.avd-toc__list {
	display: flex;
	flex-direction: column;
}

.avd-toc__link {
	display: block;
	padding: 8px 0 8px 16px;
	border-left: 2px solid var(--avd-border);
	font-size: 15px;
	line-height: 1.4;
	color: var(--avd-text-muted);
	text-decoration: none;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.avd-toc__link.is-sub {
	padding-left: 30px;
	font-size: 14px;
}

.avd-toc__link:hover {
	color: var(--avd-text);
}

.avd-toc__link[aria-current="true"] {
	border-left-color: var(--avd-blue);
	font-weight: 600;
	color: var(--avd-text);
}

/* Dropdown */
.avd-toc--mobile {
	margin: 0 0 28px;
	border: 1px solid var(--avd-border);
	border-radius: 16px;
	background: var(--avd-gray);
}

.avd-toc__summary {
	min-height: 52px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 18px;
	font-size: 16px;
	font-weight: 600;
	color: var(--avd-text);
	cursor: pointer;
	list-style: none;
}

.avd-toc__summary::-webkit-details-marker {
	display: none;
}

.avd-toc__summary .ico {
	transition: transform 0.2s ease;
}

.avd-toc--mobile[open] .avd-toc__summary .ico {
	transform: rotate(180deg);
}

.avd-toc--mobile .avd-toc__list {
	padding: 0 18px 14px;
}

.avd-toc--mobile .avd-toc__link {
	padding: 8px 0;
	border-left: 0;
	font-size: 16px;
	color: var(--avd-text-body);
}

.avd-toc--mobile .avd-toc__link.is-sub {
	padding-left: 16px;
	font-size: 15px;
}

/* Paired: sidebar on desktop, dropdown on mobile */
.avd-toc--mobile.is-paired {
	display: none;
}

@media (max-width: 1080px) {
	.avd-toc--mobile.is-paired {
		display: block;
	}

	.avd-toc--aside.is-paired {
		display: none;
	}
}

/* The theme prints the mobile dropdown inside the article: only show it on small screens. */
.avd-prose > .avd-toc--mobile {
	display: none;
}

@media (max-width: 1080px) {
	.avd-prose > .avd-toc--mobile {
		display: block;
	}
}
