/*
 * Table of Contents widget / shortcode.
 */

.sg-toc {
	--sg-toc-title-gap: 16px;
	--sg-toc-item-gap: 14px;
	--sg-toc-indent: 14px;
	--sg-toc-indicator: #2f6fed;
	--sg-toc-indicator-width: 3px;
	--sg-toc-indicator-radius: 2px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #e5e7eb;
	padding: 24px;
}

.sg-toc *,
.sg-toc *::before,
.sg-toc *::after {
	box-sizing: border-box;
}

.sg-toc.is-empty.sg-toc--hide-empty {
	display: none;
}

.sg-toc__title {
	margin: 0 0 var(--sg-toc-title-gap);
	color: #111827;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.3;
	text-transform: uppercase;
}

.sg-toc__list {
	display: flex;
	flex-direction: column;
	gap: var(--sg-toc-item-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.sg-toc__item {
	position: relative;
	margin: 0;
	padding: 0 0 0 var(--sg-toc-indent);
}

.sg-toc__item::before {
	content: "";
	position: absolute;
	top: 0.15em;
	bottom: 0.15em;
	left: -33px;
	width: var(--sg-toc-indicator-width);
	border-radius: var(--sg-toc-indicator-radius);
	background: transparent;
	transition: background-color 150ms ease;
}

.sg-toc__item.is-active::before {
	background: var(--sg-toc-indicator);
}

.sg-toc__link {
	display: inline-block;
	color: #111827;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.45;
	text-decoration: none;
	transition: color 150ms ease, font-weight 150ms ease;
}

.sg-toc__link:hover,
.sg-toc__link:focus {
	outline: none;
	text-decoration: none;
}

.sg-toc__item.is-active .sg-toc__link {
	font-weight: 600;
}

.sg-toc__item--h3,
.sg-toc__item--h4,
.sg-toc__item--h5,
.sg-toc__item--h6 {
	padding-left: 0;
}

.sg-toc__item--h3::before,
.sg-toc__item--h4::before,
.sg-toc__item--h5::before,
.sg-toc__item--h6::before {
	left: -33px;
}

@media (max-width: 1200px) {

	.sg-toc__item::before {
		left: -21px;
	}
}