/**
 * VelesDC single-post editorial system.
 * Strictly scoped to the plugin body class so store and page layouts are not affected.
 */

.single-post.velesdc-editorial-single {
	--velesdc-article-accent: var(--ast-global-color-0, #fca004);
	--velesdc-article-bg: var(--ast-global-color-1, #0d0d0d);
	--velesdc-article-surface: var(--ast-global-color-4, #1a1a1a);
	--velesdc-article-text: var(--ast-global-color-2, #e0e0e0);
	--velesdc-article-muted: var(--ast-global-color-3, #a0a0a0);
	--velesdc-article-heading: var(--ast-global-color-7, #fff);
	--velesdc-article-border: rgba(255, 255, 255, 0.12);
}

.single-post.velesdc-editorial-single .site-content > .ast-container,
.single-post.velesdc-editorial-single #primary,
.single-post.velesdc-editorial-single article.ast-article-single {
	width: 100%;
	max-width: 1200px;
}

.single-post.velesdc-editorial-single #primary {
	margin-top: var(--veles-content-top-gap, 32px);
	margin-bottom: clamp(2rem, 5vw, 5rem);
}

.single-post.velesdc-editorial-single article.ast-article-single {
	padding: 0;
	background: transparent;
}

.single-post.velesdc-editorial-single .entry-content {
	width: min(100%, 840px);
	margin-inline: auto;
}

.single-post.velesdc-editorial-single .entry-content {
	font-size: clamp(1.0625rem, 1rem + 0.15vw, 1.125rem);
	line-height: 1.7;
	color: var(--velesdc-article-text);
}

.single-post.velesdc-editorial-single .velesdc-article-hero {
	margin-bottom: clamp(2rem, 4vw, 3.25rem);
	padding-bottom: clamp(1.75rem, 3vw, 2.5rem);
	border-bottom: 1px solid var(--velesdc-article-border);
}

.single-post.velesdc-editorial-single .velesdc-article-categories {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.single-post.velesdc-editorial-single .velesdc-article-categories a {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0.4rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--velesdc-article-accent) 55%, transparent);
	border-radius: 999px;
	color: var(--velesdc-article-accent);
	text-decoration: none;
}

.single-post.velesdc-editorial-single .velesdc-article-hero h1,
.single-post.velesdc-editorial-single .entry-content > h1:first-child {
	max-width: 100%;
	margin: 0;
	font-size: clamp(2.25rem, 4.2vw, 3.25rem);
	font-weight: 750;
	line-height: 1.1;
	letter-spacing: -0.035em;
	text-wrap: balance;
	color: var(--velesdc-article-heading);
}

.single-post.velesdc-editorial-single .velesdc-article-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin-top: 1.1rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--velesdc-article-muted);
}

.single-post.velesdc-editorial-single .velesdc-article-hero__media {
	width: min(960px, calc(100vw - 2rem));
	margin: clamp(1.5rem, 3.5vw, 2.5rem) 0 0 50%;
	transform: translateX(-50%);
}

.single-post.velesdc-editorial-single .velesdc-article-hero__image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 560px;
	border: 1px solid var(--velesdc-article-border);
	border-radius: clamp(0.75rem, 2vw, 1.25rem);
	object-fit: cover;
}

.single-post.velesdc-editorial-single .velesdc-article-hero + p {
	font-size: 1.06em;
	line-height: 1.68;
	color: var(--velesdc-article-heading);
}

.single-post.velesdc-editorial-single .velesdc-article-body > p:first-child {
	font-size: 1.06em;
	line-height: 1.68;
	color: var(--velesdc-article-heading);
}

/* Issue #146: progressive, article-only section navigation. */
.single-post.velesdc-editorial-single .velesdc-article-layout {
	--velesdc-anchor-offset: 80px;
}

.single-post.velesdc-editorial-single .velesdc-article-main {
	min-width: 0;
}

.single-post.velesdc-editorial-single .velesdc-article-body :is(h2, h3) {
	scroll-margin-top: var(--velesdc-anchor-offset);
}

.single-post.velesdc-editorial-single .velesdc-article-rail {
	margin-bottom: 2rem;
}

.single-post.velesdc-editorial-single .velesdc-toc {
	border: 1px solid var(--velesdc-article-border);
	border-radius: 0.75rem;
	background: var(--velesdc-article-surface);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.single-post.velesdc-editorial-single .velesdc-toc summary {
	padding: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.single-post.velesdc-editorial-single .velesdc-toc nav {
	padding: 0 0.65rem 0.65rem;
}

.single-post.velesdc-editorial-single .velesdc-toc nav ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.single-post.velesdc-editorial-single .velesdc-toc nav li {
	margin: 0;
	padding: 0;
}

.single-post.velesdc-editorial-single .velesdc-toc a {
	display: block;
	padding: 0.55rem 0.65rem;
	border-left: 2px solid transparent;
	border-radius: 0.25rem;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.single-post.velesdc-editorial-single .velesdc-toc a[aria-current],
.single-post.velesdc-editorial-single .velesdc-toc a:hover {
	border-left-color: var(--velesdc-article-accent);
	background: rgba(252, 160, 4, 0.09);
	font-weight: 700;
}

@media (min-width: 1280px) {
	.single-post.velesdc-editorial-single .velesdc-article-layout {
		display: grid;
		grid-template-columns: 200px 840px;
		gap: 80px;
		width: 1120px;
		margin-left: -140px;
	}

	.single-post.velesdc-editorial-single .velesdc-article-rail {
		margin: 0;
	}

	.single-post.velesdc-editorial-single .velesdc-toc {
		border: 0;
		border-radius: 0;
		background: transparent;
		font-size: 0.75rem;
		position: sticky;
		top: var(--velesdc-anchor-offset);
		max-height: calc(100vh - var(--velesdc-anchor-offset) - 1rem);
		overflow-y: auto;
		overscroll-behavior: contain;
	}

	.single-post.velesdc-editorial-single .velesdc-toc summary {
		padding: 0.6rem 0 0.85rem;
		margin-bottom: 0.45rem;
		border-bottom: 1px solid var(--velesdc-article-border);
		color: var(--velesdc-article-muted);
		font-size: 0.6875rem;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		list-style: none;
		cursor: default;
	}

	.single-post.velesdc-editorial-single .velesdc-toc nav {
		padding: 0;
	}

	.single-post.velesdc-editorial-single .velesdc-toc nav ol {
		counter-reset: velesdc-chapter;
	}

	.single-post.velesdc-editorial-single .velesdc-toc nav li {
		counter-increment: velesdc-chapter;
	}

	.single-post.velesdc-editorial-single .velesdc-toc a {
		display: grid;
		grid-template-columns: 1.1rem minmax(0, 1fr);
		gap: 0.5rem;
		padding: 0.4rem 0.4rem 0.4rem 0.65rem;
		border-radius: 0;
		color: var(--velesdc-article-muted) !important;
	}

	.single-post.velesdc-editorial-single .velesdc-toc a::before {
		content: counter(velesdc-chapter, decimal-leading-zero);
		font-size: 0.6875rem;
		line-height: 1.85;
		font-variant-numeric: tabular-nums;
	}

	.single-post.velesdc-editorial-single .velesdc-toc a[aria-current],
	.single-post.velesdc-editorial-single .velesdc-toc a:hover {
		color: var(--velesdc-article-accent) !important;
		background: transparent;
	}

	.single-post.velesdc-editorial-single .velesdc-toc summary::-webkit-details-marker {
		display: none;
	}

	.single-post.velesdc-editorial-single .velesdc-toc-enhanced .velesdc-toc:not(.is-visible):not(:focus-within) {
		visibility: hidden;
	}
}

.single-post.velesdc-editorial-single .entry-content p {
	margin: 0 0 1.35em;
}

.single-post.velesdc-editorial-single .entry-content h2,
.single-post.velesdc-editorial-single .entry-content h3,
.single-post.velesdc-editorial-single .entry-content h4,
.single-post.velesdc-editorial-single .entry-content h5,
.single-post.velesdc-editorial-single .entry-content h6 {
	color: var(--velesdc-article-heading);
	text-wrap: balance;
}

.single-post.velesdc-editorial-single .entry-content h2 {
	margin: clamp(2.5rem, 4.5vw, 3.75rem) 0 1rem;
	font-size: clamp(1.65rem, 3.2vw, 2.2rem);
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.single-post.velesdc-editorial-single .entry-content h3 {
	margin: clamp(2rem, 3.5vw, 2.75rem) 0 0.85rem;
	font-size: clamp(1.3rem, 2.2vw, 1.6rem);
	line-height: 1.3;
}

.single-post.velesdc-editorial-single .entry-content h4,
.single-post.velesdc-editorial-single .entry-content h5,
.single-post.velesdc-editorial-single .entry-content h6 {
	margin: 2.25rem 0 0.8rem;
	font-size: clamp(1.15rem, 2vw, 1.35rem);
	line-height: 1.35;
}

.single-post.velesdc-editorial-single .entry-content ul,
.single-post.velesdc-editorial-single .entry-content ol {
	margin: 0 0 1.75rem;
	padding-left: 1.4em;
}

.single-post.velesdc-editorial-single .entry-content li {
	margin-bottom: 0.65rem;
	padding-left: 0.25rem;
}

.single-post.velesdc-editorial-single .entry-content li::marker {
	color: var(--velesdc-article-accent);
	font-weight: 700;
}

.single-post.velesdc-editorial-single .entry-content a:not(.wp-element-button),
.single-post.velesdc-editorial-single .post-navigation a,
.single-post.velesdc-editorial-single .ast-related-posts-wrapper a {
	color: var(--velesdc-article-accent);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

.single-post.velesdc-editorial-single .entry-content a:not(.wp-element-button):hover,
.single-post.velesdc-editorial-single .entry-content a:not(.wp-element-button):focus-visible {
	text-decoration: underline;
}

.single-post.velesdc-editorial-single a:focus-visible {
	outline: 3px solid var(--velesdc-article-accent);
	outline-offset: 4px;
	border-radius: 2px;
}

.single-post.velesdc-editorial-single .entry-content blockquote {
	margin: 2.5rem 0;
	padding: 1.25rem 1.5rem;
	border: 0;
	border-left: 4px solid var(--velesdc-article-accent);
	background: var(--velesdc-article-surface);
	color: var(--velesdc-article-heading);
}

.single-post.velesdc-editorial-single .entry-content hr {
	width: 100%;
	margin: clamp(2.75rem, 6vw, 4.5rem) 0;
	border: 0;
	border-top: 1px solid var(--velesdc-article-border);
	background: transparent;
}

.single-post.velesdc-editorial-single .entry-content figure:not(.velesdc-article-hero__media),
.single-post.velesdc-editorial-single .entry-content pre {
	margin-block: 2.25rem;
}

.single-post.velesdc-editorial-single .entry-content img:not(.velesdc-article-hero__image) {
	height: auto;
	border-radius: 0.75rem;
}

.single-post.velesdc-editorial-single .entry-content figcaption {
	margin-top: 0.65rem;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--velesdc-article-muted);
}

.single-post.velesdc-editorial-single .entry-content .wp-block-table {
	width: min(960px, calc(100vw - 2rem));
	max-width: none;
	margin-left: 50%;
	transform: translateX(-50%);
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
}

.single-post.velesdc-editorial-single .entry-content table {
	width: 100%;
	min-width: 680px;
	border: 1px solid var(--velesdc-article-border);
	border-collapse: collapse;
	background: var(--velesdc-article-surface);
	font-size: 0.9em;
	line-height: 1.55;
}

.single-post.velesdc-editorial-single .entry-content th,
.single-post.velesdc-editorial-single .entry-content td {
	padding: 0.85rem 1rem;
	border: 1px solid var(--velesdc-article-border);
	text-align: left;
	vertical-align: top;
}

.single-post.velesdc-editorial-single .entry-content th {
	background: color-mix(in srgb, var(--velesdc-article-accent) 12%, var(--velesdc-article-surface));
	color: var(--velesdc-article-heading);
}

.single-post.velesdc-editorial-single .entry-content pre,
.single-post.velesdc-editorial-single .entry-content code {
	font-size: 0.9em;
}

.single-post.velesdc-editorial-single .entry-content pre {
	padding: 1.25rem;
	border: 1px solid var(--velesdc-article-border);
	border-radius: 0.75rem;
	overflow-x: auto;
	background: var(--velesdc-article-surface);
}

.single-post.velesdc-editorial-single .post-navigation,
.single-post.velesdc-editorial-single .ast-related-posts-wrapper {
	width: min(calc(100% - 2rem), 960px);
	margin-inline: auto;
}

.single-post.velesdc-editorial-single .post-navigation {
	margin-top: clamp(2.5rem, 4.5vw, 4rem);
	padding-top: 1.75rem;
	border-top: 1px solid var(--velesdc-article-border);
}

.single-post.velesdc-editorial-single .ast-related-posts-wrapper {
	margin-top: clamp(2.5rem, 4vw, 3.5rem);
}

.single-post.velesdc-editorial-single .ast-related-posts-title {
	font-size: clamp(1.5rem, 3vw, 2rem);
	color: var(--velesdc-article-heading);
}

@media (max-width: 921px) {
	.single-post.velesdc-editorial-single #primary {
		margin-block: 2rem 3.5rem;
	}

	.single-post.velesdc-editorial-single .site-content > .ast-container {
		padding-inline: max(1rem, env(safe-area-inset-left));
	}

	.single-post.velesdc-editorial-single .velesdc-article-hero h1,
	.single-post.velesdc-editorial-single .entry-content > h1:first-child {
		max-width: 100%;
		font-size: clamp(1.85rem, 7.5vw, 2.4rem);
		line-height: 1.12;
		overflow-wrap: break-word;
	}
}

@media (max-width: 544px) {
	.single-post.velesdc-editorial-single .entry-content {
		font-size: 1.0625rem;
		line-height: 1.7;
	}

	.single-post.velesdc-editorial-single .velesdc-article-hero__media,
	.single-post.velesdc-editorial-single .entry-content .wp-block-table {
		width: calc(100vw - 1.5rem);
	}

	.single-post.velesdc-editorial-single .entry-content th,
	.single-post.velesdc-editorial-single .entry-content td {
		padding: 0.75rem;
	}
}

@supports not (color: color-mix(in srgb, black 50%, white)) {
	.single-post.velesdc-editorial-single .velesdc-article-categories a {
		border-color: rgba(252, 160, 4, 0.55);
	}

	.single-post.velesdc-editorial-single .entry-content th {
		background: #2a2114;
	}
}
