/* Template-2 — templates/Template-2/table-of-content */

/* Как в base.css для #toc_container: тема ожидает те же правила для оглавления с site-theme */
.t2-toc-block {
	box-sizing: border-box;
	margin: 11px auto 21px;
	max-width: var(--t2-container-width, 1260px);
	width: 100%;
}

.t2-toc-block .toc,
.t2-toc-block__container {
	box-sizing: border-box;
	max-width: 100%;
	width: 100%;
}

.site-theme .text_container > .t2-toc-block,
.site-theme .text_container .t2-toc-block {
	margin-inline: 0;
	max-width: 100%;
}

.site-theme .text_container .t2-toc-block > .container,
.site-theme .text_container .t2-toc-block__container {
	padding-inline: 0;
}

.t2-toc-block #toc_container {
	max-width: 100%;
	box-sizing: border-box;
}

.site-theme.t2-toc-block #toc_container {
	overflow: hidden;
	position: relative;
	transition: height 0.35s ease-out;
}

.site-theme.t2-toc-block .ctoc-body {
	display: block;
}

/* Mobile: collapsed preview + expand button (all variants). */
@media only screen and (max-width: 767px) {
	.t2-toc-block.site-theme:not(.active):not(.is-expanded) #toc_container {
		height: 140px;
	}

	.t2-toc-block.site-theme:not(.active):not(.is-expanded) #toc_container::before {
		background: linear-gradient(0deg, #000000, #000000 10%, rgba(0, 0, 0, 0));
		bottom: 0;
		content: "";
		display: block;
		height: 60px;
		left: 0;
		pointer-events: none;
		position: absolute;
		width: 100%;
		z-index: 1;
	}

	.t2-toc-block.site-theme.active #toc_container,
	.t2-toc-block.site-theme.is-expanded #toc_container {
		height: auto;
	}

	.t2-toc-block.site-theme.active #toc_container::before,
	.t2-toc-block.site-theme.is-expanded #toc_container::before {
		content: none;
		display: none;
	}

	.t2-toc-block--empty .t2-toc-expand {
		display: none;
	}
}

.t2-toc-expand {
	display: none;
	margin-bottom: 20px;
	padding: 20px;
	text-align: center;
}

@media only screen and (max-width: 767px) {
	.t2-toc-block .t2-toc-expand {
		display: block;
	}
}

.t2-toc-expand__btn {
	background: transparent;
	border: 0;
	color: var(--container-text-color, #ffffff);
	cursor: pointer;
	font: inherit;
	padding: 0 28px;
	position: relative;
}

.t2-toc-expand__btn::before,
.t2-toc-expand__btn::after {
	border-bottom: 1px solid currentColor;
	border-left: 1px solid currentColor;
	bottom: 7px;
	content: "";
	display: block;
	height: 7px;
	left: 0;
	position: absolute;
	transform: rotate(-45deg);
	transition: transform 0.25s ease;
	width: 7px;
}

.t2-toc-expand__btn::after {
	left: auto;
	right: 0;
}

.t2-toc-expand__btn.active::before,
.t2-toc-expand__btn.active::after {
	transform: rotate(135deg);
}

.site-theme.t2-toc-block #toc_container .ctoc-toggle {
	display: none;
	max-height: 36px;
}

.site-theme.t2-toc-block #toc_container .ctoc.is-open .ctoc-body {
	display: block;
}

.site-theme.t2-toc-block #toc_container ul {
	display: flex;
	flex-flow: wrap;
	gap: 10px;
	justify-content: center;
	list-style-type: none;
	margin: 0;
	padding: 0;
}

@media only screen and (max-width: 575px) {
	.site-theme.t2-toc-block #toc_container ul li {
		width: 100%;
	}
}

.site-theme.t2-toc-block #toc_container ul li {
	background-color: var(--toc-background-color);
	border-radius: 8px;
	cursor: pointer;
	margin-bottom: 0;
	padding: 0;
}

.site-theme.t2-toc-block #toc_container ul li:before {
	content: none;
}

.site-theme.t2-toc-block #toc_container ul li:hover {
	background-color: var(--toc-background-hover-color);
}

.site-theme.t2-toc-block #toc_container ul li:hover a {
	color: var(--toc-link-hover-color);
}

.site-theme.t2-toc-block #toc_container ul li a {
	box-sizing: border-box;
	color: var(--toc-link-color);
	display: block;
	font-size: 13px;
	font-weight: 400;
	padding: 8px 20px 10px;
	text-decoration: none;
}

.site-theme.t2-toc-block #toc_container ul li a:hover {
	text-decoration: none;
}

.t2-toc-block:not(.site-theme) #toc_container .ctoc-toggle {
	box-sizing: border-box;
	cursor: pointer;
	display: block;
	padding: 12px 16px;
	text-align: left;
	width: 100%;
}

.t2-toc-block--toc-6 .toc {
	max-width: 100%;
	margin: 11px 0 21px;
}

/* toc-1 / toc-2 / toc-5 — 4 pills + 1 centered below. */
.t2-toc-block--toc-1.site-theme #toc_container ul,
.t2-toc-block--toc-2.site-theme #toc_container ul,
.t2-toc-block--toc-5.site-theme #toc_container ul {
	align-items: stretch;
	display: flex;
	flex-flow: row wrap;
	gap: 10px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.t2-toc-block--toc-1.site-theme #toc_container ul li,
.t2-toc-block--toc-1.site-theme #toc_container ul li:first-child,
.t2-toc-block--toc-2.site-theme #toc_container ul li,
.t2-toc-block--toc-2.site-theme #toc_container ul li:first-child,
.t2-toc-block--toc-5.site-theme #toc_container ul li,
.t2-toc-block--toc-5.site-theme #toc_container ul li:first-child {
	background-color: var(--toc-background-color, #1a1a1a);
	border-radius: 8px;
	box-sizing: border-box;
	display: block;
	flex: 0 1 auto;
	margin: 0;
	max-width: 100%;
	padding: 0;
	width: auto;
}

.t2-toc-block--toc-1.site-theme #toc_container ul li:before,
.t2-toc-block--toc-2.site-theme #toc_container ul li:before,
.t2-toc-block--toc-5.site-theme #toc_container ul li:before {
	content: none;
}

.t2-toc-block--toc-1.site-theme #toc_container ul li a,
.t2-toc-block--toc-1.site-theme #toc_container ul li:first-child a,
.t2-toc-block--toc-2.site-theme #toc_container ul li a,
.t2-toc-block--toc-2.site-theme #toc_container ul li:first-child a,
.t2-toc-block--toc-5.site-theme #toc_container ul li a,
.t2-toc-block--toc-5.site-theme #toc_container ul li:first-child a {
	background-color: transparent;
	border-radius: inherit;
	box-sizing: border-box;
	color: var(--toc-link-color, #ffffff);
	display: block;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.25;
	padding: 8px 16px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
}

.t2-toc-block--toc-1.site-theme #toc_container ul li:hover,
.t2-toc-block--toc-1.site-theme #toc_container ul li:first-child:hover,
.t2-toc-block--toc-2.site-theme #toc_container ul li:hover,
.t2-toc-block--toc-2.site-theme #toc_container ul li:first-child:hover,
.t2-toc-block--toc-5.site-theme #toc_container ul li:hover,
.t2-toc-block--toc-5.site-theme #toc_container ul li:first-child:hover {
	background-color: var(--toc-background-hover-color, #fce043);
}

.t2-toc-block--toc-1.site-theme #toc_container ul li:hover a,
.t2-toc-block--toc-1.site-theme #toc_container ul li:first-child:hover a,
.t2-toc-block--toc-2.site-theme #toc_container ul li:hover a,
.t2-toc-block--toc-2.site-theme #toc_container ul li:first-child:hover a,
.t2-toc-block--toc-5.site-theme #toc_container ul li:hover a,
.t2-toc-block--toc-5.site-theme #toc_container ul li:first-child:hover a {
	color: var(--toc-link-hover-color, #000000);
}

.t2-toc-block--toc-1.site-theme #toc_container.toc--lead-last ul li:last-child,
.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul li:last-child,
.t2-toc-block--toc-5.site-theme #toc_container.toc--lead-last ul li:last-child {
	background: transparent;
	display: flex;
	flex: 0 0 100%;
	justify-content: center;
	padding: 0;
	width: 100%;
}

.t2-toc-block--toc-1.site-theme #toc_container.toc--lead-last ul li:last-child a,
.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul li:last-child a,
.t2-toc-block--toc-5.site-theme #toc_container.toc--lead-last ul li:last-child a {
	background-color: var(--toc-background-color, #1a1a1a);
	border-radius: 8px;
	box-sizing: border-box;
	display: block;
	margin-inline: auto;
	max-width: 100%;
	padding: 8px 20px 9px;
	width: fit-content;
}

.t2-toc-block--toc-1.site-theme #toc_container.toc--lead-last ul li:last-child:hover,
.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul li:last-child:hover,
.t2-toc-block--toc-5.site-theme #toc_container.toc--lead-last ul li:last-child:hover {
	background: transparent;
}

.t2-toc-block--toc-1.site-theme #toc_container.toc--lead-last ul li:last-child:hover a,
.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul li:last-child:hover a,
.t2-toc-block--toc-5.site-theme #toc_container.toc--lead-last ul li:last-child:hover a {
	background-color: var(--toc-background-hover-color, #fce043);
	color: var(--toc-link-hover-color, #000000);
}

@media only screen and (min-width: 768px) {
	.t2-toc-block--toc-1.site-theme #toc_container.toc--lead-last ul,
	.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul,
	.t2-toc-block--toc-5.site-theme #toc_container.toc--lead-last ul {
		flex-flow: row wrap;
	}
}

@media only screen and (max-width: 767px) {
	.t2-toc-block--toc-6.site-theme #toc_container ul::after {
		content: none;
		display: none;
	}

	.t2-toc-block--toc-1.site-theme #toc_container ul,
	.t2-toc-block--toc-2.site-theme #toc_container ul,
	.t2-toc-block--toc-5.site-theme #toc_container ul {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 8px;
	}

	.t2-toc-block--toc-1.site-theme #toc_container ul li,
	.t2-toc-block--toc-1.site-theme #toc_container ul li:first-child,
	.t2-toc-block--toc-1.site-theme #toc_container.toc--lead-last ul li:last-child,
	.t2-toc-block--toc-2.site-theme #toc_container ul li,
	.t2-toc-block--toc-2.site-theme #toc_container ul li:first-child,
	.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul li:last-child,
	.t2-toc-block--toc-5.site-theme #toc_container ul li,
	.t2-toc-block--toc-5.site-theme #toc_container ul li:first-child,
	.t2-toc-block--toc-5.site-theme #toc_container.toc--lead-last ul li:last-child {
		display: block;
		flex: 0 0 auto;
		padding: 0;
		width: 100%;
	}

	.t2-toc-block--toc-1.site-theme #toc_container ul li a,
	.t2-toc-block--toc-1.site-theme #toc_container ul li:first-child a,
	.t2-toc-block--toc-2.site-theme #toc_container ul li a,
	.t2-toc-block--toc-2.site-theme #toc_container ul li:first-child a,
	.t2-toc-block--toc-5.site-theme #toc_container ul li a,
	.t2-toc-block--toc-5.site-theme #toc_container ul li:first-child a {
		display: block;
		padding: 8px 16px;
		text-align: center;
		width: 100%;
	}

	.t2-toc-block--toc-1.site-theme #toc_container.toc--lead-last ul li:last-child a,
	.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul li:last-child a,
	.t2-toc-block--toc-5.site-theme #toc_container.toc--lead-last ul li:last-child a {
		margin-inline: auto;
		width: fit-content;
		max-width: 100%;
	}
}

/* toc-2 — uppercase labels (ref: table-of-content-2). */
.t2-toc-block--toc-2.site-theme #toc_container ul li a,
.t2-toc-block--toc-2.site-theme #toc_container ul li:first-child a,
.t2-toc-block--toc-2.site-theme #toc_container.toc--lead-last ul li:last-child a {
	font-size: 12.5px;
	text-transform: uppercase;
}

/* toc-3 / toc-4 — ref: table-of-content-3 & -4 (1 centered top + 4 pills below). */
.t2-toc-block--toc-3.site-theme #toc_container,
.t2-toc-block--toc-4.site-theme #toc_container {
	box-sizing: border-box;
	max-width: 100%;
	overflow: hidden;
	width: 100%;
}

@media only screen and (min-width: 768px) {
	.t2-toc-block--toc-3.site-theme #toc_container,
	.t2-toc-block--toc-4.site-theme #toc_container {
		height: auto !important;
		overflow: visible;
	}
}

.t2-toc-block--toc-3.site-theme #toc_container ul,
.t2-toc-block--toc-4.site-theme #toc_container ul {
	align-items: stretch;
	display: flex;
	flex-flow: row wrap;
	gap: 10px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:before,
.t2-toc-block--toc-4.site-theme #toc_container ul li:before {
	content: none;
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child,
.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child {
	background: transparent;
	display: flex;
	flex: 0 0 100%;
	justify-content: center;
	margin: 0;
	max-width: 100%;
	padding: 0;
	width: 100%;
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child a,
.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child a {
	background-color: var(--toc-background-color, #1a1a1a);
	border-radius: 8px;
	box-sizing: border-box;
	color: var(--toc-link-color, #ffffff);
	display: block;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.15;
	margin-inline: auto;
	max-width: 100%;
	padding: 8px 20px 9px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	width: fit-content;
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child:hover,
.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child:hover {
	background: transparent;
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child:hover a,
.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child:hover a {
	background-color: var(--toc-background-hover-color, #fce043);
	color: var(--toc-link-hover-color, #000000);
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:not(:first-child),
.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child) {
	background-color: var(--toc-background-color, #1a1a1a);
	border-radius: 8px;
	box-sizing: border-box;
	display: block;
	flex: 0 1 auto;
	margin: 0;
	max-width: 100%;
	padding: 0;
	width: auto;
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:not(:first-child) a,
.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child) a {
	background-color: transparent;
	border-radius: inherit;
	box-sizing: border-box;
	color: var(--toc-link-color, #ffffff);
	display: block;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.15;
	padding: 8px 16px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:not(:first-child):hover,
.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child):hover {
	background-color: var(--toc-background-hover-color, #fce043);
}

.t2-toc-block--toc-3.site-theme #toc_container ul li:not(:first-child):hover a,
.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child):hover a {
	color: var(--toc-link-hover-color, #000000);
}

/* toc-4 — typography (Figma: lead ExtraLight 275 uppercase, row Bold 700). */
.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child a {
	font-weight: 275;
	text-transform: uppercase;
}

.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child) a {
	font-weight: 700;
}

@media only screen and (max-width: 767px) {
	.t2-toc-block--toc-3.site-theme #toc_container ul,
	.t2-toc-block--toc-4.site-theme #toc_container ul {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 8px;
	}

	.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child,
	.t2-toc-block--toc-3.site-theme #toc_container ul li:not(:first-child),
	.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child,
	.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child) {
		display: block;
		flex: 0 0 auto;
		padding: 0;
		width: 100%;
	}

	.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child,
	.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child {
		background-color: var(--toc-background-color, #1a1a1a);
	}

	.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child a,
	.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child a {
		background-color: transparent;
		display: block;
		margin-inline: 0;
		max-width: 100%;
		padding: 8px 16px;
		text-align: center;
		width: 100%;
	}

	.t2-toc-block--toc-3.site-theme #toc_container ul li:not(:first-child),
	.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child) {
		padding: 0;
		width: 100%;
	}

	.t2-toc-block--toc-3.site-theme #toc_container ul li:not(:first-child) a,
	.t2-toc-block--toc-4.site-theme #toc_container ul li:not(:first-child) a {
		display: block;
		padding: 8px 16px;
		text-align: center;
		width: 100%;
	}

	.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child:hover,
	.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child:hover {
		background-color: var(--toc-background-hover-color, #fce043);
	}

	.t2-toc-block--toc-3.site-theme #toc_container ul li:first-child:hover a,
	.t2-toc-block--toc-4.site-theme #toc_container ul li:first-child:hover a {
		background-color: transparent;
		color: var(--toc-link-hover-color, #000000);
	}
}

/* toc-5 — same layout as toc-1, typography black 900. */
.t2-toc-block--toc-5 #toc_container ul li a,
.t2-toc-block--toc-5 #toc_container ul li:first-child a,
.t2-toc-block--toc-5 #toc_container.toc--lead-last ul li:last-child a {
	font-weight: 900 !important;
}

/* toc-6 */
.t2-toc-block--toc-6.site-theme #toc_container ul {
	align-items: stretch;
	display: flex;
	flex-flow: row wrap;
	column-gap: 10px;
	row-gap: 5px;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.t2-toc-block--toc-6.site-theme #toc_container ul li {
	background-color: var(--toc-background-color, #1a1a1a);
	border-radius: 8px;
	box-sizing: border-box;
	display: block;
	flex: 0 0 auto;
	margin: 0;
	max-width: none;
	padding: 0;
	width: auto;
}

.t2-toc-block--toc-6.site-theme #toc_container ul li:before {
	content: none;
}

.t2-toc-block--toc-6.site-theme #toc_container ul li a {
	background-color: transparent;
	border-radius: inherit;
	box-sizing: border-box;
	color: var(--toc-link-color, #ffffff);
	display: block;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.25;
	padding: 8px 20px 10px;
	text-align: center;
	text-decoration: none;
	white-space: normal;
}

.t2-toc-block--toc-6.site-theme #toc_container ul li:hover {
	background-color: var(--toc-background-hover-color, #fce043);
}

.t2-toc-block--toc-6 #toc_container ul li:hover a {
	color: var(--toc-link-hover-color, #000000);
}

@media only screen and (min-width: 768px) {
	/* Force layout: 3 items on first row, 2 items on second row (centered). */
	.t2-toc-block--toc-6.site-theme #toc_container ul::after {
		content: "";
		flex: 0 0 100%;
		height: 0;
		order: 4; /* line break after 3rd item */
	}

	/* Ensure stable ordering and line break placement. */
	.t2-toc-block--toc-6.site-theme #toc_container ul li:nth-child(1) { order: 1; }
	.t2-toc-block--toc-6.site-theme #toc_container ul li:nth-child(2) { order: 2; }
	.t2-toc-block--toc-6.site-theme #toc_container ul li:nth-child(3) { order: 3; }
	.t2-toc-block--toc-6.site-theme #toc_container ul li:nth-child(4) { order: 5; }
	.t2-toc-block--toc-6.site-theme #toc_container ul li:nth-child(5) { order: 6; }
}

@media only screen and (max-width: 767px) {
	.t2-toc-block--toc-6.site-theme #toc_container ul {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 8px;
	}

	.t2-toc-block--toc-6.site-theme #toc_container ul li {
		flex: 0 0 auto;
		width: 100%;
	}

	.t2-toc-block--toc-6.site-theme #toc_container ul li a {
		padding: 8px 20px 10px;
		width: 100%;
	}
}

/* Full pill is the link hit target (padding on <a>, not width:100% on lead rows). */
.site-theme.t2-toc-block #toc_container .ctoc-body ul li > a {
	border-radius: inherit;
	box-sizing: border-box;
	display: block;
}

.site-theme.t2-toc-block #toc_container.toc--lead-first .ctoc-body ul li:first-child > a,
.site-theme.t2-toc-block #toc_container.toc--lead-last .ctoc-body ul li:last-child > a {
	margin-inline: auto;
	max-width: 100%;
	width: fit-content;
}

.site-theme.t2-toc-block #toc_container .ctoc-body ul li > a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media only screen and (max-width: 767px) {
	.site-theme.t2-toc-block #toc_container .ctoc-body ul li > a {
		width: 100%;
	}

	.site-theme.t2-toc-block #toc_container.toc--lead-first .ctoc-body ul li:first-child > a,
	.site-theme.t2-toc-block #toc_container.toc--lead-last .ctoc-body ul li:last-child > a {
		margin-inline: 0;
		width: 100%;
	}
}

