/* =====================================================================
   Treetale Home — Editorial single-post layout (4th scoped-CSS exception,
   with plp.css/product.css/lookbook.css). Cards come from plp.css
   (`.plp-page`); this file owns the page layout: hero, reading typography,
   the full-width intro row, "Shop the story" and "Czytaj dalej" strip.
   Loaded on is_singular('post'); scoped to `body.single-post`. Keep < 5KB.
   ===================================================================== */

/* --- Hero rhythm -----------------------------------------------------
   The featured-image cover bleeds edge-to-edge and sits flush under the
   sticky header (no top gap); the body that follows gets breathing room. */
body.single-post main.editorial-post-main {
	padding-top: 0;
	overflow-x: clip; /* contain the full-bleed hero + shop breakout */
}

body.single-post main.editorial-post-main > .wp-block-cover:first-child {
	margin-top: 0;
	margin-bottom: clamp(48px, 6vw, 80px);
}

/* When a post has no featured image the cover falls back to the ink
   overlay — keep it readable by capping its height a little lower. */
body.single-post main.editorial-post-main > .wp-block-cover:first-child:not(:has(.wp-block-cover__image-background)) {
	min-height: 48vh;
}

/* --- Editorial body typography / rhythm ------------------------------
   Comfortable measure (~720px from the constrained layout) with generous
   paragraph spacing; the author writes text + inspiration images here. */
body.single-post .editorial-post-main > .entry-content,
body.single-post .editorial-post-main > .wp-block-post-content {
	margin-bottom: clamp(56px, 7vw, 96px);
	color: var(--wp--preset--color--secondary);
	font-weight: 300;
	font-size: 1.0625rem;
	line-height: 1.8;
}

/* Editorial intro row — copy left / photo right, bled to the shop-grid width.
   !important beats WP's constrained `margin: auto !important` (else re-centered). */
body.single-post .editorial-arrange {
	max-width: none !important;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	padding: 0 var(--site-gutter);
}

body.single-post .wp-block-post-content > p {
	margin-top: 0;
	margin-bottom: 1.5em;
}

body.single-post .wp-block-post-content > h2 {
	margin-top: 2em;
	margin-bottom: 0.5em;
	color: var(--wp--preset--color--main);
	font-weight: 300;
	font-size: clamp(1.5rem, 3vw, 1.875rem);
	letter-spacing: -0.01em;
	line-height: 1.2;
}

body.single-post .wp-block-post-content > h3 {
	margin-top: 1.75em;
	margin-bottom: 0.5em;
	color: var(--wp--preset--color--main);
	font-weight: 400;
	font-size: 1.25rem;
	line-height: 1.3;
}

/* Inspiration images break out of the 720px measure nicely. */
body.single-post .wp-block-post-content > .wp-block-image {
	margin-top: clamp(32px, 4vw, 48px);
	margin-bottom: clamp(32px, 4vw, 48px);
}

body.single-post .wp-block-post-content figcaption {
	margin-top: 12px;
	color: var(--wp--preset--color--stone);
	font-weight: 300;
	font-size: 0.75rem;
	line-height: 1.5;
	text-align: left;
}

/* Pull-quote / blockquote — a quiet editorial accent. */
body.single-post .wp-block-post-content blockquote {
	margin: clamp(32px, 4vw, 48px) 0;
	padding-left: 28px;
	border-left: 2px solid var(--wp--preset--color--main);
	color: var(--wp--preset--color--main);
	font-weight: 300;
	font-size: clamp(1.25rem, 2.5vw, 1.625rem);
	line-height: 1.4;
}

body.single-post .wp-block-post-content blockquote p {
	margin: 0;
}

/* --- Shop the story (IKEA "Produkty z tej kolekcji") — full-bleed product grid,
   bled out of the 720px main to the /shop/ `.grid-wrap` width. Cards from plp.css. */
body.single-post .story-products {
	max-width: none !important;
	margin-block: clamp(64px, 8vw, 104px);
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
}

body.single-post .story-products-head {
	margin: 0 0 clamp(28px, 4vw, 44px);
	padding-left: var(--site-gutter);
	padding-right: var(--site-gutter);
	text-align: left;
}

body.single-post .story-products-head .eyebrow {
	margin: 0 0 14px;
	color: var(--wp--preset--color--stone);
	font-weight: 400;
	font-size: 0.6875rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

body.single-post .story-products-head h2 {
	margin: 0;
	color: var(--wp--preset--color--main);
	font-weight: 300;
	font-size: clamp(1.875rem, 4vw, 2.25rem);
	letter-spacing: -0.005em;
	line-height: 1.15;
}

body.single-post .story-products-grid {
	padding: 0 var(--site-gutter);
}

/* Desktop-only column override (block emits `--cols` on .grid-4; plp.css mobile
   breakpoints still collapse it). */
@media (min-width: 1025px) {
	body.single-post .story-products-grid .grid-4 {
		grid-template-columns: repeat(var(--cols, 4), 1fr);
	}
}

/* Related articles band ("Czytaj dalej") — owns only its top rhythm. */
body.single-post .editorial-related {
	margin-top: 0;
}

@media (max-width: 768px) {
	body.single-post main.editorial-post-main > .wp-block-cover:first-child {
		margin-bottom: 40px;
	}
	body.single-post .story-products {
		margin-block: 48px;
	}
}
