/**
 * Newsletter Signup block.
 *
 * A single card split into a portrait panel and the signup body, replacing the earlier
 * headline-in-a-narrow-column layout that left the section visibly off balance. The quote rides
 * along the foot of the portrait; the theme-hosted form replaced Kit's embedded one.
 *
 * 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` still comes from the theme.
 */

.newsletter-signup {
	background: #f9f7f1; /* light_beige — a shade deeper than the page, so the band reads */
	padding: 4.5rem 0;
}

.newsletter-signup__card {
	display: grid;
	grid-template-columns: 42% 58%;
	overflow: hidden;
	background: #fff;
	border-radius: 0.5rem;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.06);
}

/* ------------------------------------------------------------ portrait panel */

.newsletter-signup__figure {
	position: relative;
	min-height: 420px;
	margin: 0;
}

.newsletter-signup__figure img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	/* Top-aligned to keep the books balanced above Andrew's head in frame. */
	object-fit: cover;
	object-position: 50% 0;
}

.newsletter-signup__caption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 2.5rem 1.75rem 1.5rem;
	color: #fff;
	background: linear-gradient(transparent, rgba(84, 30, 30, 0.85));
}

.newsletter-signup__caption .newsletter-signup__quote {
	color: inherit;
}

/* ------------------------------------------------------------ quote */

.newsletter-signup__quote {
	margin: 0;
	color: #541e1e; /* dark_red, for the no-portrait fallback in the body */
}

.newsletter-signup__quote p {
	/* Roman body so the author's italics on "tell" and "ask" still read as emphasis. */
	margin: 0;
	font-size: 0.875rem;
	font-style: normal;
	line-height: 1.55;
}

.newsletter-signup__quote em,
.newsletter-signup__quote i {
	font-weight: 500;
	font-style: italic;
}

.newsletter-signup__attribution {
	display: block;
	margin-top: 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	font-style: normal;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.9;
}

/* ------------------------------------------------------------ body */

.newsletter-signup__body {
	align-self: center;
	padding: 3rem 3.25rem;
}

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

.newsletter-signup__headline {
	max-width: 22ch;
	margin: 0;
	color: #003049; /* dark_blue */
	font-size: 1.75rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.25;
}

.newsletter-signup__description,
.newsletter-signup__intro {
	max-width: 46ch;
	margin-top: 1.1rem;
	color: #003049;
	font-size: 0.9375rem;
	line-height: 1.6;
	opacity: 0.85;
}

.newsletter-signup__intro p:last-child,
.newsletter-signup__description p:last-child {
	margin-bottom: 0;
}

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

.newsletter-signup__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. */
.newsletter-signup__fields[hidden] {
	display: none;
}

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

.newsletter-signup__submit {
	grid-column: 1 / -1;
	justify-self: start;
	padding: 0.75rem 2rem;
	border: 1px solid #2176ff;
	border-radius: 0.312rem;
	background: #2176ff; /* accent_blue — solid, so the CTA carries weight */
	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);
}

.newsletter-signup__submit:hover {
	border-color: #1a63dd;
	background: #1a63dd;
}

.newsletter-signup__submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

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

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

.newsletter-signup__message {
	/* Opens where the fields would, so the confirmation that replaces them keeps their gap. */
	margin: 1.75rem 0 0.75rem;
	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;
}

.newsletter-signup__message--success {
	border-color: #d4e6f0;
	background: #d4e6f0;
	color: #003049;
}

.newsletter-signup__message[hidden] {
	display: none;
}

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

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

@media (max-width: 767px) {
	.newsletter-signup {
		padding: 2.5rem 0;
	}

	.newsletter-signup__card {
		grid-template-columns: 1fr;
	}

	.newsletter-signup__figure {
		min-height: 260px;
	}

	.newsletter-signup__caption {
		padding: 2rem 1.25rem 1.25rem;
	}

	.newsletter-signup__body {
		padding: 2rem 1.5rem;
	}

	.newsletter-signup__headline {
		max-width: none;
		font-size: 1.5rem;
	}

	.newsletter-signup__fields {
		grid-template-columns: 1fr;
		max-width: none;
	}

	.newsletter-signup__submit {
		width: 100%;
		justify-self: stretch;
		text-align: center;
	}
}
