/**
 * Single Post Styles
 */

/* ============================================
   Featured Image with Parallax Effect
   ============================================ */
.single-featured-image-container {
	width: 100vw;
	margin-left: calc(-50vw + 50%);
	margin-top: -1px;
	height: 500px;
	overflow: hidden;
	position: relative;
}

.single-featured-image {
	width: 100%;
	height: 100%;
	position: relative;
	overflow: hidden;
}

.parallax-image {
	width: 100%;
	height: 120%; /* Extra height for parallax movement */
	object-fit: cover;
	position: absolute;
	top: -10%; /* Start higher to prevent gap at bottom */
	left: 0;
	will-change: transform;
	transform-origin: center top; /* Anchor to top */
}

/* ============================================
   Post Content Layout
   ============================================ */
.single-post-content {
	background: linear-gradient(to bottom, #F5F1EE 0%, #F9F6F3 100%);
	padding: 60px 0;
}

.single-post-content .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

.single-post-layout {
	display: grid;
	grid-template-columns: 1fr 350px;
	gap: 60px;
	/* Remove align-items: start to allow sticky to work */
}

/* ============================================
   Post Header
   ============================================ */
.single-post-header {
	margin-bottom: 40px;
}

.single-post-title {
	font-size: 2.5rem;
	font-weight: 600;
	margin: 0 0 20px;
	font-family: 'Aleo', serif;
	line-height: 1.3;
	color: var(--color-headline);
}

.single-post-meta {
	display: flex;
	align-items: center;
	gap: 25px;
	margin-bottom: 20px;
	font-size: 0.9rem;
	color: #666;
}

.single-post-meta span {
	display: flex;
	align-items: center;
	gap: 6px;
}

.single-post-meta svg {
	opacity: 0.5;
	flex-shrink: 0;
}

.single-post-categories {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.single-post-categories .entry-category {
	background: var(--color-secondary);
	color: white;
	padding: 3px 10px;
	border-radius: 8px;
	text-decoration: none;
	font-size: 0.85rem;
	font-weight: 600;
	transition: all 0.3s ease;
	display: inline-block;
}

.single-post-categories .entry-category:hover {
	background: var(--color-primary);
	transform: translateY(-2px);
}

/* ============================================
   Post Body Content
   ============================================ */
.single-post-main {
	background: white;
	padding: 40px;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.single-post-body {
	font-size: 1.1rem;
	line-height: 1.8;
	color: var(--color-text);
}

.single-post-body h2 {
	font-size: 1.8rem;
	margin: 40px 0 20px;
	font-family: 'Aleo', serif;
	color: var(--color-headline);
}

.single-post-body h3 {
	font-size: 1.4rem;
	margin: 30px 0 15px;
	font-family: 'Aleo', serif;
	color: var(--color-headline);
}

.single-post-body h4 {
	font-size: 1.2rem;
	margin: 25px 0 15px;
	font-family: 'Aleo', serif;
	color: var(--color-headline);
}

.single-post-body p {
	margin-bottom: 20px;
}

.single-post-body ul,
.single-post-body ol {
	margin: 20px 0;
	padding-left: 30px;
}

.single-post-body li {
	margin-bottom: 10px;
}

.single-post-body blockquote {
	border-left: 4px solid var(--color-accent);
	padding-left: 20px;
	margin: 30px 0;
	font-style: italic;
	color: #555;
}

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

/* ============================================
   Post Footer
   ============================================ */
.single-post-footer {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.single-post-tags {
	margin-bottom: 30px;
}

.tags-label {
	font-weight: 600;
	margin-right: 10px;
	color: var(--color-headline);
}

.single-post-tags .tag-link {
	display: inline-block;
	padding: 6px 12px;
	background: rgba(0, 123, 152, 0.1);
	color: var(--color-secondary);
	border-radius: 15px;
	text-decoration: none;
	font-size: 0.9rem;
	margin: 5px 5px 5px 0;
	transition: all 0.3s ease;
}

.single-post-tags .tag-link:hover {
	background: var(--color-secondary);
	color: white;
	transform: translateY(-2px);
}

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

.share-label {
	font-weight: 600;
	color: var(--color-headline);
}

.share-buttons {
	display: flex;
	gap: 10px;
}

.share-button {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: all 0.3s ease;
}

.share-button.facebook {
	background: #1877f2;
	color: white;
}

.share-button.twitter {
	background: #1da1f2;
	color: white;
}

.share-button.linkedin {
	background: #0077b5;
	color: white;
}

.share-button.email {
	background: #555;
	color: white;
}

.share-button:hover {
	transform: translateY(-3px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Post Navigation
   ============================================ */
.single-post-navigation {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 30px;
	margin-top: 40px;
	padding-top: 40px;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-previous,
.nav-next {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nav-next {
	text-align: right;
}

.nav-label {
	font-size: 0.85rem;
	color: #999;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.single-post-navigation a {
	color: var(--color-headline);
	text-decoration: none;
	font-weight: 600;
	font-size: 1.1rem;
	transition: color 0.3s ease;
}

.single-post-navigation a:hover {
	color: var(--color-secondary);
}

/* ============================================
   Sidebar with Table of Contents
   ============================================ */
.single-post-sidebar {
	align-self: start; /* This allows the sidebar to be the height of its content */
}

/* Non-sticky sections */
.sidebar-static {
	margin-bottom: 30px;
}

/* Sticky Container for TOC and Promo */
.sticky-sidebar-container {
	position: -webkit-sticky !important;
	position: sticky !important;
	top: 100px !important; /* Space from top of viewport */
	z-index: 100;
}

/* Adjust for WordPress admin bar */
.admin-bar .sticky-sidebar-container {
	top: 132px !important; /* 100px + 32px admin bar */
}

@media (max-width: 782px) {
	.admin-bar .sticky-sidebar-container {
		top: 146px !important; /* 100px + 46px mobile admin bar */
	}
}

/* Debug - ensure no parent has overflow hidden */
.single-post-content,
.single-post-content .container,
.single-post-layout,
.single-post-main,
.single-post-sidebar {
	overflow: visible !important;
}

/* Table of Contents */
.table-of-contents {
	background: white;
	border-radius: 10px;
	padding: 25px;
	margin-bottom: 20px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	max-height: 350px;
	overflow-y: auto;
}

.toc-title {
	font-size: 1.2rem;
	margin: 0 0 20px;
	color: var(--color-headline);
	font-family: 'Aleo', serif;
}

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

.toc-item {
	margin-bottom: 8px;
}

.toc-h3 {
	margin-left: 20px;
}

.toc-h4 {
	margin-left: 40px;
}

.toc-link {
	color: var(--color-text);
	text-decoration: none;
	font-size: 0.95rem;
	display: block;
	padding: 5px 10px;
	border-radius: 5px;
	transition: all 0.3s ease;
}

.toc-link:hover {
	background: rgba(0, 123, 152, 0.1);
	color: var(--color-secondary);
}

.toc-link.active {
	background: rgba(0, 123, 152, 0.1);
	color: var(--color-secondary);
	font-weight: 600;
}

/* Hide TOC if empty */
.table-of-contents:empty {
	display: none;
}

/* Promo Section (Part of Sticky Container) */
.sidebar-promo {
	background: linear-gradient(135deg, #f6b402 0%, #e5a402 100%);
	border-radius: 10px;
	padding: 25px;
	box-shadow: 0 4px 15px rgba(246, 180, 2, 0.3);
	text-align: center;
}

.sidebar-promo h3 {
	font-size: 1.3rem;
	margin: 0 0 15px;
	color: var(--color-headline);
	font-family: 'Aleo', serif;
}

.sidebar-promo p {
	color: var(--color-headline);
	margin-bottom: 20px;
	line-height: 1.5;
}

.btn-promo {
	background: var(--color-headline);
	color: white;
	padding: 12px 30px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	display: inline-block;
	transition: all 0.3s ease;
}

.btn-promo:hover {
	background: var(--color-secondary);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Non-sticky Sidebar Sections */
.sidebar-static {
	/* Normal flow, not sticky */
}

.sidebar-section {
	background: white;
	border-radius: 10px;
	padding: 25px;
	margin-bottom: 30px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.sidebar-section h3 {
	font-size: 1.2rem;
	margin: 0 0 20px;
	color: var(--color-headline);
	font-family: 'Aleo', serif;
}

/* Resource Links */
.resource-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.resource-links li {
	margin-bottom: 15px;
}

.resource-links a {
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--color-text);
	text-decoration: none;
	padding: 12px;
	border-radius: 8px;
	transition: all 0.3s ease;
}

.resource-links a:hover {
	background: rgba(0, 123, 152, 0.1);
	color: var(--color-secondary);
	transform: translateX(5px);
}

.resource-links svg {
	flex-shrink: 0;
	color: var(--color-secondary);
}

/* Related Posts */
.related-posts-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.related-posts-list li {
	margin-bottom: 15px;
}

.related-posts-list a {
	display: flex;
	align-items: center;
	gap: 15px;
	text-decoration: none;
	color: var(--color-text);
	transition: all 0.3s ease;
}

.related-posts-list a:hover {
	color: var(--color-secondary);
}

.related-thumbnail {
	width: 60px;
	height: 60px;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 8px;
}

.related-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.related-title {
	font-weight: 500;
	line-height: 1.3;
}

/* ============================================
   Comments Section
   ============================================ */
.comments-area {
	margin-top: 60px;
	padding-top: 40px;
	border-top: 2px solid rgba(0, 0, 0, 0.1);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
	.single-post-layout {
		grid-template-columns: 1fr;
	}
	
	.single-post-sidebar {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 30px;
	}
	
	.table-of-contents {
		max-height: none;
	}
	
	.sidebar-widgets > .widget:last-child {
		position: static !important;
	}
}

@media (max-width: 768px) {
	.single-post-title {
		font-size: 2rem;
	}
	
	.single-post-main {
		padding: 25px;
	}
	
	.single-post-body {
		font-size: 1rem;
	}
	
	.single-post-sidebar {
		grid-template-columns: 1fr;
	}
	
	.single-post-navigation {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	
	.nav-next {
		text-align: left;
	}
}