/*
 * Newsletter signup.
 *
 * Two variants of one block:
 *   .hcr-newsletter--band    a full-width dark section over the roastery photo,
 *                            headline and form side by side from the medium
 *                            breakpoint up.
 *   .hcr-newsletter--compact a footer column: stacked, inherits the footer's
 *                            own colours.
 *
 * Every colour comes from the design tokens, so the block stays readable in
 * either theme. Mobile-first, no fixed layout widths.
 */

.hcr-newsletter {
	box-sizing: border-box;
}

.hcr-newsletter *,
.hcr-newsletter *::before,
.hcr-newsletter *::after {
	box-sizing: inherit;
}

.hcr-newsletter__inner {
	display: grid;
	gap: var(--space-6);
}

.hcr-newsletter__title {
	margin: 0 0 var(--space-3);
	font-family: var(--font-heading);
	font-weight: var(--weight-bold);
	letter-spacing: var(--letter-tight);
	line-height: var(--leading-tight);
}

.hcr-newsletter__text {
	margin: 0;
	font-family: var(--font-body);
	line-height: var(--leading-normal);
	max-width: 46ch;
}

.hcr-newsletter__form {
	display: grid;
	gap: var(--space-3);
	align-content: start;
}

.hcr-newsletter__field {
	display: grid;
	gap: var(--space-2);
	margin: 0;
}

.hcr-newsletter__label {
	font-family: var(--font-body);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

.hcr-newsletter__input {
	width: 100%;
	padding: var(--space-3) var(--space-4);
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-md);
	background-color: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-snug);
	transition: border-color var(--duration-fast) var(--ease-default),
		box-shadow var(--duration-fast) var(--ease-default);
}

.hcr-newsletter__input:hover {
	border-color: var(--color-primary-300);
}

.hcr-newsletter__input:focus-visible {
	outline: 3px solid var(--color-accent-400);
	outline-offset: 2px;
	border-color: var(--color-primary-600);
}

.hcr-newsletter__input[aria-invalid="true"] {
	border-color: var(--color-error);
	box-shadow: 0 0 0 1px var(--color-error);
}

.hcr-newsletter__submit {
	justify-self: start;
	padding: var(--space-3) var(--space-6);
	border: 0;
	border-radius: var(--radius-full);
	background-color: var(--color-primary-600);
	color: var(--color-on-primary);
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: var(--weight-medium);
	letter-spacing: var(--letter-wide);
	cursor: pointer;
	transition: background-color var(--duration-fast) var(--ease-default),
		transform var(--duration-fast) var(--ease-default),
		box-shadow var(--duration-fast) var(--ease-default);
}

.hcr-newsletter__submit:hover {
	background-color: var(--color-primary-700);
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

.hcr-newsletter__submit:focus-visible {
	outline: 3px solid var(--color-accent-400);
	outline-offset: 3px;
}

.hcr-newsletter__submit:active {
	transform: none;
}

/* The honeypot: out of sight, out of the tab order, still in the DOM. */
.hcr-newsletter__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
	margin: 0;
}

.hcr-newsletter__status {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-sm);
	line-height: var(--leading-snug);
}

/* Empty live region: present for assistive tech, invisible on the page. */
.hcr-newsletter__status:empty {
	margin: 0;
	padding: 0;
}

.hcr-newsletter__status--success,
.hcr-newsletter__status--notice,
.hcr-newsletter__status--error {
	padding: var(--space-3) var(--space-4);
	border-left: 3px solid currentColor;
	border-radius: var(--radius-sm);
	font-weight: var(--weight-medium);
}

.hcr-newsletter__status--success {
	color: var(--color-success);
	background-color: rgba(22, 163, 74, 0.1);
}

.hcr-newsletter__status--notice {
	color: var(--color-accent-700);
	background-color: rgba(217, 146, 26, 0.12);
}

.hcr-newsletter__status--error {
	color: var(--color-error);
	background-color: rgba(220, 38, 38, 0.1);
}

.hcr-newsletter__hint {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-xs);
	line-height: var(--leading-snug);
	color: var(--color-text-muted);
}

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

.hcr-newsletter--band {
	position: relative;
	isolation: isolate;
	padding: var(--space-section) var(--container-padding);
	background-color: var(--color-surface-dark);
	background-image: url("../images/section-about.jpg");
	background-size: cover;
	background-position: center;
	color: var(--color-neutral-50);
	overflow: hidden;
}

.hcr-newsletter--band::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--overlay-hero, linear-gradient(180deg, rgba(28, 25, 23, 0.25) 0%, rgba(28, 25, 23, 0.6) 100%)),
		rgba(28, 25, 23, 0.6);
}

.hcr-newsletter--band .hcr-newsletter__inner {
	max-width: var(--container-max);
	margin-inline: auto;
	gap: var(--space-8);
}

.hcr-newsletter--band .hcr-newsletter__title {
	font-size: var(--text-3xl);
}

.hcr-newsletter--band .hcr-newsletter__text {
	color: var(--color-neutral-200);
	font-size: var(--text-lg);
}

.hcr-newsletter--band .hcr-newsletter__label,
.hcr-newsletter--band .hcr-newsletter__hint {
	color: var(--color-neutral-200);
}

.hcr-newsletter--band .hcr-newsletter__status--success {
	color: var(--color-neutral-50);
	background-color: rgba(22, 163, 74, 0.35);
}

.hcr-newsletter--band .hcr-newsletter__status--notice {
	color: var(--color-neutral-50);
	background-color: rgba(217, 146, 26, 0.35);
}

.hcr-newsletter--band .hcr-newsletter__status--error {
	color: var(--color-neutral-50);
	background-color: rgba(220, 38, 38, 0.4);
}

@media (min-width: 48em) {
	.hcr-newsletter--band .hcr-newsletter__inner {
		grid-template-columns: 1.1fr 1fr;
		align-items: center;
		gap: var(--space-12);
	}

	.hcr-newsletter--band .hcr-newsletter__form {
		padding: var(--space-6);
		border-radius: var(--radius-xl);
		background-color: rgba(250, 250, 249, 0.08);
		backdrop-filter: blur(2px);
		/* Field and button side by side from here up; the message and the hint
		   keep the full width beneath them. The honeypot is out of flow. */
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: end;
	}

	.hcr-newsletter--band .hcr-newsletter__field {
		grid-column: 1;
	}

	.hcr-newsletter--band .hcr-newsletter__submit {
		grid-column: 2;
		align-self: end;
	}

	.hcr-newsletter--band .hcr-newsletter__status,
	.hcr-newsletter--band .hcr-newsletter__hint {
		grid-column: 1 / -1;
	}
}

/* ---------------------------------------------------------- compact ------- */

.hcr-newsletter--compact .hcr-newsletter__title {
	font-size: var(--text-lg);
}

.hcr-newsletter--compact .hcr-newsletter__inner {
	gap: var(--space-4);
}

.hcr-newsletter--compact .hcr-newsletter__text {
	font-size: var(--text-sm);
	max-width: 36ch;
}

.hcr-newsletter--compact .hcr-newsletter__submit {
	justify-self: stretch;
	text-align: center;
}

/*
 * Inside the dark footer the compact variant borrows the footer's own type
 * treatment and light-on-dark colours, so no light panel is ever stamped onto
 * the dark band.
 */
.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__title {
	color: var(--color-neutral-50);
	font-size: var(--text-sm);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--letter-wide);
	text-transform: uppercase;
}

.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__text,
.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__label,
.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__hint {
	color: var(--color-neutral-300);
}

.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__input {
	border-color: var(--color-neutral-700);
	background-color: var(--color-neutral-800);
	color: var(--color-neutral-50);
}

.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__status--success {
	color: var(--color-neutral-50);
	background-color: rgba(22, 163, 74, 0.35);
}

.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__status--notice {
	color: var(--color-neutral-50);
	background-color: rgba(217, 146, 26, 0.35);
}

.hcr-site-footer .hcr-newsletter--compact .hcr-newsletter__status--error {
	color: var(--color-neutral-50);
	background-color: rgba(220, 38, 38, 0.4);
}

@media (prefers-reduced-motion: reduce) {
	.hcr-newsletter__input,
	.hcr-newsletter__submit {
		transition: none;
	}

	.hcr-newsletter__submit:hover {
		transform: none;
	}
}
