/**
 * eup-capture — the one mailing-list form, as the first row of the footer and inside the popup.
 *
 * Handle:  eup-capture
 * Loads:   every front-end page that carries the band or the popup
 * Markup:  template-parts/footer-v2/capture-band.php
 * Band:    rendered by template-parts/footer-v2/footer.php (Footer 2, D-069) as the footer's first
 *          row; not on checkout
 *
 * 2026-09-23, FOOTER 2 PORT (D-069)
 * ---------------------------------
 * The band moved from above the footer into it, and takes Footer 2's treatment
 * (`Footer-2.dc.html`, `Footer-phone.dc.html`): the warm page ground, a 1 px hairline on top,
 * the heading in the display serif, a white 52 px field with a visible label, a deep-green 48 px
 * button, the consent line underneath. **No teal anywhere in the band**: the button, the focus
 * ring and the success line are deep green.
 *
 * WHY THE BAND SELECTORS START WITH `#footer`
 * -----------------------------------------
 * Two things now reach the form that did not when it sat above the footer:
 *   - site-legacy.css (X-169, not owned here) styles `footer #mailpoet_form_1 …` with
 *     `!important` — a transparent absolutely-positioned grey submit, a borderless underlined
 *     field — written for the old Flatsome footer's signup;
 *   - MailPoet writes inline `style` attributes on the field and the button (width 100%,
 *     padding 12px, a transparent border).
 * An id selector plus three classes outranks the legacy rules without naming a form id (ids are
 * database records and differ per environment), and the handful of `!important`s below are the
 * ones that answer an `!important` or an inline style; each is marked.
 *
 * TOKENS
 * ------
 * The `:root` block below is a compatibility shim: until the system stylesheet (`eup-system-v2`)
 * is on everywhere, other sheets (header-v2.css, consent.css) read these names from here. The
 * values are unchanged except `--eup-gutter`, which now follows the token contract (44 / 30 under
 * 1024 / 20 under 768) instead of this file's old 20 / 32 / 44, so the two sheets cannot disagree
 * about the page gutter. `--eup-brand` stays defined for those sheets; nothing in this file
 * uses it.
 *
 * Phone first: the single-column stack is the default; the two-column band starts at 1024.
 */

:root {
	--eup-brand: #00ccb8;
	--eup-brand-text: #0e7a70;
	--eup-deep: #123f3a;
	--eup-deepest: #0c2b27;
	--eup-ink: #17211e;
	--eup-muted: #565f5b;
	--eup-line: #dcd3c0;
	--eup-hairline: #dcd3c0;
	--eup-line-soft: #e8e2d4;
	--eup-ground: #f4f0e6;
	--eup-surface: #ffffff;
	--eup-surface-alt: #f7f5ef;
	--eup-wrap: 1400px;
	--eup-gutter: 20px;
}

@media screen and (min-width: 768px) {
	:root {
		--eup-gutter: 30px;
	}
}

@media screen and (min-width: 1024px) {
	:root {
		--eup-gutter: 44px;
	}
}

/* -------------------------------------------------------------------------
 * The band
 * ---------------------------------------------------------------------- */

.eup-capture--band {
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 28px 0;
	background-color: var(--eup-ground, #f4f0e6);
	border-top: 1px solid var(--eup-hairline, #dcd3c0);
	color: var(--eup-ink);
	text-align: left;
}

.eup-capture--band * {
	box-sizing: border-box;
}

/* Same box as the footer's `.eup-ft__wrap`, so the band and the columns share one left edge. */
.eup-capture--band .eup-capture__inner {
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: 100%;
	max-width: var(--eup-wrap);
	margin: 0 auto;
	padding: 0 var(--eup-gutter);
}

.eup-capture--band .eup-capture__copy {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
}

.eup-capture--band .eup-capture__title {
	margin: 0;
	font-family: var(--eup-font-display, "Newsreader", Georgia, "Times New Roman", serif);
	font-size: 26px;
	font-weight: 300;
	line-height: 1.15;
	letter-spacing: 0;
	color: var(--eup-ink);
	text-transform: none;
	text-wrap: balance;
}

.eup-capture--band .eup-capture__lead {
	max-width: 460px;
	margin: 0;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.65;
	color: var(--eup-muted);
}

.eup-capture--band .eup-capture__form {
	width: 100%;
	max-width: 560px;
	margin: 0;
}

/* The visible label capture-band.php puts in front of MailPoet's email field. */
.eup-capture--band .eup-capture__label {
	display: block;
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--eup-muted);
	cursor: pointer;
}

/* -------------------------------------------------------------------------
 * The success line
 *
 * Printed by PHP only on the request that follows a completed subscription, so these rules are
 * dormant on every other page view. `role="status"` is on the element, not announced by CSS.
 * ---------------------------------------------------------------------- */

.eup-capture .eup-capture__success {
	margin: 0 0 12px;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--eup-deep);
	background-color: var(--eup-surface);
	border: 1px solid var(--eup-deep);
	border-radius: 3px;
}

/* -------------------------------------------------------------------------
 * MailPoet's markup, inside the band only
 *
 * Scoped to `#footer .eup-capture--band` so that the popup keeps the treatment popup.css (X-158)
 * already gives the same form inside the modal. One form definition, two surfaces.
 * ---------------------------------------------------------------------- */

#footer .eup-capture--band .mailpoet_form {
	margin: 0;
	padding: 0;
	background: none;
}

#footer .eup-capture--band .eup-capture__form form.mailpoet_form {
	margin: 0;
	padding: 0;
}

#footer .eup-capture--band .mailpoet_paragraph {
	position: static;
	margin: 0 0 12px;
}

#footer .eup-capture--band .mailpoet_paragraph:last-of-type {
	margin-bottom: 0;
}

#footer .eup-capture--band .eup-capture__form .mailpoet_text {
	display: block;
	width: 100% !important; /* MailPoet inline style. */
	height: 52px;
	min-height: 52px;
	margin: 0 !important; /* MailPoet inline style; legacy `footer input` !important. */
	padding: 0 16px !important; /* MailPoet inline style; legacy !important. */
	font-family: var(--eup-font-body, "Poppins", system-ui, sans-serif) !important; /* legacy !important */
	font-size: 16px; /* 16px or iOS zooms the page on focus. */
	font-weight: 400;
	line-height: 1.3;
	color: var(--eup-ink);
	/* Colour only (2026-10-01): the `background` shorthand with !important also forced
	   background-repeat to `repeat`, tiling a browser extension's field icon across the field. */
	background-color: var(--eup-surface) !important; /* legacy !important */
	background-repeat: no-repeat;
	border: 1px solid var(--eup-hairline, #dcd3c0) !important; /* legacy !important */
	border-radius: 3px;
	box-shadow: none;
}

#footer .eup-capture--band .eup-capture__form .mailpoet_text::placeholder {
	color: var(--eup-muted);
	font-weight: 300;
	opacity: 1;
}

#footer .eup-capture--band .eup-capture__form .mailpoet_text:focus {
	outline: 3px solid var(--eup-deep);
	outline-offset: 2px;
	border-color: var(--eup-deep) !important; /* pairs with the !important above */
	box-shadow: none;
}

#footer .eup-capture--band .eup-capture__form .mailpoet_submit {
	position: static; /* legacy: absolute, bottom right */
	display: block;
	width: 100% !important; /* MailPoet inline style. */
	height: 52px;
	min-height: 48px;
	margin: 0 !important; /* MailPoet inline style. */
	padding: 0 26px !important; /* MailPoet inline style. */
	font-family: var(--eup-font-body, "Poppins", system-ui, sans-serif);
	font-size: 16px;
	font-weight: 500 !important; /* legacy !important */
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: #fff !important; /* legacy !important */
	background-color: var(--eup-deep) !important; /* legacy !important */
	border: 1px solid var(--eup-deep) !important; /* legacy !important; MailPoet inline transparent */
	border-radius: 3px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
}

#footer .eup-capture--band .eup-capture__form .mailpoet_submit:hover {
	background-color: var(--eup-deepest) !important;
	border-color: var(--eup-deepest) !important;
}

#footer .eup-capture--band .eup-capture__form .mailpoet_submit:focus-visible {
	outline: 3px solid var(--eup-deep);
	outline-offset: 2px;
}

/* The consent checkbox and its one label — the only consent sentence on the control. */
#footer .eup-capture--band .mailpoet_checkbox_label {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 0;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.55;
	color: var(--eup-muted);
	cursor: pointer;
}

#footer .eup-capture--band .mailpoet_checkbox {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 1px 0 0 !important; /* legacy `footer input` !important */
	accent-color: var(--eup-deep);
}

#footer .eup-capture--band .mailpoet_checkbox:focus-visible {
	outline: 3px solid var(--eup-deep);
	outline-offset: 2px;
}

#footer .eup-capture--band fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

#footer .eup-capture--band .mailpoet_message {
	margin: 0;
	padding: 0;
}

#footer .eup-capture--band .mailpoet_validate_success,
#footer .eup-capture--band .mailpoet_validate_error {
	margin: 10px 0 0;
	font-size: 14px;
	line-height: 1.5;
}

#footer .eup-capture--band .mailpoet_validate_success {
	color: var(--eup-deep) !important; /* MailPoet's form-level colour is a teal-green; one accent only. */
}

#footer .eup-capture--band .parsley-errors-list {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	line-height: 1.4;
}

#footer .eup-capture--band .parsley-errors-list li {
	margin: 0;
}

/* -------------------------------------------------------------------------
 * 600 and up — field and button on one row, consent line under both
 * ---------------------------------------------------------------------- */

@media screen and (min-width: 600px) {

	#footer .eup-capture--band .eup-capture__form form.mailpoet_form {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-end;
		gap: 14px 12px;
	}

	/*
	 * Full width is the base, so a browser without `:has()` gets the phone stack on a wider
	 * screen rather than four controls crushed into one row. The rules below opt the email field
	 * and the button out of it.
	 */
	#footer .eup-capture--band .mailpoet_paragraph {
		flex: 1 1 100%;
		margin: 0;
	}

	#footer .eup-capture--band .mailpoet_paragraph:has(.mailpoet_text) {
		flex: 1 1 240px;
	}

	#footer .eup-capture--band .mailpoet_paragraph:has(.mailpoet_submit) {
		flex: 0 0 auto;
	}

	#footer .eup-capture--band .eup-capture__form .mailpoet_submit {
		width: auto !important; /* MailPoet inline width 100%. */
		height: 52px;
	}

	#footer .eup-capture--band .mailpoet_paragraph:has(.mailpoet_checkbox_label) {
		flex: 1 1 100%;
		order: 3;
	}

	#footer .eup-capture--band .mailpoet_message {
		flex: 1 1 100%;
		order: 4;
	}
}

/* -------------------------------------------------------------------------
 * 768 and up
 * ---------------------------------------------------------------------- */

@media screen and (min-width: 768px) {

	.eup-capture--band {
		padding-top: 40px;
		padding-bottom: 40px;
	}

	.eup-capture--band .eup-capture__title {
		font-size: 30px;
	}

	.eup-capture--band .eup-capture__lead {
		font-size: 15px;
	}

	.eup-capture--band .eup-capture__label {
		font-size: 12px;
	}
}

/* -------------------------------------------------------------------------
 * 1024 and up — copy left, form right (Footer 2: 1fr and 560)
 * ---------------------------------------------------------------------- */

@media screen and (min-width: 1024px) {

	.eup-capture--band {
		padding-top: var(--eup-section-pad, 48px);
		padding-bottom: var(--eup-section-pad, 48px);
	}

	.eup-capture--band .eup-capture__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
		align-items: center;
		gap: clamp(40px, 5.5vw, 80px);
	}

	.eup-capture--band .eup-capture__title {
		font-size: 32px;
	}
}

/* -------------------------------------------------------------------------
 * Inside the popup
 *
 * The same partial, so the copy block needs to stop being a band. Everything else about the form
 * is popup.css's business and is left alone.
 * ---------------------------------------------------------------------- */

.eup-capture--popup {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
}

.eup-capture--popup .eup-capture__inner {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
}

.eup-capture--popup .eup-capture__title {
	margin: 0 0 6px;
}

.eup-capture--popup .eup-capture__lead {
	margin: 0 0 14px;
}

@media (prefers-reduced-motion: reduce) {
	#footer .eup-capture--band .eup-capture__form .mailpoet_submit {
		transition: none;
	}
}
