/**
 * Book CTA block.
 *
 * One white card split into the buy column and a tinted signup panel, so the two
 * halves of the old section read as a single unit instead of two loose columns.
 * The signup panel carries the tint because it is the conversion the page wants.
 *
 * Loaded only on pages containing the block. Styles live here rather than as
 * Tailwind utilities so the block can be adjusted without rebuilding theme.css;
 * `.container` and `.button__small` still come from the theme.
 */

.book-cta {
	background: #fbfbf7; /* background_beige */
	/* Light on top: the carousel above the block brings its own bottom padding. */
	padding: 1.75rem 0 4.5rem;
}

.book-cta__card {
	display: grid;
	/* Wide enough on the left to keep the three buy links on one row. */
	grid-template-columns: 47% 53%;
	overflow: hidden;
	background: #fff;
	border-radius: 0.5rem;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.06);
}

/*
 * Without the buy column the panel spans the whole card, where a single left-aligned
 * stack leaves most of the width empty and the tint has no white half to read against.
 * So the copy and the form become the two halves, and the card itself carries the contrast.
 */
.book-cta__card--signup-only {
	grid-template-columns: 1fr;
}

.book-cta__card--signup-only .book-cta__signup {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: 0 4rem;
	background: #fff;
}

.book-cta__card--signup-only .book-cta__fields {
	/* Beside the copy rather than under it, so it needs no leading gap. */
	max-width: none;
	margin-top: 0;
}

.book-cta__card--signup-only .book-cta__message {
	margin-top: 0;
}

.book-cta__card--signup-only .book-cta__description {
	/* Same measure as the newsletter card: narrower left several lines ragging short of the column. */
	max-width: 46ch;
}

/* ------------------------------------------------------------ buy column */

.book-cta__buy {
	align-self: center;
	padding: 3rem 3.25rem;
}

.book-cta__buy-heading,
.book-cta__headline {
	margin: 0;
	color: #003049; /* dark_blue */
	font-size: 1.75rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

.book-cta__buy-description,
.book-cta__description {
	max-width: 42ch;
	margin-top: 1.1rem;
	color: #003049;
	font-size: 0.9375rem;
	line-height: 1.6;
	opacity: 0.85;
}

.book-cta__buy-description p:last-child,
.book-cta__description p:last-child {
	margin-bottom: 0;
}

/*
 * Where the resource is a series, the description names its parts as a list. The global reset
 * strips list markers and indent, so both are restored here.
 */
.book-cta__description ol,
.book-cta__description ul {
	margin: 0;
	padding-left: 1.35rem;
}

.book-cta__description ol {
	list-style: decimal;
}

.book-cta__description ul {
	list-style: disc;
}

.book-cta__description li + li {
	margin-top: 0.4rem;
}

.book-cta__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

/* The theme's roomy button padding costs a third link on this width. */
.book-cta__links .button__small {
	padding-right: 1.25rem;
	padding-left: 1.25rem;
}

/* ------------------------------------------------------------ signup panel */

.book-cta__signup {
	align-self: stretch;
	padding: 3rem 3.25rem;
	background: #f9f7f1; /* light_beige */
}

.book-cta__eyebrow {
	display: block;
	margin-bottom: 1.1rem;
	color: #d092a3; /* pink */
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

/* ------------------------------------------------------------ form */

.book-cta__fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem 1.25rem;
	max-width: 460px;
	margin-top: 1.75rem;
}

/* The grid display would otherwise beat the `hidden` attribute the script sets on success. */
.book-cta__fields[hidden] {
	display: none;
}

.book-cta__fields input[type='text'],
.book-cta__fields input[type='email'] {
	width: 100%;
	margin: 0;
}

.book-cta__submit {
	grid-column: 1 / -1;
	justify-self: start;
	padding: 0.75rem 2rem;
	border: 1px solid #2176ff;
	border-radius: 0.312rem;
	background: #2176ff; /* accent_blue */
	color: #fff;
	font-size: 0.938rem;
	font-weight: 600;
	line-height: 1.406rem;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s cubic-bezier(0.4, 0, 1, 1);
}

.book-cta__submit:hover {
	border-color: #1a63dd;
	background: #1a63dd;
}

.book-cta__submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

.book-cta__footnote {
	grid-column: 1 / -1;
	margin: -0.35rem 0 0;
	color: #003049;
	font-size: 0.75rem;
	opacity: 0.55;
}

/* ------------------------------------------------------------ messages */

.book-cta__message {
	margin: 1.75rem 0 0;
	padding: 0.6rem 0.75rem;
	border: 1px solid #fecaca;
	border-radius: 0.375rem;
	background: #fef2f2;
	color: #b91c1c;
	font-size: 0.875rem;
	line-height: 1.45;
}

.book-cta__message--success {
	border-color: #d4e6f0;
	background: #d4e6f0; /* light_blue */
	color: #003049;
}

.book-cta__message[hidden] {
	display: none;
}

.book-cta__honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 767px) {
	.book-cta {
		padding-bottom: 2.5rem;
	}

	.book-cta__card {
		grid-template-columns: 1fr;
	}

	.book-cta__buy,
	.book-cta__signup {
		padding: 2rem 1.5rem;
	}

	.book-cta__buy-heading,
	.book-cta__headline {
		font-size: 1.5rem;
	}

	.book-cta__buy-description,
	.book-cta__description {
		max-width: none;
	}

	.book-cta__fields {
		grid-template-columns: 1fr;
		max-width: none;
	}

	.book-cta__card--signup-only .book-cta__signup {
		grid-template-columns: 1fr;
	}

	.book-cta__card--signup-only .book-cta__fields {
		margin-top: 1.75rem;
	}

	.book-cta__submit {
		width: 100%;
		justify-self: stretch;
		text-align: center;
	}
}
