/*
 * 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;
}

/* The author's name under the quote reads as a signature: the hero's script
 * font in plum, between two short gold strokes. */
.ylb-page-about .wp-block-quote cite {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.45em;
	margin-top: 0.5rem;
	color: var(--wp--preset--color--plum);
	font-family: var(--wp--preset--font-family--script);
	font-size: clamp(30px, 3.4vw, 44px);
	font-style: normal;
	font-weight: 400;
	line-height: 1.2;
	text-align: center;
}

.ylb-page-about .wp-block-quote cite::before,
.ylb-page-about .wp-block-quote cite::after {
	content: "";
	flex: 0 0 auto;
	width: clamp(28px, 4vw, 56px);
	height: 2px;
	border-radius: 2px;
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--gold-line));
}

.ylb-page-about .wp-block-quote cite::after {
	background: linear-gradient(90deg, var(--wp--preset--color--gold-line), transparent);
}

.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%;
}

/* ---------- Subscribe page ---------- */

/* The sign-up card is a little narrower than the page, centred. */
.ylb-page-subscribe > .ylb-page-subscribe__form {
	width: 100%;
	max-width: 760px;
	margin-inline: auto;
	box-sizing: border-box;
}

.ylb-page-subscribe .ylb-page-subscribe__envelope {
	margin-block: 0;
}

.ylb-page-subscribe .ylb-page-subscribe__envelope img {
	filter: drop-shadow(0 4px 8px rgba(94, 58, 24, 0.18));
}

.ylb-page-subscribe .ylb-page-subscribe__note {
	border: 2px dashed var(--wp--preset--color--gold-line);
	border-radius: 12px;
	padding: 16px;
}

/* The sign-up form uses the full card width, like the contact form. */
.ylb-page-subscribe .ylb-page-subscribe__form .fluentform,
.ylb-page-subscribe .ylb-page-subscribe__form form {
	max-width: none;
	width: 100%;
}

.ylb-page-subscribe .ylb-page-subscribe__form .fluentform form {
	margin: 0;
}

.ylb-page-subscribe .ylb-page-subscribe__privacy {
	margin-top: 4px;
	opacity: 0.85;
}

/* The three "What you'll get" cards share one height. */
.ylb-page-subscribe__perks > .wp-block-column > .wp-block-group:only-child {
	height: 100%;
	box-sizing: border-box;
}

/*
 * 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;
}

/* Dark mode: the signature uses the lightened plum, like the headings. */
html.darkify_dark_mode_enabled.darkify_dark_mode_enabled .ylb-page-about .wp-block-quote cite {
	color: var(--wp--preset--color--plum) !important;
}

html.darkify_dark_mode_enabled.darkify_dark_mode_enabled .ylb-page-about .wp-block-quote cite::before {
	background: linear-gradient(90deg, transparent, #d9ad5a) !important;
}

html.darkify_dark_mode_enabled.darkify_dark_mode_enabled .ylb-page-about .wp-block-quote cite::after {
	background: linear-gradient(90deg, #d9ad5a, transparent) !important;
}
