/* ============================
TOC — базовий контейнер
============================ */

.toc-container {
	padding-top: 20px;
	width: 300px;
}

#toc-container {
	font-family: Arial, sans-serif;
	font-size: 14px;
	line-height: 1.6;

	background-color: #f9f9f9;
	padding: 15px 20px;
	max-width: 300px;
	width: 100%;

	box-shadow: 0 1px 1px rgba(0,0,0,0.05);
	border-radius: 6px;

	/* Для CSS counters */
	counter-reset: h1;
}

/* Коли TOC повинен відкріпитись біля футера */
#toc-container.stop-pin {
	position: absolute !important;
	top: auto !important;
	bottom: 0 !important;
}


/* ============================
Нумерація (CSS counters)
============================ */

#toc-container .h1 {
	counter-increment: h1;
	counter-reset: h2;
	font-weight: bold;
}

#toc-container .h1 > a::before {
	content: counter(h1) ". ";
	font-weight: bold;
}

#toc-container .h2 {
	counter-increment: h2;
	counter-reset: h3;
	text-indent: 0.5in;
	margin-bottom: 4px;
}

#toc-container .h2 > a::before {
	content: counter(h1) "." counter(h2) " ";
}

#toc-container .h3 {
	counter-increment: h3;
	text-indent: 0.75in;
	margin-bottom: 3px;
	font-style: italic;
}

#toc-container .h3 > a::before {
	content: counter(h1) "." counter(h2) "." counter(h3) " ";
}


/* ============================
Відступи між секціями
============================ */

#toc-container .h1:not(:first-child) {
	margin-top: 10px;
	border-top: 1px solid #eee;
	padding-top: 8px;
}


/* ============================
Стилі посилань
============================ */

#toc-container a {
	color: #0077cc;
	text-decoration: none;
	display: block;
	transition: all 0.2s ease-in-out;
	font-weight: normal;      /* ← вирівняно, щоб не було жирних першого пункту */
}

#toc-container a:hover {
	text-decoration: underline;
	color: #005fa3;
}

#toc-container a.toc-link.active {
	color: #007bff;
	font-weight: bold;        /* Жирний лише для активного пункту */
	text-decoration: underline;
}


/* ============================
Accordion (розкриття рівнів)
============================ */

#toc-container .h2,
#toc-container .h3 {
	display: none;
}

#toc-container .h1.active + .h2,
#toc-container .h2.active + .h3 {
	display: block;
}
