/*
 * Single book page ("Book Details" pattern and Book Page template).
 * Only what block attributes cannot express.
 */

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

.ylb-book-page .ylb-book-page__hero .wp-block-separator {
	margin-inline: auto;
}

/* Light card: the stitch line is gold instead of white. */
.ylb-book-page .ylb-book-page__details {
	background-image: none;
	box-shadow: inset 0 0 0 2px rgba(204, 156, 66, 0.35);
}

.ylb-book-page .ylb-book-page__details::before {
	border-color: var(--wp--preset--color--gold-line);
}

.ylb-book-page .ylb-book-page__list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: clamp(17px, 1.5vw, 20px);
}

.ylb-book-page .ylb-book-page__list li {
	padding: 10px 0;
	border-bottom: 1.5px dashed var(--wp--preset--color--gold-line);
}

.ylb-book-page .ylb-book-page__list li:last-child {
	border-bottom: 0;
}

.ylb-book-page .ylb-book-page__list strong {
	color: var(--wp--preset--color--plum);
}

.ylb-book-page .ylb-book-page__star {
	margin: 0 auto;
}

.ylb-book-page .ylb-book-page__star img {
	display: block;
	width: 36px;
	height: 36px;
	margin-inline: auto;
}

.ylb-book-page .ylb-book-page__card {
	height: 100%;
}

.ylb-book-page .ylb-book-page__card p {
	font-size: clamp(16px, 1.3vw, 18px);
}

.ylb-book-page .ylb-book-page__cta .wp-block-heading,
.ylb-book-page .ylb-book-page__cta p {
	color: inherit;
}

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

/* "Back to all books" button spacing. */
.ylb-book-page .ylb-book-page__back {
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

/*
 * Book pages created before the button existed have "Back to all books" as a
 * centred text link at the end of the page. Style that link as the same
 * purple storybook pill so older book pages match.
 */
.ylb-book-page > p.has-text-align-center:last-child > a:only-child {
	display: inline-block;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	padding: 0.6em 1.35em;
	border-radius: 999px;
	background-color: var(--wp--preset--color--royal-purple);
	color: var(--wp--preset--color--white);
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18), 0 5px 8px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.28);
	transition: transform 0.35s var(--ylb-btn-spring, ease), box-shadow 0.3s ease, filter 0.3s ease;
}

.ylb-book-page > p.has-text-align-center:last-child > a:only-child:is(:hover, :focus-visible) {
	transform: translateY(-3px) scale(1.03);
	box-shadow: var(--ylb-btn-lift-shadow, 0 10px 18px rgba(59, 26, 79, 0.28));
	filter: brightness(1.07);
	color: var(--wp--preset--color--white);
}

.ylb-book-page > p.has-text-align-center:last-child > a:only-child:focus-visible {
	outline: 3px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.ylb-book-page > p.has-text-align-center:last-child > a:only-child:is(:hover, :focus-visible) {
		transform: none;
	}
}

/*
 * Headings that sit directly above a heart divider (such as "About this book")
 * are centred, like the divider under them. Also fixes book pages created before
 * the layout set the heading to centre.
 */
.ylb-book-page :is(h1, h2, h3).wp-block-heading:has(+ .wp-block-separator.is-style-ylb-heart) {
	text-align: center;
}

/* The tagline above the cover card's heart divider is centred over it (also on earlier book pages). */
.ylb-book-page .ylb-book-page__hero p:has(+ .wp-block-separator.is-style-ylb-heart) {
	text-align: center;
}
