/* =====================================================
   Left Sidebar Navigation - KnowHow Theme
   Wiki-style vertical accordion sidebar
   ===================================================== */

/* --- Left Sidebar Container --- */
#left-sidebar-nav {
	position: fixed;
	top: 0;
	left: 0;
	width: 240px;
	height: 100vh;
	background: #f5f6f8;
	z-index: 9998;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
	border-right: 1px solid #e0e2e5;
}

/* --- Scrollbar Styling --- */
#left-sidebar-nav::-webkit-scrollbar {
	width: 4px;
}
#left-sidebar-nav::-webkit-scrollbar-track {
	background: transparent;
}
#left-sidebar-nav::-webkit-scrollbar-thumb {
	background: #c5c8cc;
	border-radius: 2px;
}
#left-sidebar-nav::-webkit-scrollbar-thumb:hover {
	background: #a0a4a8;
}

/* --- Sidebar Header --- */
.left-nav-header {
	padding: 16px 16px 12px;
	border-bottom: 1px solid #e0e2e5;
	text-align: right;
}

.left-nav-title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #6b7280;
}

/* --- Navigation List --- */
.left-nav-menu {
	padding: 8px 0 24px;
}

.left-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.left-nav-list li {
	margin: 0;
	padding: 0;
}

/* --- Top-Level Items (no children) --- */
.left-nav-list > li > a {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	text-align: right;
	padding: 8px 14px;
	color: #374151;
	text-decoration: none;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	transition: background 0.12s ease, color 0.12s ease;
	position: relative;
	border-left: 3px solid transparent;
}

.left-nav-list > li > a:hover {
	background: #e8eaed;
	color: #111827;
}

.left-nav-list > li.current-menu-item > a,
.left-nav-list > li.current-menu-parent > a,
.left-nav-list > li.current-menu-ancestor > a {
	background: #e2e4e8;
	color: #a03717;
	border-left-color: #a03717;
	font-weight: 600;
}

/* --- Menu Item Icons --- */
.nav-item-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-right: 8px;
	margin-left: 0;
	font-size: 13px;
	color: #9ca3af;
	flex-shrink: 0;
	order: -1;
	transition: color 0.12s ease;
}

.left-nav-list > li > a:hover .nav-item-icon {
	color: #6b7280;
}

.left-nav-list > li.current-menu-item > a .nav-item-icon,
.left-nav-list > li.current-menu-parent > a .nav-item-icon,
.left-nav-list > li.current-menu-ancestor > a .nav-item-icon {
	color: #a03717;
}

/* --- Section Headers (items with sub-menus) --- */
.left-nav-list > li.has-children > a {
	cursor: pointer;
}

.left-nav-list > li.has-children > a:after {
	content: '';
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%) rotate(-90deg);
	width: 0;
	height: 0;
	border-left: 4px solid #9ca3af;
	border-top: 3px solid transparent;
	border-bottom: 3px solid transparent;
	transition: transform 0.25s ease;
}

.left-nav-list > li.has-children.open > a:after {
	transform: translateY(-50%) rotate(0deg);
}

.left-nav-list > li.has-children.current-menu-parent > a:after,
.left-nav-list > li.has-children.current-menu-ancestor > a:after {
	border-left-color: #a03717;
}

/* --- Section Divider Lines --- */
.left-nav-list > li.nav-section {
	margin: 8px 14px 4px;
	padding-top: 8px;
	border-top: 1px solid #e0e2e5;
}

.left-nav-list > li.nav-section > a {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #9ca3af;
	padding: 4px 0;
	border-left: none;
	pointer-events: none;
}

.left-nav-list > li.nav-section > a:hover {
	background: transparent;
}

.left-nav-list > li.nav-section:first-child {
	border-top: none;
	margin-top: 0;
	padding-top: 0;
}

/* --- Sub Menus (Accordion Style) --- */
.left-nav-list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-nav-list .sub-menu.expanded {
	max-height: 800px;
}

.left-nav-list .sub-menu li a {
	display: block;
	padding: 6px 14px 6px 32px;
	color: #4b5563;
	text-decoration: none;
	font-size: 12.5px;
	line-height: 1.5;
	transition: background 0.12s ease, color 0.12s ease;
	position: relative;
	text-align: right;
}

.left-nav-list .sub-menu li a:before {
	content: '';
	position: absolute;
	left: 18px;
	top: 50%;
	transform: translateY(-50%);
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #d1d5db;
	transition: background 0.12s ease;
}

.left-nav-list .sub-menu li a:hover {
	background: #e8eaed;
	color: #111827;
}

.left-nav-list .sub-menu li a:hover:before {
	background: #6b7280;
}

.left-nav-list .sub-menu li.current-menu-item a,
.left-nav-list .sub-menu li.current-menu-parent a,
.left-nav-list .sub-menu li.current-menu-ancestor a {
	color: #a03717;
	font-weight: 600;
	background: rgba(160, 55, 23, 0.06);
}

.left-nav-list .sub-menu li.current-menu-item a:before,
.left-nav-list .sub-menu li.current-menu-parent a:before,
.left-nav-list .sub-menu li.current-menu-ancestor a:before {
	background: #a03717;
}

/* --- Deep Sub Menus (3rd level) --- */
.left-nav-list .sub-menu .sub-menu li a {
	padding-left: 44px;
	font-size: 12px;
}

.left-nav-list .sub-menu .sub-menu li a:before {
	left: 30px;
}

/* --- Body Offset for Left Sidebar --- */
body.left-nav-active #site-container {
	margin-left: 240px;
	transition: margin-left 0.3s ease;
}

/* --- Hamburger (hidden on desktop) --- */
.left-nav-mobile-trigger {
	display: none;
}

/* --- Mobile: Hidden by default --- */
@media (max-width: 768px) {
	#left-sidebar-nav {
		width: 260px;
		left: -260px;
		visibility: hidden;
		opacity: 0;
		transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.3s, opacity 0.3s ease;
		border-right: none;
		box-shadow: none;
	}

	#left-sidebar-nav.mobile-open {
		left: 0;
		visibility: visible;
		opacity: 1;
		box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
		transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0s, opacity 0.3s ease;
	}

	body.left-nav-active #site-container {
		margin-left: 0;
	}

	/* Hamburger trigger on mobile */
	.left-nav-mobile-trigger {
		display: flex !important;
		position: fixed;
		top: 12px;
		left: 12px;
		z-index: 9999;
		width: 40px;
		height: 40px;
		background: #ffffff;
		border: 1px solid #e0e2e5;
		border-radius: 8px;
		cursor: pointer;
		align-items: center;
		justify-content: center;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
		transition: background 0.15s ease;
	}

	.left-nav-mobile-trigger:hover {
		background: #f0f1f3;
	}

	.left-nav-mobile-trigger .toggle-icon {
		color: #374151;
		font-size: 18px;
	}
}

@media (max-width: 480px) {
	#left-sidebar-nav {
		width: 85vw;
		left: -85vw;
	}

	#left-sidebar-nav.mobile-open {
		left: 0;
	}
}

/* --- Mobile overlay --- */
.left-nav-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.4);
	z-index: 9997;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.left-nav-overlay.active {
	opacity: 1;
}

/* --- Desktop: always show sidebar content --- */
@media (min-width: 769px) {
	.left-nav-overlay {
		display: none !important;
	}
}
