/**
 * Shared Post Components
 *
 * Reusable styles for custom blog post templates. These styles are shared
 * across all custom single-post-{slug}.php templates.
 *
 * Components included:
 * - Custom post hero (.custom-post-hero-*)
 * - Post sections (.post-section, .post-section-title)
 * - Post CTA cards (.post-cta-*)
 * - Post closing (.post-closing)
 *
 * @package AgenticWP
 */

/* ==========================================================================
   Custom Post Hero
   ========================================================================== */

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

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

.custom-post-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;
}

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

.custom-post-hero-title {
	font-size: clamp(32px, 6vw, 52px);
	font-weight: 700;
	color: var(--ink);
	line-height: 1.1;
	margin: 0 0 24px;
	letter-spacing: -0.02em;
}

.custom-post-hero-excerpt {
	font-size: 19px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 24px;
}

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

.custom-post-hero-meta-sep {
	opacity: 0.5;
}

/* Hero Image */
.custom-post-hero-image {
	max-width: 560px;
	margin: 0 auto;
}

.custom-post-hero-image img {
	width: 100%;
	height: auto;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(5, 14, 57, 0.2);
}

/* ==========================================================================
   Post Sections
   ========================================================================== */

.post-section {
	margin-bottom: 48px;
}

.post-section:last-child {
	margin-bottom: 0;
}

.post-section-title {
	font-size: 28px;
	font-weight: 700;
	color: var(--ink);
	margin: 0 0 20px;
	letter-spacing: -0.01em;
	scroll-margin-top: 100px;
}

.post-section p {
	font-size: 18px;
	line-height: 1.75;
	color: var(--ink);
	margin: 0 0 20px;
}

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

.post-lead {
	font-size: 20px;
	line-height: 1.7;
	color: var(--ink);
}

/* ==========================================================================
   Post CTA Card
   ========================================================================== */

.post-section--cta {
	margin-top: 64px;
	padding-top: 48px;
	border-top: 1px solid var(--line);
}

.post-cta-card {
	position: relative;
	padding: 48px;
	background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
	border-radius: 20px;
	overflow: hidden;
}

.post-cta-content {
	position: relative;
	z-index: 1;
	max-width: 520px;
}

.post-cta-title {
	font-size: 28px;
	font-weight: 700;
	color: var(--ink);
	margin: 0 0 16px;
}

.post-cta-text {
	font-size: 17px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 28px;
}

.post-cta-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

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

.post-cta-actions .btn-primary {
	background: var(--accent);
	color: var(--bg);
}

.post-cta-actions .btn-primary:hover {
	background: #0a1a4d;
}

.post-cta-actions .btn-secondary {
	background: var(--bg);
	color: var(--ink);
	border: 1px solid var(--line);
}

.post-cta-actions .btn-secondary:hover {
	border-color: var(--accent);
	color: var(--accent);
}

.post-cta-actions .btn-icon {
	width: 18px;
	height: 18px;
}

.post-cta-decoration {
	position: absolute;
	right: -40px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0.15;
	pointer-events: none;
}

.cta-decoration-icon {
	width: 280px;
	height: 280px;
	color: var(--accent);
}

/* ==========================================================================
   Insight Callout
   ========================================================================== */

.insight-callout {
	display: flex;
	gap: 20px;
	margin: 40px 0;
	padding: 28px;
	background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
	border: 1px solid #fde68a;
	border-radius: 12px;
}

.insight-callout-icon {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fef3c7;
	border-radius: 10px;
	color: #d97706;
}

.insight-callout-icon svg {
	width: 22px;
	height: 22px;
}

.insight-callout-content {
	flex: 1;
}

.insight-callout-title {
	font-size: 16px;
	font-weight: 600;
	color: #92400e;
	margin: 0 0 8px;
}

.insight-callout-text {
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink);
	margin: 0;
}

/* ==========================================================================
   Internal Links
   ========================================================================== */

.internal-link {
	color: var(--accent);
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: all 0.2s ease;
}

.internal-link:hover {
	color: #0a1a4d;
	text-decoration-color: #0a1a4d;
}

/* Callout style for prominent internal links */
.internal-link-callout {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	margin: 8px 0;
	background: #f8fafc;
	border: 1px solid var(--line);
	border-radius: 8px;
	color: var(--accent);
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
}

.internal-link-callout:hover {
	background: var(--accent-weak);
	border-color: var(--accent);
}

.internal-link-callout::after {
	content: '→';
	font-size: 14px;
}

/* ==========================================================================
   Post Closing
   ========================================================================== */

.post-closing {
	margin-top: 40px;
	text-align: center;
}

.post-closing p {
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
}

.post-closing-signature {
	margin-top: 24px;
	font-size: 17px;
	color: var(--ink);
}

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

@media (max-width: 900px) {
	.custom-post-hero {
		padding: 80px 0 48px;
	}

	.post-cta-card {
		padding: 36px;
	}

	.post-cta-decoration {
		display: none;
	}
}

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

@media (max-width: 640px) {
	.custom-post-hero {
		padding: 60px 0 40px;
	}

	.custom-post-hero-content {
		margin-bottom: 32px;
	}

	.custom-post-hero-excerpt {
		font-size: 17px;
	}

	.custom-post-hero-meta {
		font-size: 14px;
	}

	.post-section-title {
		font-size: 24px;
	}

	.post-section p,
	.post-lead {
		font-size: 17px;
	}

	.post-section--cta {
		margin-top: 48px;
		padding-top: 40px;
	}

	.post-cta-card {
		padding: 28px;
	}

	.post-cta-title {
		font-size: 24px;
	}

	.post-cta-actions {
		flex-direction: column;
	}

	.post-cta-actions .btn {
		width: 100%;
		justify-content: center;
	}

	.insight-callout {
		flex-direction: column;
		gap: 16px;
		padding: 20px;
	}
}

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

.custom-post-hero-category:focus,
.post-cta-actions .btn:focus,
.internal-link:focus,
.internal-link-callout:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
	.custom-post-hero-category,
	.post-cta-actions .btn,
	.internal-link,
	.internal-link-callout {
		transition: none;
	}
}

/* ==========================================================================
   SVG Icon Catch-All
   Prevents unsized SVGs from expanding to fill their containers.
   ========================================================================== */

[class*="-icon"] svg,
[class*="_icon"] svg {
	max-width: 100%;
	max-height: 100%;
}
