/* Generated by astro-product/scripts/sync-core.mjs from packages/foundation/components/contact-form. Do not edit. */
/*
 * Contact form (Contact Us, Contact Us Simple): title, intro, labelled fields, consent + submit, sent/error messages.
 * Sketch (contact-us.sketch): stacked column 455px, grid 616px (two 293px halves, 30px gap); label 16/19 and 23px above
 * a 60px field with a 1px grey frame; message box 235px; fields 30px apart; outlined 180×55 submit button.
 * The footer puts the button after the consent in reading order but on its left: when both fit on one row (grid) they
 * sit side by side, centred on each other, otherwise (stacked, narrow screens) the button wraps below the consent.
 * Required fields: * after the label (:has, so the editor preview shows it too) and a note above the fields that
 * explains it. Invalid fields: a dashed red frame and the reason in the error line under the control.
 * WP: core/group section > core/heading + core/paragraph + rtthemes/contact-form > rtthemes/contact-field.
 */
:where(.rt-contact-form) {
	color: var(--rt-color-contrast);
}

.rt-contact-form {
	box-sizing: border-box;
	inline-size: min(100%, 28.4375rem);
}

.rt-contact-form--grid {
	inline-size: min(100%, 38.5rem);
}

/* Sketch: Roboto Bold 26 in a 45px line; the theme's heading font at its subheading size */
.rt-contact-form__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: 2.8125rem;
}

/* 18/26, 19px under the title */
.rt-contact-form__intro {
	max-inline-size: 25.75rem;
	margin: 0;
	padding-block-start: 1.1875rem;
	color: var(--rt-color-contrast);
	font-size: var(--rt-font-size-base-plus);
	line-height: 1.4444;
}

/* 52px from the intro to the first label */
.rt-contact-form__form {
	margin: 0;
	padding-block-start: 3.25rem;
}

.rt-contact-form__title + .rt-contact-form__form {
	padding-block-start: var(--rt-spacing-50);
}

/* Explains the asterisk; hidden when no field is required */
.rt-contact-form__note {
	margin: 0;
	padding-block-end: var(--rt-spacing-40);
	color: var(--rt-color-body);
	font-size: var(--rt-font-size-small);
	line-height: 1.5;
}

@supports selector(:has(*)) {
	.rt-contact-form__form:not(:has(.rt-contact-form__field :required)):not(:has(.rt-contact-form__field[data-required])) .rt-contact-form__note {
		display: none;
	}
}

.rt-contact-form__fields {
	display: flex;
	flex-wrap: wrap;
	gap: 1.875rem;
}

.rt-contact-form__field {
	display: flex;
	flex: 1 1 100%;
	flex-direction: column;
	gap: 1.4375rem;
	min-inline-size: 0;
}

/* Hidden by conditional logic, and hidden fields: the flex display must not win over [hidden] */
.rt-contact-form__field[hidden] {
	display: none;
}

/* Label not shown: still read by screen readers (and named in the email); the asterisk moves into the field's corner */
.rt-contact-form__field--label-hidden {
	position: relative;
}

.rt-contact-form__field--label-hidden .rt-contact-form__label,
.rt-contact-form__field--label-hidden .rt-contact-form__legend {
	position: absolute;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.rt-contact-form__field--label-hidden:has(:required)::after,
.rt-contact-form__field--label-hidden[data-required]::after {
	content: "*";
	content: "*" / "";
	position: absolute;
	inset-block-start: 0.5rem;
	inset-inline-end: 0.625rem;
	color: var(--rt-contact-form-error);
	font-size: var(--rt-font-size-base);
	line-height: 1;
	pointer-events: none;
}

/* Single-line fields: the asterisk sits on the field's middle (the * glyph is drawn high, hence 30% instead of 50%);
   the long text: on its first line. Text keeps clear of it. */
.rt-contact-form__field--label-hidden:has(.rt-contact-form__input:required)::after {
	inset-block-start: 1.875rem;
	inset-inline-end: 1.25rem;
	transform: translateY(-30%);
}

.rt-contact-form__field--label-hidden:has(textarea.rt-contact-form__input:required)::after {
	inset-block-start: 1.8125rem;
}

.rt-contact-form__field--label-hidden .rt-contact-form__input:required {
	padding-inline-end: var(--rt-spacing-50);
}

.rt-contact-form__field--label-hidden select.rt-contact-form__input:required {
	padding-inline-end: 4.25rem;
	background-position: right 2.5rem center;
}

/* Radio buttons and checkboxes: a fieldset; the floated legend lays out like the other fields' labels */
.rt-contact-form__field--choices {
	margin: 0;
	padding: 0;
	border: 0;
}

.rt-contact-form__legend {
	float: inline-start;
	inline-size: 100%;
	margin: 0;
	padding: 0;
}

.rt-contact-form__choices {
	display: flex;
	clear: both;
	flex-direction: column;
	gap: 0.875rem;
}

.rt-contact-form__choices--inline {
	flex-flow: row wrap;
	gap: 0.875rem 1.875rem;
}

.rt-contact-form__choice {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: var(--rt-font-size-base);
	line-height: 1.5;
	cursor: pointer;
}

.rt-contact-form__option {
	flex: none;
	inline-size: 1.125rem;
	block-size: 1.125rem;
	margin: 0.1875rem 0 0;
	margin-block-start: calc((1lh - 1.125rem) / 2);
	/* Form controls default to their own font and line height; 1lh must be the text's */
	font-size: inherit;
	line-height: inherit;
	accent-color: var(--rt-color-contrast);
	cursor: pointer;
}

.rt-contact-form__option[aria-invalid="true"] {
	outline: 2px dashed var(--rt-contact-form-error);
	outline-offset: 2px;
}

/* Two halves share a row; below 12rem each they wrap to full rows */
.rt-contact-form__field--half {
	flex-basis: max(12rem, calc(50% - 0.9375rem));
}

.rt-contact-form__label {
	font-size: var(--rt-font-size-base);
	line-height: 1.1875;
}

/* Required: an asterisk after the label; screen readers get the control's required state instead */
.rt-contact-form__field:has(:required) .rt-contact-form__label::after,
.rt-contact-form__field[data-required] .rt-contact-form__label::after {
	content: " *";
	content: " *" / "";
	color: var(--rt-contact-form-error);
}

.rt-contact-form__input {
	box-sizing: border-box;
	inline-size: 100%;
	block-size: 3.75rem;
	margin: 0;
	padding: 0 1.25rem;
	border: 1px solid var(--rt-contact-form-field-border);
	border-radius: 0;
	background-color: var(--rt-color-base);
	color: var(--rt-color-contrast);
	font-family: inherit;
	font-size: var(--rt-font-size-base);
	line-height: 1.5;
	appearance: none;
}

textarea.rt-contact-form__input {
	display: block;
	block-size: 14.6875rem;
	padding-block: 1.0625rem;
	resize: vertical;
}

/* Dropdown: a chevron drawn in the field's text colour */
select.rt-contact-form__input {
	padding-inline-end: 3rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E");
	background-position: right 1.25rem center;
	background-repeat: no-repeat;
	background-size: 0.75rem;
	cursor: pointer;
}

.rt-contact-form__input::placeholder {
	color: var(--rt-color-body);
	opacity: 0.7;
}

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

.rt-contact-form__input:user-invalid,
.rt-contact-form__input[aria-invalid="true"] {
	border-style: dashed;
	border-color: var(--rt-contact-form-error);
}

/* The reason under an invalid control (8px below it, inside the field's 23px label gap rhythm) */
.rt-contact-form__error {
	margin-block-start: -0.9375rem;
	color: var(--rt-contact-form-error);
	font-size: var(--rt-font-size-small);
	line-height: 1.4;
}

.rt-contact-form__consent .rt-contact-form__error {
	flex-basis: 100%;
	margin-block-start: -0.25rem;
	padding-inline-start: 1.875rem;
}

.rt-contact-form__checkbox[aria-invalid="true"] {
	outline: 2px dashed var(--rt-contact-form-error);
	outline-offset: 2px;
}

/* Stacked: consent 30px under the message box, button 33px under the consent. Grid: one row, button 24px left of it */
.rt-contact-form__footer {
	display: flex;
	flex-flow: row-reverse wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 2.0625rem var(--rt-spacing-40);
	padding-block-start: 1.875rem;
}

.rt-contact-form--grid .rt-contact-form__footer {
	padding-block-start: 2.875rem;
}

.rt-contact-form__consent {
	display: flex;
	flex: 1 1 20rem;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: var(--rt-font-size-small);
	line-height: 1.5;
}

.rt-contact-form__consent-text {
	flex: 1 1 0;
	min-inline-size: 0;
}

/* Centred on the first line of the text (1lh = its line height): centred next to one line, level with the first of two */
.rt-contact-form__checkbox {
	flex: none;
	inline-size: 1.125rem;
	block-size: 1.125rem;
	margin: 0.0625rem 0 0;
	margin-block-start: calc((1lh - 1.125rem) / 2);
	/* Form controls default to their own font and line height; 1lh must be the text's */
	font-size: inherit;
	line-height: inherit;
	accent-color: var(--rt-color-contrast);
}

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

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

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

/* Outlined 180×55; hover fills it like the theme's buttons */
.rt-contact-form__submit {
	flex: none;
	box-sizing: border-box;
	min-inline-size: 11.25rem;
	block-size: 3.4375rem;
	margin: 0;
	padding: 0 var(--rt-spacing-40);
	border: 1px solid var(--rt-color-contrast);
	border-radius: var(--rt-button-radius);
	background-color: transparent;
	color: var(--rt-color-contrast);
	font-family: inherit;
	font-size: var(--rt-button-font-size);
	font-weight: var(--rt-font-weight-medium);
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

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

/* Sending: the button waits */
.rt-contact-form__form[aria-busy="true"] .rt-contact-form__submit {
	opacity: 0.6;
	cursor: progress;
}

/* Form messages: a band under the button, accent edge when sent, error edge otherwise */
.rt-contact-form__notice {
	margin: var(--rt-spacing-40) 0 0;
	padding: var(--rt-spacing-30) 1.25rem;
	border-inline-start: 3px solid var(--rt-color-accent);
	background-color: var(--rt-color-surface);
	font-size: var(--rt-font-size-base);
	line-height: 1.5;
}

.rt-contact-form__notice--invalid,
.rt-contact-form__notice--failed,
.rt-contact-form__notice--limited {
	border-inline-start-color: var(--rt-contact-form-error);
}

@media (max-width: 37.5rem) {
	.rt-contact-form__form {
		padding-block-start: var(--rt-spacing-50);
	}

	.rt-contact-form__fields {
		gap: var(--rt-spacing-40);
	}

	.rt-contact-form__field {
		gap: 0.75rem;
	}

	.rt-contact-form--grid .rt-contact-form__footer {
		padding-block-start: 1.875rem;
	}

	.rt-contact-form__submit {
		flex-grow: 1;
	}
}
