/**
 * Sticky Table of Contents Styles
 * 
 * Styles for the sticky TOC sidebar including positioning,
 * navigation hierarchy, active states, and responsive behavior.
 */

/* Page Layout - Override parent theme to restore proper centering */
.ecohorbor-content-wrap.container.page.page-with-toc {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 15px;
	padding-right: 15px;
}

/* TOC Sidebar Container */
.toc-sidebar-wrapper {
	position: relative;
}

.toc-sticky-outer {
	position: relative;
}

.toc-sticky-head {
	background: #F2F8F2;
	padding: 48px 24px;
	transition: all 0.3s ease;
}

.toc-sticky-head.is-sticky {
	background: #F2F8F2;
}

/* TOC Content */
.toc-content {
	position: relative;
}

.toc-content .toc-title {
	margin: 0 0 16px 0;
	font-size: 18px;
	font-weight: 600;
	color: #262626;
	padding-bottom: 12px;
	border-bottom: 2px solid #549f57;
}

/* TOC Navigation List */
.toc-navigation {
	position: relative;
}

.toc-list {
	list-style: disc ;
	padding: 0;
	margin: 0;
	margin-left: 20px;
}

.toc-list li {
	margin-bottom: 0;
	line-height: 1.4;
	text-decoration: underline;
}

/* Heading Level 2 - Main sections */
.toc-list li.toc-level-2 {
	padding-left: 0;
	margin-bottom: 10px;
}

.toc-list li.toc-level-2 > a {
	font-size: 18px;
	font-weight: bold;
}

/* Heading Level 3 - Subsections */
.toc-list li.toc-level-3 {
	padding-left: 20px;
	margin-bottom: 8px;
}

.toc-list li.toc-level-3 > a {
	font-size: 16px;
	font-weight: 500;
}

/* TOC Links */
.toc-list a {
	color: #000000;
	text-decoration: underline;
	display: block;
	transition: all 0.2s ease;
	border-radius: 4px;
}

.toc-list a:hover {
	color: #549f57;
	text-decoration: none;
}

.toc-list a:focus {
	outline: 2px solid #549f57;
	outline-offset: 2px;
}

.toc-list a.active {
	color: #549f57;
	font-weight: 900;
	border-left-color: #549f57;
}

/* Active state for level 3 headings */
.toc-list li.toc-level-3 a.active {
	font-weight: 500;
}

/* Scrollbar styling for long TOC */
.toc-navigation {
	max-height: calc(100vh - 200px);
	overflow-y: auto;
	overflow-x: hidden;
}

.toc-navigation::-webkit-scrollbar {
	width: 6px;
}

.toc-navigation::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 3px;
}

.toc-navigation::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.toc-navigation::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Responsive Behavior */
@media (max-width: 991px) {
	.toc-sidebar-wrapper {
		margin-top: 30px;
	}
}

@media (max-width: 767px) {
	/* Non-sticky on mobile */
	.toc-sticky-head {
		position: relative !important;
		top: auto !important;
		width: auto !important;
	}
	
	.toc-sidebar-wrapper {
		margin-top: 30px;
		margin-bottom: 30px;
	}
	
	.toc-content .toc-title {
		font-size: 16px;
	}
	
	.toc-list li.toc-level-2 > a {
		font-size: 14px;
	}
	
	.toc-list li.toc-level-3 > a {
		font-size: 13px;
	}
	
	.toc-list li.toc-level-3 {
		padding-left: 16px;
	}
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
	.toc-sticky-head,
	.toc-list a {
		transition: none;
	}
}

/* Print styles - show TOC but not sticky */
@media print {
	.toc-sticky-head {
		position: relative !important;
		top: auto !important;
		width: auto !important;
		box-shadow: none !important;
		border: 1px solid #cccccc;
	}
	
	.toc-list a {
		color: #000000;
	}
	
	.toc-list a.active {
		background: transparent;
		border-left-color: #000000;
	}
}
