/**
 * Single Post Page Styles
 *
 * Course-inspired article template using the IABT design tokens.
 *
 * @package falar-child
 */

.sp-page {
	background: var(--iabt-bg-main);
	padding-top: 148px;
}

.sp-article {
	background: var(--iabt-bg-main);
}

body.single-post #iabt-custom-header.header-scrolled {
	right: auto;
	left: 50%;
	width: max-content;
	max-width: calc(100vw - 32px);
	margin: 12px 0 0;
	background: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	transform: translateX(-50%);
}

body.single-post #iabt-custom-header.header-scrolled .header-bottom-bar {
	background: hsl(var(--iabt-bg-main-hsl), 0.92);
	border-radius: var(--iabt-radius-pill);
	box-shadow: var(--iabt-shadow-soft);
}

@supports ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
	body.single-post #iabt-custom-header.header-scrolled .header-bottom-bar {
		-webkit-backdrop-filter: blur(12px);
		backdrop-filter: blur(12px);
		background: hsl(var(--iabt-bg-main-hsl), 0.82);
	}
}

.sp-hero {
	position: relative;
	aspect-ratio: 16 / 6;
	overflow: hidden;
	background: var(--iabt-bg-soft);
	border-bottom: 1px solid var(--iabt-border);
}

.sp-hero__media {
	width: 100%;
	height: 100%;
}

.sp-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sp-content {
	max-width: 900px;
	margin: 0 auto;
	padding: 34px 24px 72px;
}

.sp-header {
	position: relative;
	margin-bottom: 40px;
	padding-top: 28px;
	border-top: 1px solid var(--iabt-border);
	animation: spFadeUp 0.6s ease-out both;
}

.sp-header__title {
	max-width: 820px;
	margin: 0 0 16px;
	color: var(--iabt-text-primary);
	font-size: var(--iabt-h1);
	font-weight: var(--iabt-font-bold);
	line-height: var(--iabt-line-height-tight);
	letter-spacing: var(--iabt-letter-spacing-normal);
}

.sp-header__excerpt {
	max-width: 680px;
	margin: 0;
	color: var(--iabt-text-secondary);
	font-size: var(--iabt-text-lg);
	line-height: var(--iabt-line-height-body);
}

.sp-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin-top: 16px;
	padding-bottom: 18px;
	border-bottom: 1px solid var(--iabt-border);
	color: var(--iabt-text-muted);
	font-size: var(--iabt-text-sm);
	font-weight: var(--iabt-font-regular);
	line-height: var(--iabt-line-height-body);
}

.sp-meta__item {
	display: inline-flex;
	align-items: center;
	color: inherit;
}

.sp-meta__item + .sp-meta__item::before {
	width: 4px;
	height: 4px;
	margin: 0 10px;
	border-radius: var(--iabt-radius-pill);
	background: var(--iabt-border-strong);
	content: "";
}

.sp-meta__by {
	margin-right: 4px;
}

.sp-meta a {
	color: inherit;
	font-weight: var(--iabt-font-medium);
	text-decoration: none;
}

.sp-meta a:hover,
.sp-meta a:focus {
	color: var(--iabt-accent);
}

.sp-prose {
	min-width: 0;
}

.sp-prose h2,
.sp-prose h3,
.sp-prose h4,
.sp-prose h5,
.sp-prose h6 {
	color: var(--iabt-text-primary);
	font-weight: var(--iabt-font-semibold);
	line-height: var(--iabt-line-height-heading);
	letter-spacing: var(--iabt-letter-spacing-normal);
	margin-top: 28px;
	margin-bottom: 12px;
}

.sp-prose h2 {
	font-size: var(--iabt-h3);
}

.sp-prose h3 {
	font-size: var(--iabt-h4);
}

.sp-prose h4 {
	font-size: var(--iabt-h5);
}

.sp-prose h5,
.sp-prose h6 {
	font-size: var(--iabt-h6);
}

.sp-prose p {
	margin-bottom: var(--iabt-paragraph-margin);
	color: var(--iabt-text-secondary);
	font-size: var(--iabt-text-base);
	line-height: var(--iabt-line-height-body);
}

.sp-prose ul,
.sp-prose ol {
	margin-bottom: 18px;
	padding-left: 24px;
	color: var(--iabt-text-secondary);
	font-size: var(--iabt-text-base);
	line-height: var(--iabt-line-height-body);
}

.sp-prose li + li {
	margin-top: 6px;
}

.sp-prose a {
	color: var(--iabt-primary);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.sp-prose a:hover,
.sp-prose a:focus {
	color: var(--iabt-accent);
}

.sp-prose blockquote {
	position: relative;
	margin: 28px 0;
	padding: 22px 24px;
	border-top: 0;
	border-left: 3px solid var(--iabt-accent);
	background: var(--iabt-bg-soft);
	color: var(--iabt-text-primary);
	font-size: var(--iabt-text-lg);
	line-height: var(--iabt-line-height-body);
}

.sp-prose blockquote::before {
	display: none;
	content: none;
}

.sp-prose blockquote p:last-child {
	margin-bottom: 0;
}

.sp-prose img {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.sp-prose figure {
	margin: 28px 0;
}

.sp-prose figcaption {
	margin-top: 8px;
	color: var(--iabt-text-muted);
	font-size: var(--iabt-text-sm);
	line-height: var(--iabt-line-height-body);
}

.sp-prose table {
	width: 100%;
	margin-bottom: 20px;
	border-collapse: collapse;
	color: var(--iabt-text-secondary);
	font-size: var(--iabt-text-sm);
	line-height: var(--iabt-line-height-body);
}

.sp-prose th,
.sp-prose td {
	padding: 10px 14px;
	border: 1px solid var(--iabt-border);
	text-align: left;
}

.sp-prose th {
	background: var(--iabt-bg-soft);
	color: var(--iabt-text-primary);
	font-weight: var(--iabt-font-semibold);
}

.sp-page-links {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 28px;
	color: var(--iabt-text-primary);
	font-size: var(--iabt-text-sm);
	font-weight: var(--iabt-font-semibold);
}

.sp-post-nav {
	margin-top: 44px;
}

.sp-post-nav .nav-links {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.sp-post-nav .nav-previous,
.sp-post-nav .nav-next {
	min-width: 0;
}

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

.sp-post-nav a {
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 100%;
	padding: 18px;
	border: 1px solid var(--iabt-border);
	border-radius: 8px;
	background: var(--iabt-bg-soft);
	text-decoration: none;
}

.sp-post-nav a:hover,
.sp-post-nav a:focus {
	border-color: var(--iabt-accent);
	background: hsla(var(--iabt-accent-hsl), 0.08);
}

.sp-post-nav__label {
	color: var(--iabt-text-secondary);
	font-size: var(--iabt-text-xs);
	font-weight: var(--iabt-font-semibold);
	line-height: var(--iabt-line-height-heading);
	letter-spacing: var(--iabt-letter-spacing-normal);
	text-transform: uppercase;
}

.sp-post-nav__title {
	color: var(--iabt-text-primary);
	font-size: var(--iabt-text-base);
	font-weight: var(--iabt-font-semibold);
	line-height: var(--iabt-line-height-heading);
}

.sp-comments {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--iabt-border);
}

@keyframes spFadeUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 959px) {
	.sp-page {
		padding-top: 132px;
	}

	.sp-hero {
		aspect-ratio: 16 / 7;
	}

	.sp-header__title {
		font-size: var(--iabt-h2);
	}

	.sp-content {
		padding: 32px 24px 56px;
	}
}

@media (max-width: 820px) {
	.sp-page {
		padding-top: 0;
	}
}

@media (max-width: 767px) {
	.sp-hero {
		aspect-ratio: 16 / 10;
	}

	.sp-header__title {
		font-size: var(--iabt-h3);
	}

	.sp-header {
		margin-bottom: 32px;
		padding-top: 24px;
	}

	.sp-content {
		padding: 28px 16px 48px;
	}

	.sp-post-nav .nav-links {
		grid-template-columns: 1fr;
	}

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

@media (prefers-reduced-motion: reduce) {
	.sp-header {
		animation: none;
	}
}

@media print {
	.sp-hero {
		aspect-ratio: auto;
		background: none;
	}

	.sp-hero__media,
	.sp-post-nav,
	.sp-comments {
		display: none;
	}

	.sp-content {
		max-width: none;
		padding: 0;
	}

	.sp-page {
		padding-top: 0;
	}
}
