/**
 * Single Post Styles
 *
 * Styles for single post hero, content, meta, navigation,
 * and related posts sections.
 *
 * @package AgenticWP
 */

/* ==========================================================================
   Container Modifier
   ========================================================================== */

.container--narrow {
	max-width: 720px;
}

/* ==========================================================================
   Single Post Hero
   ========================================================================== */

.single-hero {
	padding: 100px 0 48px;
	background: linear-gradient(
		to bottom,
		#fefcfb 0%,
		var(--bg) 100%
	);
}

.single-hero-content {
	max-width: 720px;
	margin: 0 auto;
	text-align: center;
}

.single-hero-category {
	display: inline-block;
	padding: 6px 14px;
	background: var(--accent-weak);
	color: var(--accent);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 20px;
	margin-bottom: 20px;
	text-decoration: none;
	transition: background-color 0.2s ease;
}

.single-hero-category:hover {
	background: #d8f5a0;
}

.single-hero-title {
	font-size: clamp(32px, 6vw, 48px);
	font-weight: 700;
	color: var(--ink);
	line-height: 1.15;
	margin: 0 0 20px;
	letter-spacing: -0.02em;
}

.single-hero-meta {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	color: var(--muted);
}

.single-hero-meta-sep {
	opacity: 0.5;
}

.single-hero-image {
	margin-top: 48px;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.single-featured-image {
	width: 100%;
	height: auto;
	display: block;
}

/* ==========================================================================
   Single Post Content
   ========================================================================== */

.single-content {
	padding: 48px 0;
}

.post-content {
	font-size: 18px;
	line-height: 1.75;
	color: var(--ink);
}

/* Headings */
.post-content h2 {
	font-size: 28px;
	font-weight: 700;
	margin: 48px 0 20px;
	color: var(--ink);
	letter-spacing: -0.01em;
}

.post-content h3 {
	font-size: 22px;
	font-weight: 600;
	margin: 40px 0 16px;
	color: var(--ink);
}

.post-content h4 {
	font-size: 18px;
	font-weight: 600;
	margin: 32px 0 12px;
	color: var(--ink);
}

/* Paragraphs */
.post-content p {
	margin: 0 0 24px;
}

/* Links */
.post-content a {
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.2s ease;
}

.post-content a:hover {
	color: #0a1a4d;
}

/* Lists */
.post-content ul,
.post-content ol {
	margin: 0 0 24px;
	padding-left: 28px;
}

.post-content li {
	margin-bottom: 8px;
}

.post-content li::marker {
	color: var(--accent);
}

/* Blockquotes */
.post-content blockquote {
	margin: 32px 0;
	padding: 24px 32px;
	border-left: 4px solid var(--accent);
	background: #f8fafc;
	font-size: 19px;
	font-style: italic;
	color: var(--ink);
	border-radius: 0 8px 8px 0;
}

.post-content blockquote p:last-child {
	margin-bottom: 0;
}

/* Code */
.post-content code {
	font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
	font-size: 0.9em;
	padding: 2px 6px;
	background: #f1f5f9;
	border-radius: 4px;
	color: var(--ink);
}

.post-content pre {
	margin: 32px 0;
	padding: 24px;
	background: #1e293b;
	border-radius: 12px;
	overflow-x: auto;
}

.post-content pre code {
	background: transparent;
	padding: 0;
	color: #e2e8f0;
	font-size: 14px;
	line-height: 1.6;
}

/* Images */
.post-content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
	margin: 32px 0;
}

.post-content figure {
	margin: 32px 0;
}

.post-content figcaption {
	margin-top: 12px;
	font-size: 14px;
	color: var(--muted);
	text-align: center;
}

/* Tables */
.post-content table {
	width: 100%;
	margin: 32px 0;
	border-collapse: collapse;
	font-size: 16px;
}

.post-content th,
.post-content td {
	padding: 12px 16px;
	text-align: left;
	border-bottom: 1px solid var(--line);
}

.post-content th {
	font-weight: 600;
	background: #f8fafc;
}

/* Horizontal Rule */
.post-content hr {
	margin: 48px 0;
	border: none;
	border-top: 1px solid var(--line);
}

/* ==========================================================================
   Single Post Meta (Tags, Share, Author)
   ========================================================================== */

.single-meta {
	padding: 48px 0;
	border-top: 1px solid var(--line);
}

/* Tags */
.post-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 32px;
}

.post-tags-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
}

.post-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.post-tag {
	display: inline-block;
	padding: 6px 12px;
	background: #f3f4f6;
	color: var(--muted);
	font-size: 13px;
	font-weight: 500;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.post-tag:hover {
	background: var(--accent);
	color: var(--bg);
}

/* Share */
.post-share {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 40px;
	padding-bottom: 40px;
	border-bottom: 1px solid var(--line);
}

.post-share-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--ink);
}

.post-share-list {
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.post-share-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: #f3f4f6;
	border-radius: 8px;
	color: var(--muted);
	transition: all 0.2s ease;
}

.post-share-link:hover {
	background: var(--accent);
	color: var(--bg);
}

.share-icon {
	width: 20px;
	height: 20px;
}

/* Author */
.post-author {
	display: flex;
	gap: 20px;
	align-items: flex-start;
}

.post-author-avatar {
	flex-shrink: 0;
}

.author-avatar-image {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	object-fit: cover;
}

.post-author-info {
	flex: 1;
}

.post-author-label {
	display: block;
	font-size: 13px;
	color: var(--muted);
	margin-bottom: 4px;
}

.post-author-name {
	display: block;
	font-size: 18px;
	font-weight: 600;
	color: var(--ink);
	text-decoration: none;
	transition: color 0.2s ease;
}

.post-author-name:hover {
	color: var(--accent);
}

.post-author-bio {
	margin: 8px 0 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--muted);
}

/* ==========================================================================
   Post Navigation
   ========================================================================== */

.post-navigation {
	padding: 48px 0;
	background: #f8fafc;
	border-top: 1px solid var(--line);
}

.post-navigation-inner {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
}

.post-nav-link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 24px;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: 12px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.post-nav-link:hover {
	border-color: var(--accent);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.post-nav-prev {
	text-align: left;
}

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

.post-nav-direction {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--accent);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.post-nav-next .post-nav-direction {
	justify-content: flex-end;
}

.nav-arrow {
	width: 16px;
	height: 16px;
}

.post-nav-title {
	font-size: 17px;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.post-nav-placeholder {
	visibility: hidden;
}

/* ==========================================================================
   Related Posts
   ========================================================================== */

.related-posts {
	padding: 64px 0 80px;
	background: var(--bg);
}

.related-posts-title {
	font-size: 28px;
	font-weight: 700;
	color: var(--ink);
	text-align: center;
	margin: 0 0 40px;
	letter-spacing: -0.01em;
}

.related-posts-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	margin-bottom: 48px;
}

.related-posts-action {
	text-align: center;
}

.related-posts-action .btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 28px;
	font-size: 15px;
	font-weight: 600;
	border-radius: 10px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.related-posts-action .btn-secondary {
	background: var(--bg);
	color: var(--ink);
	border: 1px solid var(--line);
}

.related-posts-action .btn-secondary:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.btn-arrow {
	width: 18px;
	height: 18px;
}

/* ==========================================================================
   Responsive: Tablet (max-width: 900px)
   ========================================================================== */

@media (max-width: 900px) {
	.single-hero {
		padding: 80px 0 40px;
	}

	.single-hero-image {
		margin-top: 32px;
	}

	.related-posts-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 24px;
	}
}

/* ==========================================================================
   Responsive: Mobile (max-width: 640px)
   ========================================================================== */

@media (max-width: 640px) {
	.single-hero {
		padding: 60px 0 32px;
	}

	.single-hero-category {
		font-size: 12px;
		padding: 5px 12px;
	}

	.single-hero-meta {
		font-size: 14px;
		gap: 6px;
	}

	.single-hero-image {
		margin-top: 24px;
		border-radius: 12px;
	}

	.single-content {
		padding: 32px 0;
	}

	.post-content {
		font-size: 17px;
	}

	.post-content h2 {
		font-size: 24px;
		margin: 36px 0 16px;
	}

	.post-content h3 {
		font-size: 20px;
	}

	.post-content blockquote {
		padding: 20px 24px;
		font-size: 17px;
	}

	.post-content pre {
		padding: 16px;
		border-radius: 8px;
	}

	.single-meta {
		padding: 32px 0;
	}

	.post-tags {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.post-share {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.post-author {
		flex-direction: column;
		text-align: center;
		align-items: center;
	}

	.post-navigation {
		padding: 32px 0;
	}

	.post-navigation-inner {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.post-nav-link {
		padding: 20px;
	}

	.post-nav-next {
		text-align: left;
	}

	.post-nav-next .post-nav-direction {
		justify-content: flex-start;
		flex-direction: row-reverse;
	}

	.related-posts {
		padding: 48px 0 60px;
	}

	.related-posts-title {
		font-size: 24px;
		margin-bottom: 32px;
	}

	.related-posts-grid {
		grid-template-columns: 1fr;
		gap: 24px;
		margin-bottom: 40px;
	}
}

/* ==========================================================================
   Accessibility: Focus States
   ========================================================================== */

.single-hero-category:focus,
.post-content a:focus,
.post-tag:focus,
.post-share-link:focus,
.post-author-name:focus,
.post-nav-link:focus,
.related-posts-action .btn:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* ==========================================================================
   Accessibility: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.single-hero-category,
	.post-content a,
	.post-tag,
	.post-share-link,
	.post-author-name,
	.post-nav-link,
	.related-posts-action .btn {
		transition: none;
	}
}
