/*
 * Virtina child: single blog post (single.php).
 * Loaded only on single posts. Blocks: vch-article-hero, vch-article-cover, vch-article-layout,
 * vch-article-content, vch-article-share, vch-author, vch-article-cta and vch-related.
 * Hero, type, cards and buttons follow the home page. Colors come from tokens.
 */

:root {
	--vch-color-single-border: #e2e2e2;
	--vch-color-single-surface-alt: #f6f6f6;
	--vch-color-single-link: #0b5cab;
	--vch-color-single-focus: #000;
	--vch-single-sticky-top: 112px;
}

.vch-page--single {
	font-family: 'Inter', sans-serif;
	color: var(--vch-color-text);
}

.vch-article-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Hero */

.vch-article-hero {
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	padding: 48px 0 112px;
	background: var(--vch-color-surface);
}

.vch-article-hero__bg,
.vch-article-hero__rays {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.vch-article-hero__rays {
	opacity: 0.2;
}

.vch-article-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 960px;
}

.vch-article-hero__crumbs {
	margin-bottom: 28px;
	font-size: 15px;
}

.vch-article-hero__crumbs a,
.vch-article-hero__category {
	color: var(--vch-color-text);
	text-underline-offset: 4px;
}

.vch-article-hero__crumbs a:focus-visible,
.vch-article-hero__category:focus-visible,
.vch-article-share__link:focus-visible,
.vch-author__link:focus-visible {
	outline: 2px solid var(--vch-color-single-focus);
	outline-offset: 3px;
	border-radius: 4px;
}

.vch-article-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0 0 20px;
	font-size: 14px;
	color: var(--vch-color-text-muted);
}

.vch-article-hero__category {
	font-weight: 600;
	color: var(--vch-color-accent-rose);
}

.vch-article-hero__title {
	margin: 0;
	font-family: 'Archivo', sans-serif;
	font-weight: 500;
	font-size: clamp(2rem, 3.47vw, 3.75rem);
	line-height: 1.2;
	text-wrap: balance;
}

.vch-article-hero__byline {
	margin: 24px 0 0;
	font-size: 16px;
	color: var(--vch-color-text-muted);
}

/* Cover image */

/* The image overlaps the bottom of the hero, so the hero's edge never meets the image corner. */
.vch-article-cover {
	position: relative;
	z-index: 2;
	margin-top: -72px;
	margin-bottom: 48px;
}

.vch-article-cover__image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 640px;
	object-fit: cover;
	border-radius: 25px;
	background: var(--vch-color-tint-rose);
}

/* Layout: article column and sticky call to action */

.vch-article-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 48px;
	padding-top: 16px;
	padding-bottom: 96px;
}

.vch-article-main {
	min-width: 0;
}

/* Article body. Rules are scoped to the content so they style whatever the editor produced. */

.vch-article-content {
	font-size: 18px;
	line-height: 1.7;
	letter-spacing: -0.01em;
	color: var(--vch-color-text);
	overflow-wrap: anywhere;
}

.vch-article-content > *:first-child {
	margin-top: 0;
}

.vch-article-content p,
.vch-article-content ul,
.vch-article-content ol,
.vch-article-content blockquote,
.vch-article-content figure,
.vch-article-content table,
.vch-article-content pre {
	margin: 0 0 1.4em;
}

.vch-article-content h2,
.vch-article-content h3,
.vch-article-content h4 {
	margin: 1.8em 0 0.6em;
	font-family: 'Archivo', sans-serif;
	font-weight: 500;
	line-height: 1.25;
	scroll-margin-top: var(--vch-single-sticky-top);
}

.vch-article-content h2 {
	font-size: clamp(1.7rem, 2.4vw, 2.25rem);
}

.vch-article-content h3 {
	font-size: clamp(1.4rem, 1.9vw, 1.75rem);
}

.vch-article-content h4 {
	font-size: 1.25rem;
}

.vch-article-content a {
	color: var(--vch-color-single-link);
	text-underline-offset: 3px;
}

.vch-article-content a:hover {
	text-decoration-thickness: 2px;
}

.vch-article-content a:focus-visible {
	outline: 2px solid var(--vch-color-single-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

.vch-article-content ul,
.vch-article-content ol {
	padding-left: 1.4em;
}

.vch-article-content li {
	margin-bottom: 0.5em;
}

.vch-article-content img,
.vch-article-content video,
.vch-article-content iframe {
	max-width: 100%;
	height: auto;
	border-radius: 16px;
}

.vch-article-content iframe {
	aspect-ratio: 16 / 9;
	width: 100%;
	height: auto;
}

.vch-article-content figcaption {
	margin-top: 8px;
	font-size: 14px;
	color: var(--vch-color-text-muted);
}

.vch-article-content blockquote {
	padding: 4px 0 4px 24px;
	border-left: 4px solid var(--vch-color-accent-teal);
	font-size: 1.1em;
	color: var(--vch-color-text-muted);
}

.vch-article-content pre {
	padding: 20px;
	overflow-x: auto;
	border-radius: 12px;
	background: var(--vch-color-single-surface-alt);
	font-size: 15px;
	line-height: 1.6;
}

.vch-article-content :not(pre) > code {
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--vch-color-single-surface-alt);
	font-size: 0.9em;
}

.vch-article-content table {
	display: block;
	width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 16px;
}

.vch-article-content th,
.vch-article-content td {
	padding: 10px 14px;
	border: 1px solid var(--vch-color-single-border);
	text-align: left;
}

.vch-article-content th {
	background: var(--vch-color-single-surface-alt);
	font-weight: 600;
}

.vch-article-content hr {
	margin: 2.5em 0;
	border: 0;
	border-top: 1px solid var(--vch-color-single-border);
}

.vch-article-pages {
	margin-top: 24px;
}

/* Share */

.vch-article-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-top: 48px;
	padding: 24px 0;
	border-top: 1px solid var(--vch-color-single-border);
	border-bottom: 1px solid var(--vch-color-single-border);
}

.vch-article-share__title {
	margin: 0;
	font-family: 'Inter', sans-serif;
	font-weight: 600;
	font-size: 16px;
}

.vch-article-share__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vch-article-share__link {
	display: inline-block;
	padding: 9px 18px;
	border: 1px solid var(--vch-color-single-border);
	border-radius: 48px;
	font-size: 14px;
	line-height: 1.2;
	color: var(--vch-color-text);
	text-decoration: none;
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.vch-article-share__link:hover {
	border-color: var(--vch-color-text);
	background: var(--vch-color-text);
	color: var(--vch-color-surface);
}

/* Author */

.vch-author {
	display: flex;
	gap: 24px;
	margin-top: 40px;
	padding: 28px;
	border-radius: 25px;
	background: var(--vch-color-track);
}

.vch-author__avatar {
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	object-fit: cover;
}

.vch-author__name {
	margin: 0 0 8px;
	font-family: 'Archivo', sans-serif;
	font-weight: 500;
	font-size: 22px;
}

.vch-author__bio {
	margin: 0 0 12px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--vch-color-text-muted);
}

.vch-author__link {
	font-size: 15px;
	font-weight: 500;
	color: var(--vch-color-text);
	text-underline-offset: 4px;
}

/* Sticky call to action */

.vch-article-cta {
	box-sizing: border-box;
	padding: 32px 28px;
	border-radius: 25px;
	background: var(--vch-color-single-surface-alt);
}

.vch-article-cta__title {
	margin: 0 0 12px;
	font-family: 'Archivo', sans-serif;
	font-weight: 500;
	font-size: 26px;
	line-height: 1.2;
}

.vch-article-cta__text {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.5;
	letter-spacing: -0.02em;
	color: var(--vch-color-text-muted);
}

/* Related posts */

/* White, so the grey cards (#f4f4f4) stand out from the section. */
.vch-related {
	padding: 88px 0 104px;
	background: var(--vch-color-surface);
}

.vch-related__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px 40px;
	margin-bottom: 40px;
}

.vch-related__title {
	margin: 0;
	font-family: 'Archivo', sans-serif;
	font-weight: 500;
	font-size: clamp(32px, 3vw, 42px);
	line-height: 1.2;
}

.vch-related__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vch-related__item {
	min-width: 0;
}

@media (min-width: 640px) {
	.vch-related__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 900px) {
	.vch-article-hero {
		padding: 72px 0 136px;
	}

	.vch-article-cover {
		margin-top: -88px;
	}
}

@media (min-width: 1100px) {
	.vch-article-layout {
		grid-template-columns: minmax(0, 1fr) 360px;
		gap: 48px;
	}

	.vch-article-aside {
		position: sticky;
		top: var(--vch-single-sticky-top);
		align-self: start;
	}

	.vch-related__grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 32px;
	}
}

@media (max-width: 599px) {
	.vch-article-content {
		font-size: 17px;
	}

	.vch-author {
		flex-direction: column;
		padding: 22px;
	}

	.vch-related {
		padding: 64px 0 72px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vch-article-share__link {
		transition: none;
	}
}

.vch-author__bio a {
	color: var(--vch-color-single-link);
	text-underline-offset: 3px;
}

.vch-author__bio a:focus-visible {
	outline: 2px solid var(--vch-color-single-focus);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Case studies: filter chips in the hero */

.vch-article-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.vch-article-tags__tag {
	display: inline-block;
	padding: 8px 16px;
	border: 1px solid var(--vch-color-text);
	border-radius: 48px;
	background: var(--vch-color-surface);
	font-size: 14px;
	line-height: 1.2;
	color: var(--vch-color-text);
	text-decoration: none;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.vch-article-tags__tag:hover {
	background: var(--vch-color-text);
	color: var(--vch-color-surface);
}

.vch-article-tags__tag:focus-visible,
.vch-details__live:focus-visible {
	outline: 2px solid var(--vch-color-single-focus);
	outline-offset: 3px;
}

/* Case studies: project details card, above the call to action */

.vch-details {
	box-sizing: border-box;
	margin-bottom: 24px;
	padding: 28px;
	border: 1px solid var(--vch-color-single-border);
	border-radius: 25px;
	background: var(--vch-color-surface);
}

.vch-details__title {
	margin: 0 0 16px;
	font-family: 'Archivo', sans-serif;
	font-weight: 500;
	font-size: 22px;
	line-height: 1.2;
}

.vch-details__list {
	margin: 0;
}

.vch-details__row {
	padding: 12px 0;
	border-top: 1px solid var(--vch-color-single-border);
}

.vch-details__row dt {
	margin: 0 0 2px;
	font-size: 13px;
	color: var(--vch-color-text-muted);
}

.vch-details__row dd {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
}

.vch-details__live {
	display: inline-block;
	margin-top: 8px;
	font-weight: 500;
	color: var(--vch-color-text);
	text-underline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.vch-article-tags__tag {
		transition: none;
	}
}
