/* gravity-forms: Gravity Forms output in both of its markups, gravity-theme (form 3 on /contact/, the chapter
   contact forms) and legacy (form 1 in the footer newsletter, form 2 on /chapters/): fields, labels,
   descriptions, checkboxes and radios, the submit button, validation (contract 1.1 rule 7) and the focus ring
   (1.7 rule 1); inside .caw-footer__newsletter, visible white labels and the on-dark submit (2.7, spec 6.6).
   Views: every view (the footer newsletter) and every view that holds a form.

   Selectors start with `body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper)` (specificity
   0,2,1), one step above Gravity Forms' own `.gform_wrapper.gravity-theme` (0,2,0) and
   `.gform_legacy_markup_wrapper` (0,1,0), because the legacy stylesheets print after this file when the form
   sits in the footer. Where the legacy stylesheet chains six :not() on a text input, a legacy-only selector
   repeats the chain. */

/* Text. */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--roboto);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .gfield_label {
	color: var(--wp--preset--color--heading-grey);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	line-height: 1.5;
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield_required {
	color: var(--wp--preset--color--ink);
	font-size: 1em;
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gfield .gfield_description, .gform_required_legend, .gfield .instruction) {
	color: var(--wp--preset--color--meta-grey);
	font-size: var(--wp--preset--font-size--small);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield :is(.gfield_checkbox, .gfield_radio, .gchoice label) {
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
}

/* Fields (2.7 "Form fields everywhere"): white, ink text, a 1px meta-grey border, meta-grey placeholder. */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield :is(input:not([type="radio"], [type="checkbox"], [type="submit"], [type="button"], [type="image"], [type="file"], [type="hidden"]), select, textarea),
body .gform_wrapper.gform_legacy_markup_wrapper .gfield input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]) {
	background-color: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--meta-grey);
	border-radius: 0;
	color: var(--wp--preset--color--ink);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.5;
	max-width: 100%;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}

/* On a phone every field takes the full width: a field the form sizes small or medium (Gravity Forms gives them a
   quarter and a half of the row) would otherwise stand narrower than its label. A field that shares its row with a
   companion (the date field's calendar button, a picture beside an input) is a row of its own: the field takes the rest
   of the row and the companion keeps its size beside it. Gravity Forms leaves room for the icon of a large date field
   with `calc(100% - 48px)`, a rule more specific than the one above; the flex row replaces it. */
@media (max-width: 599.98px) {
	body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield :is(input, select, textarea):is(.small, .medium, .large) {
		width: 100%;
	}

	body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .ginput_container:has(> :is(button, img)) {
		align-items: center;
		display: flex;
		gap: var(--wp--preset--spacing--30);
	}

	body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .ginput_container:has(> :is(button, img)) > :is(input, select, textarea) {
		flex: 1 1 0;
		min-inline-size: 0;
		width: auto;
	}

	body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .ginput_container:has(> :is(button, img)) > :is(button, img) {
		flex: none;
		margin-inline: 0;
	}
}

/* The time field prints hours, minutes and AM/PM as three 64px columns (`.ginput_container_time`); with the field padding above
   that left 30px for the text, so the placeholder "HH" and the select's "AM" were cut off (on a phone and on a desktop alike).
   The column is widened, not the control: the control stays at 100% of its column, so it cannot cover the colon or touch
   its neighbour. */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .ginput_container_time {
	flex-basis: 5rem;
	max-width: none;
	min-width: 5rem;
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .ginput_container_time :is(input, select) {
	box-sizing: border-box;
	padding-inline: var(--wp--preset--spacing--30);
	width: 100%;
}

/* A select is as tall as the text inputs (master ruling 87): Chrome draws a native select without the line-height
   above, so it came out 41px beside 45px inputs. */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield select {
	min-block-size: calc(1.5em + 2 * var(--wp--preset--spacing--30) + 2px);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield :is(input, textarea)::placeholder {
	color: var(--wp--preset--color--meta-grey);
	opacity: 1;
}

/* Checkboxes and radios: teal-strong, at least 20px. */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .gchoice {
	align-items: flex-start;
	display: flex;
	gap: var(--wp--preset--spacing--30);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield :is(input[type="radio"], input[type="checkbox"]) {
	accent-color: var(--wp--preset--color--teal-strong);
	color: var(--wp--preset--color--ink);
	flex: none;
	height: 1.25rem;
	margin: 0.125rem 0 0;
	width: 1.25rem;
}

/* The consent checkbox sits beside its label, as a choice does, and the label has the choice-label look (master
   ruling 87): Gravity Forms prints it inline, so its lines wrapped under the box at 1.2 leading. */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .ginput_container_consent {
	align-items: flex-start;
	display: flex;
	gap: var(--wp--preset--spacing--30);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .gfield_consent_label {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	line-height: 1.5;
}

/* Width (rule L20, master ruling 87): a form that is a direct child of a constrained section keeps the text width.
   The legacy stylesheet's `.gform_legacy_markup_wrapper { max-width: 100% }` overrides core's cap; the L20 margins
   already start the form at the wide edge. */
body .wp-block-group.is-layout-constrained > .gform_wrapper:not(.alignwide, .alignfull) {
	max-width: var(--wp--style--global--content-size);
}

/* The submit button: the primary button of 2.5. A previous button is the outline button. */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gform_footer, .gform_page_footer) :is(button, input[type="submit"], input[type="button"]) {
	appearance: none;
	background-color: var(--wp--preset--color--teal-strong);
	border: 2px solid var(--wp--preset--color--teal-strong);
	border-radius: 999px;
	color: var(--wp--preset--color--white);
	cursor: pointer;
	font-family: var(--wp--preset--font-family--montserrat);
	font-size: 1rem; /* 1.4: button text is a literal 1rem at every width, not the fluid medium preset. */
	font-weight: 700;
	letter-spacing: 0.1875rem;
	line-height: 1.15;
	padding: 0.625rem 1.875rem;
	text-decoration: none;
	text-transform: uppercase;
	width: auto;
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gform_footer, .gform_page_footer) :is(button, input[type="submit"], input[type="button"]):is(:hover, :focus-visible) {
	background-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--teal-strong);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gform_footer, .gform_page_footer) .gform_previous_button {
	background-color: transparent;
	border-color: var(--wp--preset--color--deep-teal);
	color: var(--wp--preset--color--deep-teal);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gform_footer, .gform_page_footer) .gform_previous_button:is(:hover, :focus-visible) {
	background-color: var(--wp--preset--color--deep-teal);
	color: var(--wp--preset--color--white);
}

/* Validation (1.1 rule 7): no error red. The field keeps its colours and gets a 2px ink border; the message is
   ink, weight 700, after a warning icon; the summary has the look of notice-warning (ink on sun). */
body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield.gfield_error {
	background-color: transparent;
	border: 0;
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield.gfield_error :is(input:not([type="radio"], [type="checkbox"], [type="submit"], [type="button"], [type="image"], [type="file"], [type="hidden"]), select, textarea),
body .gform_wrapper.gform_legacy_markup_wrapper li.gfield.gfield_error input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]) {
	border: 2px solid var(--wp--preset--color--ink);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .validation_message {
	background-color: transparent;
	border: 0;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	margin-block-start: var(--wp--preset--spacing--20);
	padding: 0;
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .validation_message::before {
	content: "\26A0\FE0E";
	content: "\26A0\FE0E" / "";
	margin-inline-end: var(--wp--preset--spacing--20);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gform_validation_errors, div.validation_error) {
	background-color: var(--wp--preset--color--sun);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--wp--preset--color--ink);
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gform_validation_errors :is(h2, ol, li, a, .gform-icon) {
	color: var(--wp--preset--color--ink);
}

/* Legacy markup: the summary's icon is a red picture before the heading; it becomes the ink warning sign. The icon
   font span is hidden, since the legacy stylesheets do not load that font. */
body .gform_wrapper.gform_legacy_markup_wrapper .gform_validation_errors > h2::before {
	background-image: none;
	content: "\26A0\FE0E";
	content: "\26A0\FE0E" / "";
	height: auto;
	margin-inline-end: var(--wp--preset--spacing--20);
	vertical-align: baseline;
	width: auto;
}

body .gform_wrapper.gform_legacy_markup_wrapper .gform_validation_errors .gform-icon {
	display: none;
}

body .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gform_validation_errors > h2 {
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	letter-spacing: normal;
	line-height: 1.5;
}

/* The ring of 1.7, repeated under the wrapper (rule 1): it beats `.gform_wrapper input:focus { outline: none; }`. */
body .gform_wrapper a:focus-visible,
body .gform_wrapper button:focus-visible,
body .gform_wrapper input:focus-visible,
body .gform_wrapper select:focus-visible,
body .gform_wrapper textarea:focus-visible,
body .gform_wrapper summary:focus-visible,
body .gform_wrapper [tabindex]:not([tabindex="-1"]):focus-visible {
	outline: var(--wp--custom--focus--ring-width) solid var(--wp--custom--focus--ring-outer);
	outline-offset: var(--wp--custom--focus--ring-width);
	box-shadow: 0 0 0 var(--wp--custom--focus--ring-width) var(--wp--custom--focus--ring-inner);
}

/* The newsletter band (2.7): teal-strong behind white labels (shown, spec 6.6), white fields with the swapped
   ring (1.7 rule 3), the on-dark submit. A message keeps ink text on a sun chip: ink on teal-strong is 2.65:1. */
.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .gfield_label,
.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gfield_required, .gfield .gfield_description, .gform_required_legend),
.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield :is(.gfield_checkbox, .gfield_radio, .gchoice label, a) {
	color: var(--wp--preset--color--white);
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield a {
	text-decoration: underline;
}

/* The consent line's link loses its underline under the pointer, as running text does, and keeps it with keyboard
   focus; its colour stays (1.4, pattern contract 1.0.11). */
.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield a:hover {
	text-decoration: none;
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield.hidden_label {
	padding-block-start: calc(var(--wp--preset--font-size--small) * 1.5 + var(--wp--preset--spacing--20));
	position: relative;
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield.hidden_label > .gfield_label {
	clip: auto;
	clip-path: none;
	font-size: var(--wp--preset--font-size--small);
	height: auto;
	inset-block-start: 0;
	inset-inline-start: 0;
	margin: 0;
	overflow: visible;
	width: auto;
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield.hidden_label :is(input, select, textarea) {
	margin-block-start: 0;
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) .gfield .validation_message {
	background-color: var(--wp--preset--color--sun);
	color: var(--wp--preset--color--ink);
	display: inline-block;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(input, select, textarea):focus-visible {
	outline-color: var(--wp--custom--focus--ring-inner);
	box-shadow: 0 0 0 var(--wp--custom--focus--ring-width) var(--wp--custom--focus--ring-outer);
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gform_footer, .gform_page_footer) :is(button, input[type="submit"], input[type="button"]) {
	background-color: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--deep-teal);
}

.caw-footer__newsletter .gform_wrapper:is(.gravity-theme, .gform_legacy_markup_wrapper) :is(.gform_footer, .gform_page_footer) :is(button, input[type="submit"], input[type="button"]):is(:hover, :focus-visible) {
	background-color: transparent;
	border-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--white);
}
