/*
 * Colour Your Book – frontend book styles.
 * Cover artwork is square (8.5 × 8.5 inches) and must never be cropped.
 */

body.single-cyb_book .wp-block-post-featured-image {
	width: min(100%, 720px);
	margin-inline: auto;
	height: auto !important;
	max-height: none !important;
	aspect-ratio: 1 / 1 !important;
	overflow: visible !important;
}

/* The default Extendable single-post template wraps the cover in a white group. */
body.single-cyb_book .wp-block-group:has(> .wp-block-post-featured-image) {
	padding: 0 !important;
	background: transparent !important;
}

body.single-cyb_book .wp-block-post-date {
	display: none !important;
}

body.single-cyb_book .cyb-book-subtitle {
	margin-block: 0 1.25rem;
	font-size: clamp(1.15rem, 2vw, 1.45rem);
	font-weight: 650;
	line-height: 1.35;
}

body.single-cyb_book .cyb-book-details,
body.single-cyb_book .cyb-amazon-links {
	margin-block: clamp(2rem, 5vw, 3.5rem);
	padding: clamp(1.25rem, 4vw, 2rem);
	border: 1px solid rgba(20, 33, 61, 0.14);
	border-radius: 1rem;
	background: #fff;
	box-shadow: 0 0.7rem 2rem rgba(20, 33, 61, 0.08);
}

body.single-cyb_book .cyb-book-details > h2,
body.single-cyb_book .cyb-amazon-links > h2 {
	margin-block: 0 1rem;
	font-size: clamp(1.5rem, 3vw, 2rem);
}

body.single-cyb_book .cyb-book-details__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 0.75rem;
	margin: 0;
}

body.single-cyb_book .cyb-book-details__item {
	padding: 1rem;
	border-radius: 0.75rem;
	background: rgba(20, 33, 61, 0.045);
}

body.single-cyb_book .cyb-book-details__item dt {
	margin-bottom: 0.25rem;
	font-size: 0.8rem;
	font-weight: 750;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.68;
}

body.single-cyb_book .cyb-book-details__item dd {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 650;
}

body.single-cyb_book .cyb-amazon-links > p {
	margin-block: 0 1.25rem;
}

body.single-cyb_book .cyb-amazon-links__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

body.single-cyb_book .cyb-amazon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	padding: 0.75rem 1.15rem;
	border: 2px solid #172554;
	border-radius: 999px;
	background: #172554;
	color: #fff;
	font-weight: 750;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

body.single-cyb_book .cyb-amazon-button:hover,
body.single-cyb_book .cyb-amazon-button:focus-visible {
	background: #fff;
	color: #172554;
	transform: translateY(-1px);
}

body.single-cyb_book .cyb-amazon-button:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 3px;
}

body.single-cyb_book .wp-block-post-featured-image a {
	display: block;
	width: 100%;
	height: auto !important;
	aspect-ratio: 1 / 1 !important;
}

body.single-cyb_book .wp-block-post-featured-image img,
body.single-cyb_book img.wp-post-image,
body.post-type-archive-cyb_book .wp-block-post-featured-image img,
body.tax-cyb_age_group .wp-block-post-featured-image img,
body.tax-cyb_book_topic .wp-block-post-featured-image img,
body.tax-cyb_book_series .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto !important;
	max-height: none !important;
	aspect-ratio: 1 / 1 !important;
	object-fit: contain !important;
	object-position: center !important;
}

/* Book archive and taxonomy cards. */
body.post-type-archive-cyb_book .wp-block-query,
body.tax-cyb_age_group .wp-block-query,
body.tax-cyb_book_topic .wp-block-query,
body.tax-cyb_book_series .wp-block-query {
	width: min(100% - 2rem, 76rem);
	margin-inline: auto;
}

body.post-type-archive-cyb_book .wp-block-post-template,
body.tax-cyb_age_group .wp-block-post-template,
body.tax-cyb_book_topic .wp-block-post-template,
body.tax-cyb_book_series .wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 20rem));
	gap: clamp(1.25rem, 3vw, 2rem);
	justify-content: center;
	padding: 0;
}

body.post-type-archive-cyb_book .wp-block-post,
body.tax-cyb_age_group .wp-block-post,
body.tax-cyb_book_topic .wp-block-post,
body.tax-cyb_book_series .wp-block-post {
	display: flex;
	min-width: 0;
	flex-direction: column;
	margin-block-start: 0 !important;
	padding: 0 0 1.25rem;
	overflow: hidden;
	border: 1px solid rgba(20, 33, 61, 0.14);
	border-radius: 1rem;
	background: #fff;
	box-shadow: 0 0.7rem 2rem rgba(20, 33, 61, 0.08);
}

/* Extendable gives its nested archive-card group min-height:100%, which
 * otherwise creates a large empty area and clips the card information. */
body.post-type-archive-cyb_book .wp-block-post > .wp-block-group,
body.tax-cyb_age_group .wp-block-post > .wp-block-group,
body.tax-cyb_book_topic .wp-block-post > .wp-block-group,
body.tax-cyb_book_series .wp-block-post > .wp-block-group {
	display: flex;
	flex: 1;
	flex-direction: column;
	height: auto !important;
	min-height: 0 !important;
	overflow: visible !important;
}

body.post-type-archive-cyb_book .wp-block-post > .wp-block-group > .wp-block-group,
body.tax-cyb_age_group .wp-block-post > .wp-block-group > .wp-block-group,
body.tax-cyb_book_topic .wp-block-post > .wp-block-group > .wp-block-group,
body.tax-cyb_book_series .wp-block-post > .wp-block-group > .wp-block-group {
	height: auto !important;
	min-height: 0 !important;
	margin-block-start: 0 !important;
	overflow: visible !important;
}

body.post-type-archive-cyb_book .wp-block-post > .wp-block-spacer,
body.tax-cyb_age_group .wp-block-post > .wp-block-spacer,
body.tax-cyb_book_topic .wp-block-post > .wp-block-spacer,
body.tax-cyb_book_series .wp-block-post > .wp-block-spacer {
	display: none !important;
}

body.post-type-archive-cyb_book .wp-block-post-featured-image,
body.tax-cyb_age_group .wp-block-post-featured-image,
body.tax-cyb_book_topic .wp-block-post-featured-image,
body.tax-cyb_book_series .wp-block-post-featured-image {
	height: auto !important;
	margin: 0 0 1.1rem;
	aspect-ratio: 1 / 1 !important;
	overflow: hidden;
	background: rgba(20, 33, 61, 0.035);
}

body.post-type-archive-cyb_book .wp-block-post-featured-image a,
body.tax-cyb_age_group .wp-block-post-featured-image a,
body.tax-cyb_book_topic .wp-block-post-featured-image a,
body.tax-cyb_book_series .wp-block-post-featured-image a {
	display: block;
	height: auto !important;
	aspect-ratio: 1 / 1 !important;
}

body.post-type-archive-cyb_book .wp-block-post-featured-image img,
body.tax-cyb_age_group .wp-block-post-featured-image img,
body.tax-cyb_book_topic .wp-block-post-featured-image img,
body.tax-cyb_book_series .wp-block-post-featured-image img {
	height: 100% !important;
}

body.post-type-archive-cyb_book .wp-block-post-title,
body.tax-cyb_age_group .wp-block-post-title,
body.tax-cyb_book_topic .wp-block-post-title,
body.tax-cyb_book_series .wp-block-post-title {
	margin: 0;
	padding-inline: 1.25rem;
	font-size: clamp(1.2rem, 2.2vw, 1.45rem);
	line-height: 1.25;
}

body.post-type-archive-cyb_book .wp-block-post-title a,
body.tax-cyb_age_group .wp-block-post-title a,
body.tax-cyb_book_topic .wp-block-post-title a,
body.tax-cyb_book_series .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

body.post-type-archive-cyb_book .wp-block-post-date,
body.tax-cyb_age_group .wp-block-post-date,
body.tax-cyb_book_topic .wp-block-post-date,
body.tax-cyb_book_series .wp-block-post-date {
	display: none !important;
}

.cyb-book-archive__intro {
	width: min(100% - 2rem, 76rem);
	margin: 0.75rem auto 1.5rem;
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	line-height: 1.6;
}

.cyb-series-nav {
	width: min(100% - 2rem, 76rem);
	margin: 0 auto clamp(2rem, 5vw, 3.5rem);
}

.cyb-series-nav__label {
	display: block;
	margin-bottom: 0.75rem;
	font-size: 0.9rem;
	font-weight: 750;
	letter-spacing: 0.035em;
	text-transform: uppercase;
}

.cyb-series-nav__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.cyb-series-nav__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.65rem;
	padding: 0.65rem 0.95rem;
	border: 1px solid rgba(20, 33, 61, 0.2);
	border-radius: 999px;
	background: #fff;
	color: #172554;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
}

.cyb-series-nav__link:hover,
.cyb-series-nav__link:focus-visible,
.cyb-series-nav__link.is-active {
	border-color: #172554;
	background: #172554;
	color: #fff;
}

.cyb-series-nav__link:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 3px;
}

.cyb-book-card__details {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-end !important;
	gap: 1.1rem;
	margin-block-start: 1rem !important;
	padding: 1rem 1.25rem 0;
}

.cyb-book-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cyb-book-card__badge {
	display: inline-flex;
	align-items: center;
	min-height: 2rem;
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	background: rgba(20, 33, 61, 0.065);
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.2;
}

.cyb-book-card__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.75rem;
	margin-top: 0 !important;
	padding: 0.7rem 1rem;
	border: 2px solid #172554;
	border-radius: 999px;
	background: #172554;
	color: #fff;
	font-weight: 750;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.cyb-book-card__button:hover,
.cyb-book-card__button:focus-visible {
	background: #fff;
	color: #172554;
	transform: translateY(-1px);
}

.cyb-book-card__button:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 3px;
}

/* Editable homepage pattern. */
body.home .cyb-home-hero {
	margin-block: 0 clamp(3.5rem, 8vw, 6rem);
	padding: clamp(4rem, 10vw, 7.5rem) max(1.5rem, calc((100vw - 76rem) / 2));
	background:
		radial-gradient(circle at 15% 20%, rgba(250, 204, 21, 0.28), transparent 28%),
		radial-gradient(circle at 85% 75%, rgba(56, 189, 248, 0.22), transparent 30%),
		linear-gradient(135deg, #fff9e8 0%, #f4f8ff 55%, #eefcf7 100%);
}

@media (min-width: 64rem) {
	body.home .cyb-home-hero {
		background-color: #fffaf0;
		background-image:
			linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04)),
			url("https://colouryourbook.com/wp-content/uploads/2026/08/hero-collage-v7-panorama-web.webp");
		background-position: center;
		background-repeat: no-repeat;
		background-size: cover;
	}
}

body.home .cyb-home-eyebrow {
	margin: 0 0 1rem;
	color: #172554;
	font-size: 0.9rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

body.home .cyb-home-hero__title {
	max-width: 14ch;
	margin: 0 auto 1.25rem;
	font-size: clamp(2.6rem, 7vw, 5.25rem);
	line-height: 0.98;
	letter-spacing: -0.045em;
}

body.home .cyb-home-hero__text {
	max-width: 46rem;
	margin: 0 auto 2rem;
	font-size: clamp(1.15rem, 2.4vw, 1.4rem);
	line-height: 1.55;
}

body.home .cyb-home-button .wp-block-button__link {
	min-height: 3.1rem;
	padding: 0.8rem 1.25rem;
	border: 2px solid #172554;
	border-radius: 999px;
	font-weight: 750;
	line-height: 1.2;
}

body.home .cyb-home-button--primary .wp-block-button__link {
	background: #172554;
	color: #fff;
}

body.home .cyb-home-button--secondary .wp-block-button__link {
	background: transparent;
	color: #172554;
}

body.home .cyb-home-button .wp-block-button__link:hover,
body.home .cyb-home-button .wp-block-button__link:focus-visible {
	background: #fff;
	color: #172554;
	transform: translateY(-1px);
}

body.home .cyb-home-button .wp-block-button__link:focus-visible {
	outline: 3px solid #f59e0b;
	outline-offset: 3px;
}

body.home .cyb-home-section {
	margin-block: clamp(3.5rem, 8vw, 6rem);
	padding-inline: 1rem;
}

body.home .cyb-home-section__title {
	max-width: 22ch;
	margin-inline: auto;
	font-size: clamp(2rem, 4vw, 3.2rem);
	line-height: 1.08;
}

body.home .cyb-home-section__intro {
	max-width: 42rem;
	margin: 1rem auto 2.5rem;
	font-size: 1.1rem;
}

body.home .cyb-home-series {
	align-items: stretch;
	gap: 1.25rem;
}

body.home .cyb-home-series > .wp-block-column {
	display: flex;
}

body.home .cyb-home-series-card {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: flex-start;
	padding: clamp(1.4rem, 3vw, 2rem);
	border: 1px solid rgba(20, 33, 61, 0.13);
	border-radius: 1.25rem;
	box-shadow: 0 0.8rem 2.2rem rgba(20, 33, 61, 0.08);
}

body.home .cyb-home-series-card--discover {
	background: linear-gradient(145deg, #eef9ff, #fff);
}

body.home .cyb-home-series-card--active {
	background: linear-gradient(145deg, #f1fdf5, #fff);
}

body.home .cyb-home-series-card--season {
	background: linear-gradient(145deg, #fff7e8, #fff);
}

body.home .cyb-home-series-card h3 {
	margin-block: 0 0.75rem;
	font-size: clamp(1.35rem, 2.5vw, 1.7rem);
}

body.home .cyb-home-series-card p {
	margin-block: 0 1.5rem;
	line-height: 1.6;
}

body.home .cyb-home-series-card .wp-block-button {
	margin-top: auto;
}

body.home .cyb-home-series-card .wp-block-button__link {
	border-color: #172554;
	border-radius: 999px;
	color: #172554;
	font-weight: 700;
}

body.home .cyb-home-benefits {
	margin-block: clamp(3.5rem, 8vw, 6rem);
	padding: clamp(3rem, 7vw, 5rem) max(1.5rem, calc((100vw - 76rem) / 2));
	background: rgba(20, 33, 61, 0.045);
}

body.home .cyb-home-benefit-grid {
	gap: 1.25rem;
	margin-top: 2.5rem;
}

body.home .cyb-home-benefit-grid > .wp-block-column {
	padding: 1.35rem;
	border-radius: 1rem;
	background: #fff;
}

body.home .cyb-home-benefit-grid h3 {
	margin-top: 0;
	font-size: 1.25rem;
}

body.home .cyb-home-cta {
	margin-block: clamp(3.5rem, 8vw, 6rem);
	padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
	border-radius: 1.5rem;
	background: #172554;
	color: #fff;
}

body.home .cyb-home-cta h2 {
	margin-top: 0;
	font-size: clamp(2rem, 4vw, 3rem);
}

body.home .cyb-home-cta p {
	max-width: 42rem;
	margin-inline: auto;
}

body.home .cyb-home-cta .cyb-home-button--primary .wp-block-button__link {
	border-color: #fff;
	background: #fff;
	color: #172554;
}

@media (max-width: 40rem) {
	body.post-type-archive-cyb_book .wp-block-query,
	body.tax-cyb_age_group .wp-block-query,
	body.tax-cyb_book_topic .wp-block-query,
	body.tax-cyb_book_series .wp-block-query {
		width: min(100% - 1.5rem, 30rem);
	}

	body.home .cyb-home-hero {
		padding-block: 3.5rem;
	}

	body.home .cyb-home-hero .wp-block-buttons {
		align-items: stretch;
		flex-direction: column;
	}

	body.home .cyb-home-button,
	body.home .cyb-home-button .wp-block-button__link {
		width: 100%;
	}

	body.home .cyb-home-cta {
		margin-inline: 0.75rem;
	}
}
