/*
 * Forms (Contact Form 7, decision 15) and the newsletter block (Figma 7:389 desktop, 541:379 mobile). The plugin
 * stylesheet is not loaded; the rules it needs to work are repeated here. States not in Figma are ours (decision 11).
 */

/* Contact Form 7 essentials. */

.wpcf7 .screen-reader-response {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.wpcf7 .hidden-fields-container {
	display: none;
}

.wpcf7-form-control-wrap {
	position: relative;
	display: block;
}

.wpcf7-spinner {
	display: none;
}

/* Invalid field and its message. */

.field.wpcf7-not-valid {
	border-color: var(--color-error);
}

.wpcf7-not-valid-tip {
	display: block;
	margin-top: var(--space-8);
	color: var(--color-error);
	font-size: 12px;
	line-height: 1.4;
	text-align: left;
}

/* Sending: the button cannot be pressed again. */

.wpcf7-form.submitting .wpcf7-submit {
	opacity: 0.5;
	pointer-events: none;
	cursor: wait;
}

/* Response under the form; hidden while there is nothing to say. */

.wpcf7-form .wpcf7-response-output {
	margin-top: var(--space-16);
	color: var(--color-error);
	font-size: 13px;
	line-height: 1.5;
	text-align: center;
}

.wpcf7-form.sent .wpcf7-response-output {
	color: var(--color-primary);
}

.wpcf7-form.init .wpcf7-response-output,
.wpcf7-form.resetting .wpcf7-response-output,
.wpcf7-form.submitting .wpcf7-response-output {
	display: none;
}

/* Newsletter block. Mobile first; desktop composition from 768px. */

.newsletter {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-24);
	padding: 26px var(--page-padding) 20px;
	background: var(--color-white);
	text-align: center;
}

.newsletter__intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-12);
}

.newsletter__icon {
	width: 24px;
	height: 24px;
	color: var(--color-accent);
}

.newsletter__heading {
	margin: 0;
	color: var(--color-text);
	font-family: var(--font-serif);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0.36px;
	text-transform: uppercase;
}

.newsletter__description {
	max-width: 600px;
	margin: 0;
	color: var(--color-text-body);
	font-size: 14px;
	line-height: 1.4;
}

.newsletter-form {
	width: 100%;
}

.newsletter-form__row {
	display: flex;
	align-items: flex-start;
	gap: var(--space-16);
}

.newsletter-form__label {
	flex: 1 1 0;
	min-width: 0;
}

.newsletter-form__row .button {
	flex: none;
}

/* Invalid input: the message under the field is enough, the summary is only announced to screen readers. */
.newsletter-form .wpcf7-form.invalid .wpcf7-response-output {
	display: none;
}

.newsletter-form__note {
	margin: var(--space-8) 0 0;
	color: var(--color-text-muted);
	font-size: 12px;
	line-height: 1.5;
}

.newsletter-form__note a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.newsletter-form__note a:hover {
	color: var(--color-primary);
}

@media (min-width: 768px) {
	.newsletter {
		gap: var(--space-32);
		padding-block: var(--space-120);
	}

	.newsletter__heading {
		font-size: 32px;
		line-height: 1;
		letter-spacing: 0;
		text-transform: none;
	}

	.newsletter-form {
		max-width: 500px;
	}
}
