/**
 * Footer newsletter signup (Mailchimp): a full-width strip at the top of the footer.
 * Markup: overrides/scaffolding/footer.twig.
 *
 * Hand-maintained plain CSS, enqueued after style.css by class-honeycom3-theme.php,
 * because the theme's SCSS build is not part of deployment. Fold it into
 * assets/src/sass/core/_footer.scss if that changes. Colours are the Kalayaan
 * palette from assets/src/sass/helpers/_colors.scss.
 */

/* The strip takes over the footer's top padding so it sits flush against the content
   above (the brighter brand purple keeps it distinct from a lilac section above and from
   the dark footer below). */
.section.footer {
	padding-top: 0;
}

.footer-newsletter {
	background-color: #764BC7;
	color: #fff;
	margin: 0 0 2.5rem;
	padding: 1.5rem 0;
	width: 100%;
}

.footer-newsletter .container {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.footer .footer-newsletter-title {
	font-size: 1.375rem;
	margin: 0 0 0.375rem;
}

/* The global reset's auto side margins would centre the intro when it is stacked. */
.footer-newsletter-intro {
	margin: 0;
	width: 100%;
}

.footer-newsletter-intro p {
	font-size: 1rem;
	margin: 0;
}

.footer-newsletter-form {
	display: grid;
	gap: 0.75rem 1rem;
	grid-template-columns: minmax(0, 1fr);
	width: 100%;
}

/* The global reset gives block elements auto side margins, which would shrink and
   centre them in their grid cells. */
.footer-newsletter-form > * {
	margin: 0;
	min-width: 0;
}

.footer-newsletter-field label {
	display: block;
	font-size: 1rem;
	margin: 0 0 0.375rem;
}

.footer-newsletter-field input {
	background-color: #fff;
	border: 1px solid #fff;
	border-radius: 4px;
	color: #262626;
	font-size: 1.125rem;
	height: auto;
	line-height: 1.4;
	padding: 1rem 0.75rem; /* same height as the Subscribe button beside it */
	width: 100%;
}

.footer-newsletter-field input:focus {
	border-color: #fff;
	outline: 2px solid #D9FFD0;
	outline-offset: 2px;
}

.footer-newsletter-consent {
	align-items: flex-start;
	display: flex;
	gap: 0.5rem;
}

/* The global input rules size every input like a text field; restore a plain checkbox. */
.footer-newsletter-consent input[type="checkbox"] {
	accent-color: #D9FFD0;
	flex: 0 0 auto;
	float: none;
	height: 1.125rem;
	margin: 0.2rem 0 0;
	padding: 0;
	width: 1.125rem;
}

.footer-newsletter-consent label {
	display: inline;
	flex: 1 1 auto;
	font-size: 1rem;
	margin: 0; /* the reset's auto margins would centre it away from the checkbox */
}

.footer-newsletter-legal {
	font-size: 0.875rem;
	line-height: 1.5;
	opacity: 0.9;
}

.footer-newsletter-legal a {
	text-decoration: underline;
}

.footer-newsletter-legal a:hover {
	color: #D9FFD0;
}

/* Mailchimp's anti-spam field: kept off screen, never shown to people. */
.footer-newsletter-honeypot {
	left: -5000px;
	position: absolute;
}

.footer-newsletter-submit {
	cursor: pointer;
}

/* Email field and Subscribe button share a row once there is room; the button lines up
   with the input rather than the label above it. */
@media screen and (min-width: 560px) {
	.footer-newsletter-form {
		align-items: end;
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.footer-newsletter-consent,
	.footer-newsletter-legal {
		grid-column: 1 / -1;
	}
}

/* One horizontal strip: intro on the left, form on the right. */
@media screen and (min-width: 960px) {
	.footer-newsletter {
		padding: 2rem 0;
	}

	.footer-newsletter .container {
		align-items: flex-start;
		flex-direction: row;
		gap: 3rem;
	}

	.footer-newsletter-intro {
		flex: 0 0 18rem;
	}

	.footer-newsletter-form {
		flex: 1 1 auto;
		width: auto;
	}
}
