/* ============================================
   Single Post Page Structure
   ============================================ */

/* Remove default site-content padding for single posts */
.single-post .site-content {
	padding-top: 0;
}

/* Fix overflow issues */
.single-post {
	overflow-x: hidden;
}

/* Main Container */
.single-post-main {
	background: #fff;
	padding-top: 0;
	padding-bottom: 60px;
}

/* Content + Sidebar Container */
.single-post-container {
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 40px;
	display: flex;
	gap: 60px;
	align-items: flex-start;
}

/* Sidebar (Table of Contents) */
.single-post-sidebar {
	flex-shrink: 0;
	width: 280px;
	position: sticky;
	top: 0;
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.single-post-toc {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

/* Top divider */
.single-post-toc::before {
	content: '';
	display: block;
	height: 1px;
	background: #EAECF0;
	width: 100%;
}

/* Heading and TOC wrapper */
.single-post-toc__wrapper {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.single-post-toc__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	color: rgba(44, 83, 48, 0.96);
	margin: 0;
}

.single-post-toc__nav {
	/* TOC navigation container */
}

/* Bottom divider */
.single-post-toc::after {
	content: '';
	display: block;
	height: 1px;
	background: #EAECF0;
	width: 100%;
}

/* Social Share Buttons */
.single-post-share {
	display: flex;
	gap: 12px;
	align-items: center;
}

.share-button {
	width: 40px;
	height: 40px;
	padding: 10px;
	background: #fff;
	border: 1px solid #D0D5DD;
	border-radius: 8px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.share-button svg {
	width: 20px;
	height: auto;
	display: block;
}

.share-button:hover {
	background: #F9FAFB;
	border-color: #98A2B3;
}

.share-button:active {
	transform: scale(0.95);
}

/* Copy confirmation tooltip */
.share-button.copied::after {
	content: 'Copied!';
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-bottom: 8px;
	padding: 4px 8px;
	background: #344054;
	color: #fff;
	font-size: 12px;
	border-radius: 4px;
	white-space: nowrap;
	pointer-events: none;
	animation: fadeInOut 2s ease-in-out;
}

@keyframes fadeInOut {
	0%, 100% { opacity: 0; }
	10%, 90% { opacity: 1; }
}

.share-button {
	position: relative;
}

/* Tocbot Generated Styles */
.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.toc-list-item {
	margin: 0;
}

.toc-link {
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 24px;
	color: #475467;
	text-decoration: none;
	transition: color 0.2s ease;
}

.toc-link:hover {
	color: rgba(44, 83, 48, 0.96);
}

.toc-link.is-active-link {
	color: var(--color-heading-primary);
}

/* Nested TOC lists (for H3 under H2) */
.toc-list .toc-list {
	margin-top: 8px;
	margin-left: 10px;
	gap: 8px;
}

/* Collapsible functionality */
.is-collapsible {
	max-height: 1000px;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.is-collapsed {
	max-height: 0;
}

/* Post Content Area */
.single-post-content {
	flex: 1;
	max-width: 840px;
}

.single-post-content__body {
	font-size: 16px;
	line-height: 1.8;
	color: var(--color-text-dark);
}

.single-post-content__body h2 {
	margin-top: 48px;
	margin-bottom: 24px;
}

.single-post-content__body h3 {
	margin-top: 40px;
	margin-bottom: 20px;
}

.single-post-content__body h4,
.single-post-content__body h5,
.single-post-content__body h6 {
	margin-top: 32px;
	margin-bottom: 16px;
}

.single-post-content__body p {
	margin-bottom: 24px;
}

.single-post-content__body ul,
.single-post-content__body ol {
	margin-bottom: 24px;
	padding-left: 24px;
}

.single-post-content__body li {
	margin-bottom: 12px;
}

.single-post-content__body img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	margin: 32px 0;
}

.single-post-content__body blockquote {
	border-left: 4px solid var(--color-primary);
	padding-left: 24px;
	margin: 32px 0;
	font-style: italic;
	color: #666;
}

.single-post-content__body a {
	color: var(--color-primary);
	text-decoration: underline;
}

.single-post-content__body a:hover {
	text-decoration: none;
}

/* Post Navigation */
.single-post-navigation {
	display: flex;
	justify-content: space-between;
	gap: 32px;
	margin-top: 80px;
	padding-top: 40px;
	border-top: 1px solid #e5e7eb;
}

.single-post-navigation__prev,
.single-post-navigation__next {
	flex: 1;
}

.single-post-navigation__next {
	text-align: right;
}

.single-post-navigation a {
	display: block;
	padding: 20px;
	background: #f8f9fa;
	border-radius: 8px;
	transition: background 0.2s ease;
}

.single-post-navigation a:hover {
	background: #e5e7eb;
}

.single-post-navigation .nav-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--color-primary);
	margin-bottom: 8px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.single-post-navigation .nav-title {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: var(--color-text-dark);
	line-height: 1.4;
}

/* ============================================
   Responsive Styles
   ============================================ */

/* Tablet (991px and below) */
@media (max-width: 991px) {
	.single-post-main {
		padding-top: 32px;
	}

	.single-post-container {
		padding: 0 24px;
		gap: 40px;
	}

	.single-post-sidebar {
		width: 220px;
	}

	.single-post-navigation {
		margin-top: 60px;
		padding-top: 32px;
	}
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
	.single-post-container {
		flex-direction: column;
		gap: 32px;
	}

	.single-post-sidebar {
		width: 100%;
		position: static;
		order: 2;
	}

	.single-post-content {
		order: 1;
		max-width: 100%;
	}

	.single-post-navigation {
		flex-direction: column;
		gap: 16px;
		margin-top: 48px;
	}

	.single-post-navigation__next {
		text-align: left;
	}
}

/* Mobile (576px and below) */
@media (max-width: 576px) {
	.single-post-main {
		padding-top: 24px;
	}

	.single-post-container {
		padding: 0 20px;
		gap: 24px;
	}

	.single-post-toc {
		padding: 20px;
	}

	.single-post-content__body {
		font-size: 15px;
		line-height: 1.7;
	}

	.single-post-content__body h2 {
		margin-top: 40px;
		margin-bottom: 20px;
	}

	.single-post-content__body h3 {
		margin-top: 32px;
		margin-bottom: 16px;
	}

	.single-post-content__body img {
		margin: 24px 0;
	}

	.single-post-navigation {
		margin-top: 40px;
		padding-top: 24px;
	}

	.single-post-navigation a {
		padding: 16px;
	}

	.single-post-navigation .nav-title {
		font-size: 15px;
	}
}
