/**
 * Table of Contents Styles
 */
.elementic-toc {
	margin: 30px 0;
	padding: 25px;
	background: #f9f9f9;
	border-left: 4px solid var(--elementic-primary-color, #ff8c00);
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.toc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 20px;
	padding-bottom: 15px;
	border-bottom: 2px solid #e0e0e0;
}

.toc-title {
	margin: 0;
	font-size: 20px;
	color: #333;
}

.toc-toggle {
	background: transparent;
	border: none;
	font-size: 18px;
	color: var(--elementic-primary-color, #ff8c00);
	cursor: pointer;
	padding: 5px;
	transition: transform 0.3s ease;
}

.toc-toggle:hover,
.toc-toggle:focus {
	transform: scale(1.1);
}

.toc-collapsed .toc-toggle i {
	transform: rotate(180deg);
}

.toc-content {
	max-height: 500px;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.toc-collapsed .toc-content {
	max-height: 0;
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
	counter-reset: toc-counter;
}

.toc-item {
	counter-increment: toc-counter;
	margin-bottom: 10px;
	position: relative;
}

.toc-item::before {
	content: counter(toc-counter) ". ";
	color: var(--elementic-primary-color, #ff8c00);
	font-weight: 600;
	margin-right: 5px;
}

.toc-link {
	color: #333;
	text-decoration: none;
	transition: color 0.3s ease;
	display: inline-block;
	padding: 5px 0;
}

.toc-link:hover,
.toc-link:focus {
	color: var(--elementic-primary-color, #ff8c00);
	padding-left: 5px;
}

.toc-link.active {
	color: var(--elementic-primary-color, #ff8c00);
	font-weight: 600;
}

.toc-sublist {
	list-style: none;
	padding-left: 25px;
	margin-top: 10px;
	counter-reset: toc-subcounter;
}

.toc-sublist .toc-item {
	counter-increment: toc-subcounter;
}

.toc-sublist .toc-item::before {
	content: counter(toc-counter) "." counter(toc-subcounter) " ";
}

.toc-level-h2 {
	font-size: 15px;
	font-weight: 600;
}

.toc-level-h3 {
	font-size: 14px;
}

.toc-level-h4,
.toc-level-h5,
.toc-level-h6 {
	font-size: 13px;
}

/* Smooth scroll */
html {
	scroll-behavior: smooth;
}

/* Target heading highlight */
:target {
	scroll-margin-top: 100px;
}

@media screen and (max-width: 768px) {
	.elementic-toc {
		padding: 20px;
	}

	.toc-title {
		font-size: 18px;
	}
}
