/**
 * Blog / single post / related Printcart templates.
 * Loaded only in blog contexts and after the global storefront layer.
 */

/* -------------------------------------------------------------------------
 * Blog listing cards: never crop the featured image.
 * Do not rely on object-fit alone: the image uses intrinsic proportions with
 * both dimensions capped by the media box.
 * ------------------------------------------------------------------------- */
.vz-bloglist .vz-post--card .vz-post__media,
.vz-single__related .vz-post--card .vz-post__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	aspect-ratio: 16 / 10;
	padding: 14px;
	margin: 0;
	overflow: hidden;
	background: #fff;
}

.vz-bloglist .vz-post--card .vz-post__media > img,
.vz-single__related .vz-post--card .vz-post__media > img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	border-radius: 0;
}

/* Keep the category pill pinned to the media box, independent of image size. */
.vz-bloglist .vz-post__badge,
.vz-single__related .vz-post__badge {
	z-index: 2;
}

/* -------------------------------------------------------------------------
 * Single article contract: the article itself always uses the canonical
 * .vz-container rail. Only the featured image is deliberately smaller.
 * Never couple image sizing to title/content/breadcrumb/template widths.
 * ------------------------------------------------------------------------- */
.vz-single__meta,
.vz-single__title,
.vz-single__content,
.vz-single__foot {
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
}

.vz-single__hero {
	box-sizing: border-box;
	width: min(100%, 760px);
	max-height: 520px;
	margin: 0 auto 30px;
	padding: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: var(--pp-radius-lg);
	background: #fff;
}

.vz-single__hero > img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 496px;
	object-fit: contain;
	object-position: center;
	border-radius: var(--pp-radius);
}

/* -------------------------------------------------------------------------
 * Printcart templates related to an article.
 * This component sits outside .vz-prose and owns the full article rail.
 * Cards keep a normal product-card width instead of stretching with the rail.
 * ------------------------------------------------------------------------- */
.vz-single__wrap > .pc-bt {
	width: 100%;
	max-width: none;
	margin: 48px 0 8px;
	padding-top: 30px;
	border-top: 1px solid var(--pp-border);
}

.vz-single__wrap > .pc-bt .pc-bt__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin: 0 0 20px;
}

.vz-single__wrap > .pc-bt .pc-bt__title {
	margin: 0;
	font-size: var(--pp-fs-5xl, 26px);
	line-height: 1.2;
	font-weight: 800;
	color: var(--pp-dark);
}

.vz-single__wrap > .pc-bt .pc-bt__subtitle {
	margin: 5px 0 0;
	font-size: var(--pp-fs-md, 14px);
	line-height: 1.4;
	color: var(--pp-text-muted);
}

.vz-single__wrap > .pc-bt .pc-bt__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 320px));
	gap: 16px;
	align-items: stretch;
	justify-content: start;
}

.vz-single__wrap > .pc-bt .pc-bt-card {
	min-width: 0;
	display: flex;
	flex-direction: column;
	margin: 0;
	background: #fff;
	border: 1px solid var(--pp-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 5px 18px rgba(16, 36, 78, .045);
}

.vz-single__wrap > .pc-bt .pc-bt-card__media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	aspect-ratio: 4 / 3;
	padding: 10px;
	overflow: hidden;
	background: #f4f6f9;
	text-decoration: none;
}

.vz-single__wrap > .pc-bt .pc-bt-card__media > img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	border-radius: 6px;
}

.vz-single__wrap > .pc-bt .pc-bt-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 12px 13px 13px;
}

.vz-single__wrap > .pc-bt .pc-bt-card__title {
	margin: 0;
	font-size: var(--pp-fs-lg, 15px);
	line-height: 1.3;
	font-weight: 750;
	color: var(--pp-dark);
}

.vz-single__wrap > .pc-bt .pc-bt-card__product {
	margin: 5px 0 0;
	font-size: var(--pp-fs-sm, 13px);
	line-height: 1.35;
	color: var(--pp-text-muted);
}

.vz-single__wrap > .pc-bt .pc-bt-card__action {
	margin-top: auto;
	padding-top: 12px;
	font-size: var(--pp-fs-sm, 13px);
	font-weight: 800;
	line-height: 1.1;
	color: var(--pp-orange);
	text-decoration: none;
}

@media (max-width: 760px) {
	.vz-single__hero {
		width: min(100%, 640px);
		max-height: 460px;
	}

	.vz-single__hero > img {
		max-height: 436px;
	}

}

@media (max-width: 520px) {
	.vz-bloglist .vz-post--card .vz-post__media,
	.vz-single__related .vz-post--card .vz-post__media {
		padding: 10px;
	}

	.vz-single__hero {
		width: 100%;
		max-height: 380px;
		padding: 8px;
		margin-bottom: 24px;
	}

	.vz-single__hero > img {
		max-height: 364px;
	}

	.vz-single__wrap > .pc-bt {
		margin-top: 38px;
		padding-top: 26px;
	}

	.vz-single__wrap > .pc-bt .pc-bt__head {
		display: block;
	}

	.vz-single__wrap > .pc-bt .pc-bt__all {
		display: inline-flex;
		margin-top: 8px;
	}

	.vz-single__wrap > .pc-bt .pc-bt__grid {
		grid-template-columns: 1fr;
		gap: 12px;
	}
}

/* -------------------------------------------------------------------------
 * Blog breadcrumbs share the same canonical rail as the article.
 * ------------------------------------------------------------------------- */
.vz-single__wrap > :is(.pp-breadcrumb, .vz-breadcrumb) {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	margin-bottom: 18px;
}

/* Blog index/archive breadcrumbs deliberately remain on the listing rail:
 * same left edge as the page title and the first card, never a centred
 * reading-column rail. */
.vz-bloglist > .vz-container > :is(.pp-breadcrumb, .vz-breadcrumb),
.vz-bloglist .vz-bloglist__head > :is(.pp-breadcrumb, .vz-breadcrumb) {
	box-sizing: border-box;
	width: 100%;
	margin-left: 0;
	margin-right: 0;
}

@media (max-width: 680px) {
	.vz-single__wrap > :is(.pp-breadcrumb, .vz-breadcrumb) {
		width: 100%;
		margin-left: 0;
		margin-right: 0;
		margin-bottom: 12px;
	}
}
