/*
 * Starter page patterns (About, Books, Contact, Blog intro).
 * Only what block attributes cannot express.
 */

.ylb-page-about .is-style-ylb-ring {
	max-width: 340px;
	margin-inline: auto;
}

.ylb-page-about .wp-block-quote {
	border: 0;
	padding: 0;
	margin-inline: auto;
	max-width: 720px;
}

.ylb-page-about .wp-block-quote cite {
	display: block;
	text-align: center;
	color: var(--wp--preset--color--brick-red);
	font-style: normal;
}

.ylb-page-books .is-style-ylb-book {
	max-width: 280px;
	margin-inline: auto;
}

/* Light (parchment) variant of the stitched card: gold stitches instead of white. */
.wp-block-group.is-style-ylb-stitched.ylb-card-light {
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--gold-line);
	background-image: none;
	color: var(--wp--preset--color--ink-brown);
}

.wp-block-group.is-style-ylb-stitched.ylb-card-light::before {
	border-color: var(--wp--preset--color--gold-line);
}

/*
 * Keep the two contact cards the same height. Only a card that is the only
 * block in its column stretches, so a column holding several blocks (like the
 * earlier Contact layout, with the form under "Say hello") never overflows.
 */
.ylb-page-contact .wp-block-columns > .wp-block-column > .wp-block-group:only-child:not(.ylb-page-contact__form) {
	height: 100%;
	box-sizing: border-box;
}

.ylb-page-contact .ylb-page-contact__note {
	border: 2px dashed var(--wp--preset--color--gold-line);
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 0;
}

/* Real forms placed in the form card use the full card width. */
.ylb-page-contact .ylb-page-contact__form .fluentform,
.ylb-page-contact .ylb-page-contact__form form {
	max-width: none;
	width: 100%;
}

/*
 * Home-page sections inserted into a page (hero, about + featured book,
 * newsletter) run edge to edge and sit flush against each other.
 * Best on the "Page No Title", "Page Full Width" and "Page Builder" templates.
 */
.wp-block-post-content > .ylb-hero,
.wp-block-post-content > .ylb-about-featured,
.wp-block-post-content > .ylb-newsletter {
	max-width: none;
	margin-left: 0 !important;
	margin-right: 0 !important;
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Default Page template: break out of the padded reading column. */
.wp-site-blocks:has(> main:not([class*="ylb-"]) .wp-block-post-content > :is(.ylb-hero, .ylb-about-featured, .ylb-newsletter)) {
	overflow-x: clip;
}

.wp-site-blocks > main:not([class*="ylb-"]) .wp-block-post-content > :is(.ylb-hero, .ylb-about-featured, .ylb-newsletter) {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
}

.ylb-page-blog .wp-block-post-title {
	margin-block: 0.5em 0.25em;
}

.ylb-page-blog .wp-block-post-title a {
	color: var(--wp--preset--color--plum);
	text-decoration: none;
}

.ylb-page-blog .wp-block-post-title a:hover,
.ylb-page-blog .wp-block-post-title a:focus {
	text-decoration: underline;
}

@media (max-width: 781px) {
	.ylb-page-books .is-style-ylb-book {
		max-width: 220px;
	}
}

/*
 * About layout: the intro text beside the portrait (heading, heart divider and
 * bio) is centred as one block. Also fixes About pages saved earlier.
 */
.ylb-page-about .wp-block-column:has(> .wp-block-separator.is-style-ylb-heart) > p:not(.has-text-align-left):not(.has-text-align-right) {
	text-align: center;
}
