/* Generated by astro-product/scripts/sync-core.mjs from packages/foundation/components/newsletter. Do not edit. */
/*
 * Newsletter band (home-2, home-6): full-width band, title on the left, @ email field + submit button on the right.
 * 1440: band 222px (84px above and below the 55px row), content column 1140px. Narrow screens: title above the form;
 * the button wraps below the field when the row gets too narrow (CSS only).
 * Consent row: appears once the visitor types an email; on wide screens it sits in the band's bottom padding,
 * so the band keeps its height.
 * WP: core/group section > core/heading + rtthemes/newsletter (static form block).
 */
:where(.rt-newsletter) {
	/* WP: the group's flex layout and block gap (markup) lay out the row */
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--rt-spacing-30) var(--rt-spacing-50);
	background-color: var(--rt-newsletter-surface-muted);
}

.rt-newsletter {
	padding: 5.25rem max(var(--rt-layout-root-padding-end, var(--rt-spacing-40)), (100% - var(--rt-layout-content, 71.25rem)) / 2 + var(--rt-bleed, 0px)) 5.25rem max(var(--rt-layout-root-padding-start, var(--rt-spacing-40)), (100% - var(--rt-layout-content, 71.25rem)) / 2 + var(--rt-bleed, 0px));
}

:where(.rt-newsletter--accent) {
	background-color: var(--rt-newsletter-surface-accent);
	color: var(--rt-color-body);
}

.rt-newsletter--accent {
	/* Yellow band: text uses the on-accent and on-image roles, so it stays readable in dark palettes */
	--rt-color-contrast: var(--rt-color-on-accent);
	--rt-color-body: color-mix(in srgb, var(--rt-color-on-accent) 80%, var(--rt-color-on-image));
	--rt-color-base: var(--rt-color-on-image);
}

/* Sketch: Fira Sans Bold 24/43; the theme uses its heading font (decision: no extra font for one title) */
.rt-newsletter__title {
	margin: 0;
	color: var(--rt-color-contrast);
	font-family: var(--rt-font-family-heading);
	font-size: var(--rt-font-size-large);
	font-weight: var(--rt-font-weight-bold);
	line-height: 1.7917;
}

/* Field 375 + 16 gap + button 164 */
.rt-newsletter__form {
	position: relative;
	display: flex;
	flex: 0 1 34.6875rem;
	flex-wrap: wrap;
	gap: var(--rt-spacing-30);
	margin: 0;
}

.rt-newsletter__field {
	position: relative;
	display: block;
	flex: 1 1 13rem;
	min-width: 0;
}

/* @ sign: 18px from the field edge, the text starts at 51px */
.rt-newsletter__field::before {
	content: "@";
	position: absolute;
	top: 50%;
	inset-inline-start: 1.125rem;
	color: var(--rt-color-contrast);
	font-size: var(--rt-font-size-base);
	font-weight: var(--rt-font-weight-bold);
	line-height: 1;
	pointer-events: none;
	transform: translateY(-50%);
}

.rt-newsletter__label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.rt-newsletter__input {
	box-sizing: border-box;
	width: 100%;
	height: 3.4375rem;
	margin: 0;
	padding: 0 var(--rt-spacing-30) 0 3.1875rem;
	border: 1px solid var(--rt-newsletter-field-border);
	border-radius: 0;
	background-color: transparent;
	color: var(--rt-color-contrast);
	font-family: inherit;
	font-size: var(--rt-font-size-base);
	font-weight: var(--rt-font-weight-bold);
	line-height: 1.25;
	appearance: none;
}

/* The design shows the placeholder in full contrast */
.rt-newsletter__input::placeholder {
	color: var(--rt-color-contrast);
	opacity: 1;
}

/* Focus: 2px dark frame drawn inside, so the field does not move */
.rt-newsletter__input:focus-visible {
	border-color: var(--rt-color-contrast);
	outline: 0;
	box-shadow: inset 0 0 0 1px var(--rt-color-contrast);
}

.rt-newsletter__input:user-invalid {
	border-style: dashed;
	border-color: var(--rt-color-contrast);
}

/* Button: the theme's button tokens (164×55 with the default padding) */
.rt-newsletter__submit {
	flex: 0 0 auto;
	box-sizing: border-box;
	block-size: 3.4375rem;
	margin: 0;
	padding: 0 var(--rt-button-pad-x);
	border: 2px solid var(--rt-button-border);
	border-radius: var(--rt-button-radius);
	background-color: var(--rt-button-bg);
	color: var(--rt-button-color);
	font-family: inherit;
	font-size: var(--rt-button-font-size);
	font-weight: var(--rt-button-font-weight);
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rt-newsletter__submit:hover {
	border-color: var(--rt-button-hover-border);
	background-color: var(--rt-button-hover-bg);
	color: var(--rt-button-hover-color);
}

.rt-newsletter__submit:focus-visible {
	outline: 2px solid var(--rt-color-contrast);
	outline-offset: 2px;
}

/* Black button (home-6, on the yellow band); hover turns it white */
.rt-newsletter__form--contrast .rt-newsletter__submit {
	border-color: var(--rt-color-contrast);
	background-color: var(--rt-color-contrast);
	color: var(--rt-color-base);
}

.rt-newsletter__form--contrast .rt-newsletter__submit:hover {
	border-color: var(--rt-color-base);
	background-color: var(--rt-color-base);
	color: var(--rt-color-contrast);
}

/* Consent: required checkbox + text with an optional privacy policy link */
.rt-newsletter__consent {
	display: flex;
	flex-basis: 100%;
	align-items: flex-start;
	gap: 0.625rem;
	color: var(--rt-color-contrast);
	font-size: var(--rt-font-size-small);
	line-height: 1.4;
	transition: opacity 0.2s ease, visibility 0.2s;
}

.rt-newsletter__checkbox {
	flex: none;
	width: 1rem;
	height: 1rem;
	margin: 0.125rem 0 0;
	accent-color: var(--rt-color-contrast);
}

/* Without a published privacy page WP drops the href: the words read as plain text */
.rt-newsletter__consent-text a {
	color: inherit;
	text-decoration: none;
}

.rt-newsletter__consent-text a[href] {
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.rt-newsletter__consent-text a[href]:hover {
	text-decoration-thickness: 2px;
}

/* Hidden while the email field is empty; where :has is unsupported the row is always shown */
@supports selector(:has(*)) {
	.rt-newsletter__form:has(.rt-newsletter__input:placeholder-shown) .rt-newsletter__consent {
		visibility: hidden;
		opacity: 0;
	}
}

@media (min-width: 64.0625rem) {
	.rt-newsletter__consent {
		position: absolute;
		top: calc(100% + 0.625rem);
		inset-inline: 0;
	}
}

/* Narrower: the row joins the flow below the field, so it takes no space until it appears */
@media (max-width: 64rem) {
	.rt-newsletter {
		padding-block: var(--rt-spacing-60);
	}

	@supports selector(:has(*)) {
		.rt-newsletter__form:has(.rt-newsletter__input:placeholder-shown) .rt-newsletter__consent {
			display: none;
		}
	}
}

/* Mobile: title above, the form takes the full row */
@media (max-width: 37.5rem) {
	.rt-newsletter {
		padding-block: var(--rt-spacing-50);
	}

	.rt-newsletter__title {
		line-height: var(--rt-font-line-height-heading);
	}

	.rt-newsletter__form {
		flex-basis: 100%;
	}

	.rt-newsletter__submit {
		flex-grow: 1;
	}
}
