/* Custom page templates, sidebar and 404. */
.ylb-template-full-width .wp-block-post-content > :where(:not(.alignfull)) {
	box-sizing: border-box;
	padding-inline: 1.5rem;
}

.ylb-template-wide-image .ylb-wide-image-cover .wp-block-post-title {
	text-shadow: 0 2px 12px rgba(59, 26, 79, 0.45);
}

.ylb-template-sidebar .wp-block-post-title {
	margin-top: 0;
}

.ylb-sidebar .wp-block-latest-posts {
	padding-left: 0;
	list-style: none;
}

.ylb-sidebar .wp-block-latest-posts li {
	margin-bottom: 0.75rem;
}

.ylb-sidebar .wp-block-latest-posts a {
	font-family: var(--wp--preset--font-family--heading);
	color: var(--wp--preset--color--plum);
}

.ylb-sidebar .wp-block-image.is-style-ylb-ring {
	margin-inline: auto;
}

.ylb-404 {
	text-align: center;
}

.ylb-404 .ylb-404-stars {
	gap: 1rem;
	align-items: center;
}

.ylb-404 .ylb-404-deco {
	margin: 0;
}

.ylb-404 .wp-block-search {
	margin-block: 1.5rem;
}

/*
 * Blank Canvas: the page always fills the screen in one colour. The main area
 * already grows to the full screen height (style.css); here the page content
 * grows with it, and its last section stretches to the bottom, so a short page
 * never shows its section colour on top and the body colour underneath.
 */
.wp-site-blocks > main.ylb-blank-canvas {
	display: flex;
	flex-direction: column;
}

.ylb-blank-canvas > .wp-block-post-content {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
}

.ylb-blank-canvas > .wp-block-post-content > :last-child {
	flex-grow: 1;
	margin-bottom: 0;
}

/*
 * Page spacing: templates give page content room below the header and above the
 * footer. When the content itself starts (or ends) with a full-width coloured
 * section, such as a cover, the home hero or the newsletter band, that edge sits
 * flush against the header (or footer) as designed, with no cream gap.
 */
.wp-site-blocks > main:has(> .wp-block-post-content:first-child > :first-child:is(.alignfull.has-background, .wp-block-cover.alignfull, .ylb-hero, .ylb-about-featured, .ylb-newsletter)) {
	padding-top: 0 !important;
}

.wp-site-blocks > main:has(> .wp-block-post-content:last-child > :last-child:is(.alignfull.has-background, .wp-block-cover.alignfull, .ylb-hero, .ylb-about-featured, .ylb-newsletter)) {
	padding-bottom: 0 !important;
}
