/* ==========================================================================
   Block: Contact Form — Ambient Override
   ========================================================================== */

/* ---- Section ---- */
.contact-form--ambient {
	overflow: clip;
	padding-block: 7.5rem;
	padding-inline: 0;
}

.contact-form--ambient.contact-form--no-top-padding {
	padding-block-start: 0;
}

.contact-form--ambient.contact-form--no-bottom-padding {
	padding-block-end: 0;
}

/* With a map the section ends edge-to-edge — no white strip between the map
   and whatever follows it (client note-7 #11). */
.contact-form--ambient.contact-form--has-map {
	padding-block-end: 0;
}

/* ---- Container ---- */
.contact-form--ambient .contact-form__container {
	margin-inline: auto;
	max-inline-size: var(--container-max-width);
	padding-inline: 0;
}

/* ---- Header typography ---- */
.contact-form--ambient .contact-form__description {
	font-size: 1.3125rem;
	line-height: 1.6;
}

/* ---- Wrapper: 2-column grid ---- */
.contact-form--ambient .contact-form__wrapper {
	align-items: center;
	display: grid;
	gap: 8.125rem;
	grid-template-columns: 42.9375rem 1fr;
	max-inline-size: 100%;
}

/* The form column carries its own gap at all times, independent of the
   block's "Remove padding" setting — with the setting off the form used to
   sit flush against whatever follows the block (client note-12 follow-up).
   The image column deliberately has none, so it runs straight into the map or
   the next section. */
.contact-form--ambient .contact-form__form-wrapper {
	padding-block-end: 7.5rem;
}

/* Locations span the full width and bring their own spacing, so the form
   column must not add a second gap on top of it. */
.contact-form--ambient:has(.contact-form__locations) .contact-form__form-wrapper {
	padding-block-end: 0;
}

/* ---- Form: reset parent styles ---- */
.contact-form--ambient .contact-form__form {
	background: none;
	border-radius: 0;
	box-shadow: none;
	padding: 0;
}

/* ---- Image Wrapper: breaks out to viewport right edge ---- */
/* Stretched to the full height of the row rather than centred at a fixed
   height: the form column is the taller of the two because of its own gap,
   and centring left a strip of space under the image (client note-12
   follow-up). 55rem is now a floor, so the image never gets shorter than it
   was when the form column is the shorter one. */
.contact-form--ambient .contact-form__image-wrapper {
	align-self: stretch;
	margin-inline-end: calc(-1 * max(var(--container-padding), (100vw - var(--container-max-width)) / 2 + var(--container-padding)));
	min-block-size: 55rem;
	overflow: hidden;
	position: relative;
}

/* Taken out of the flow so the column's height comes from the grid row and
   not from the picture: with the image in the flow its natural height fed
   back into the row and made the column taller than the form beside it. */
.contact-form--ambient .contact-form__image-wrapper img {
	block-size: 100%;
	display: block;
	inline-size: 100%;
	inset: 0;
	max-inline-size: none;
	object-fit: cover;
	position: absolute;
	transition: transform 0.1s linear;
}

/* ==========================================================================
   CF7 Form Styling (scoped to .contact-form--ambient)
   ========================================================================== */

/* ---- Form layout ---- */
.contact-form--ambient .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* ---- Field wrapper ---- */
.contact-form--ambient .field {
	padding-block-start: 2.5rem;
	position: relative;
}

.contact-form--ambient .wpcf7-form .field:first-of-type {
	padding-block-start: 0;
}

/* ---- Labels ---- */
.contact-form--ambient .wpcf7-form label {
	color: #020910;
	display: block;
	font-size: 1.3125rem;
	font-weight: var(--fw-regular);
	line-height: 1.6;
	margin: 0;
}

/* ---- Floating Labels for text/email inputs ---- */
.contact-form--ambient .field:has(input[type="text"]) > p > label,
.contact-form--ambient .field:has(input[type="email"]) > p > label {
	inset-block-start: 3.25rem;
	inset-inline-start: 0.625rem;
	pointer-events: none;
	position: absolute;
	transform-origin: left top;
	transition: color var(--transition-base), font-size var(--transition-base), transform var(--transition-base);
	z-index: 1;
}

.contact-form--ambient .field:has(input[type="text"]):first-of-type > p > label {
	inset-block-start: 0.75rem;
}

.contact-form--ambient .field:has(input[type="text"]:focus) > p > label,
.contact-form--ambient .field:has(input[type="email"]:focus) > p > label,
.contact-form--ambient .field.has-value:has(input[type="text"]) > p > label,
.contact-form--ambient .field.has-value:has(input[type="email"]) > p > label {
	color: #999;
	font-size: 0.75rem;
	transform: translateY(-1.5rem);
}

/* ---- Text Inputs & Textarea ---- */
.contact-form--ambient .wpcf7-form input[type="text"],
.contact-form--ambient .wpcf7-form input[type="email"],
.contact-form--ambient .wpcf7-form input[type="tel"],
.contact-form--ambient .wpcf7-form input[type="url"],
.contact-form--ambient .wpcf7-form textarea {
	background: transparent;
	border: none;
	border-block-end: 0.0625rem solid #020910;
	border-radius: 0;
	box-shadow: none;
	color: #020910;
	font-size: 1.3125rem;
	font-weight: var(--fw-regular);
	inline-size: 100%;
	line-height: 1.6;
	outline: none;
	padding-block: 0.75rem;
	padding-inline: 0.625rem;
}

.contact-form--ambient .wpcf7-form input[type="text"]:focus,
.contact-form--ambient .wpcf7-form input[type="email"]:focus,
.contact-form--ambient .wpcf7-form input[type="tel"]:focus,
.contact-form--ambient .wpcf7-form input[type="url"]:focus,
.contact-form--ambient .wpcf7-form textarea:focus {
	border-block-end-color: #020910;
	box-shadow: none;
	outline: none;
}

/* ---- Validation: red border on invalid fields ---- */
.contact-form--ambient .wpcf7-form .wpcf7-not-valid {
	border-block-end-color: #D13A67;
}

/* ---- Textarea: label disappears on focus/typing ---- */
.contact-form--ambient .field:has(textarea) > p > label {
	inset-block-start: 3.25rem;
	inset-inline-start: 0.625rem;
	pointer-events: none;
	position: absolute;
	transition: opacity var(--transition-base);
	z-index: 1;
}

.contact-form--ambient .field:has(textarea:focus) > p > label,
.contact-form--ambient .field.has-value:has(textarea) > p > label {
	opacity: 0;
}

.contact-form--ambient .wpcf7-form textarea {
	block-size: 7.5rem;
	max-block-size: 12rem;
	min-block-size: 7.5rem;
	overflow-y: auto;
	resize: vertical;
}

/* ---- Placeholder: hidden ---- */
.contact-form--ambient .wpcf7-form input::placeholder,
.contact-form--ambient .wpcf7-form textarea::placeholder {
	color: transparent;
}

/* ---- Validation Errors ---- */
.contact-form--ambient .wpcf7-not-valid-tip {
	color: #D13A67;
	font-size: 0.625rem;
	font-style: normal;
	font-weight: var(--fw-regular);
	line-height: 1rem;
	padding-block-start: 0.3125rem;
}

/* ---- Response Messages ---- */
.contact-form--ambient .wpcf7-response-output {
	border-radius: var(--radius-sm);
	font-size: 0.875rem;
	margin-block-start: 1rem;
	padding: 1rem;
}

/* ---- Checkbox/Radio field label: static, not floating ---- */
.contact-form--ambient .field:has(.wpcf7-checkbox) > p > label,
.contact-form--ambient .field:has(.wpcf7-radio) > p > label {
	position: static;
}

/* ==========================================================================
   CF7 Checkboxes → Pill Toggle Buttons
   ========================================================================== */

.contact-form--ambient .wpcf7-checkbox,
.contact-form--ambient .wpcf7-radio {
	column-gap: 4.25rem;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	padding-block-start: 0.5rem;
	row-gap: 2.5rem;
}

.contact-form--ambient .wpcf7-checkbox .wpcf7-list-item,
.contact-form--ambient .wpcf7-radio .wpcf7-list-item {
	margin: 0;
}

.contact-form--ambient .wpcf7-checkbox .wpcf7-list-item label,
.contact-form--ambient .wpcf7-radio .wpcf7-list-item label {
	align-items: center;
	border: 0.0625rem solid #020910;
	border-radius: var(--radius-pill);
	color: #020910;
	cursor: pointer;
	display: flex;
	font-size: 1.3125rem;
	font-weight: var(--fw-light);
	justify-content: center;
	line-height: 1.5rem;
	padding-block: 1.1875rem;
	padding-inline: 1.9375rem;
	text-transform: uppercase;
	transition: background-color var(--transition-hover), border-color var(--transition-hover), box-shadow var(--transition-hover), color var(--transition-hover), opacity var(--transition-hover);
}

/* Hide native checkbox/radio inside label */
.contact-form--ambient .wpcf7-checkbox .wpcf7-list-item input[type="checkbox"],
.contact-form--ambient .wpcf7-radio .wpcf7-list-item input[type="radio"] {
	block-size: 0;
	inline-size: 0;
	opacity: 0;
	overflow: hidden;
	position: absolute;
}

/* Active/checked state — entire pill becomes dark */
.contact-form--ambient .wpcf7-checkbox .wpcf7-list-item:has(input:checked) label,
.contact-form--ambient .wpcf7-radio .wpcf7-list-item:has(input:checked) label {
	background-color: #020910;
	border-color: #020910;
	color: #fff;
}

/* Hover */
.contact-form--ambient .wpcf7-checkbox .wpcf7-list-item label:hover,
.contact-form--ambient .wpcf7-radio .wpcf7-list-item label:hover {
	background-color: #020910;
	color: #fff;
}

/* ==========================================================================
   Bottom Row: Acceptance + Submit side by side
   ========================================================================== */

.contact-form--ambient .field-group {
	align-items: center;
	display: flex;
	gap: 2rem;
	justify-content: space-between;
	padding-block-start: 2rem;
}

.contact-form--ambient .field-group .field {
	padding-block-start: 0;
}

/* ==========================================================================
   CF7 Acceptance Checkbox
   ========================================================================== */

.contact-form--ambient .wpcf7-acceptance .wpcf7-list-item {
	margin: 0;
}

.contact-form--ambient .wpcf7-acceptance .wpcf7-list-item label {
	align-items: flex-start;
	cursor: pointer;
	display: flex;
	gap: 1.25rem;
}

.contact-form--ambient .wpcf7-acceptance input[type="checkbox"] {
	accent-color: #020910;
	block-size: 1.3125rem;
	border: 0.0625rem solid #020910;
	cursor: pointer;
	flex-shrink: 0;
	inline-size: 1.375rem;
	margin-block-start: 0.25rem;
}

.contact-form--ambient .wpcf7-acceptance .wpcf7-list-item-label {
	color: #020910;
	font-size: 1rem;
	line-height: 1.6;
}

/* ==========================================================================
   CF7 Submit Button
   ========================================================================== */

.contact-form--ambient .wpcf7-form input[type="submit"] {
	background-color: var(--color-pink);
	border: none;
	border-radius: var(--radius-pill);
	box-shadow: var(--shadow-button);
	color: #fff;
	cursor: pointer;
	font-size: 1.5rem;
	font-weight: var(--fw-semibold);
	line-height: 1.5rem;
	padding-block: 1.1875rem;
	padding-inline: 1.9375rem;
	text-transform: uppercase;
	transition: background-color var(--transition-hover), border-color var(--transition-hover), box-shadow var(--transition-hover), color var(--transition-hover), opacity var(--transition-hover);
	white-space: nowrap;
}

.contact-form--ambient .wpcf7-form input[type="submit"]:disabled {
	cursor: not-allowed;
	opacity: 0.4;
}

.contact-form--ambient .wpcf7-form input[type="submit"]:hover:not(:disabled) {
	background-color: var(--color-pink-dark);
}

.contact-form--ambient .wpcf7-spinner {
	display: none;
}

/* ==========================================================================
   Contact Locations (3 columns)
   ========================================================================== */

.contact-form__locations {
	display: grid;
	gap: 2rem;
	grid-template-columns: repeat(3, 1fr);
	padding-block: 6.25rem;
}

.contact-form__location-title {
	color: #020910;
	font-size: 1.5rem;
	font-weight: var(--fw-semibold);
	line-height: 2.0625rem;
	margin: 0;
	text-transform: uppercase;
}

.contact-form__location-address {
	color: #020910;
	font-size: 1.25rem;
	font-weight: 300;
	line-height: 2.0625rem;
	margin: 0;
	padding-block-start: 0.5rem;
}

.contact-form__location-address p {
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	margin: 0;
}

/* ==========================================================================
   Google Maps
   ========================================================================== */

/* The map is the last element of the section, after the container. It runs
   edge to edge straight out of the image column — the spacing sits under the
   form column instead (client note-12 #11). */
.contact-form__map {
	inline-size: 100%;
}

.contact-form__map iframe {
	block-size: 26.8125rem;
	border: none;
	inline-size: 100%;
}

/* ==========================================================================
   Responsive: Mobile
   ========================================================================== */

@media (max-width: 48rem) {
	.contact-form--ambient {
		padding-block: 5rem;
	}

	.contact-form--ambient .contact-form__container {
		padding-inline: 1.25rem;
	}

	.contact-form--ambient .contact-form__title {
		font-size: 2.2rem;
		line-height: 2.5rem;
	}

	.contact-form--ambient .contact-form__description {
		font-size: 1.125rem;
		line-height: 1.6;
	}

	.contact-form--ambient .wpcf7-form input[type="submit"] {
		display: block;
		inline-size: fit-content;
		margin-inline: auto;
		max-inline-size: 100%;
		white-space: normal;
	}

	/* 20px below the image (client note-7 #17). The image is the last item in
	   the wrapper on mobile, so the gap always lands under it. */
	.contact-form--ambient .contact-form__wrapper {
		gap: 3.75rem;
		grid-template-columns: 1fr;
		padding-block-end: 1.25rem;
	}

	/* ...but "Remove padding: bottom" means no space under the image at all —
	   this gap used to survive the setting and was the 20px still showing
	   (client note-12 follow-up). */
	.contact-form--ambient.contact-form--no-bottom-padding .contact-form__wrapper {
		padding-block-end: 0;
	}

	/* Stacked: the column gap already separates the form from the image, so
	   the desktop-only gap under the form column is dropped. */
	.contact-form--ambient .contact-form__form-wrapper {
		padding-block-end: 0;
	}

	.contact-form--ambient .contact-form__image-wrapper {
		block-size: 20rem;
		margin-inline-end: 0;
		/* The desktop floor would force an 880px tall image here. */
		min-block-size: 0;
	}

	.contact-form--ambient .wpcf7-checkbox,
	.contact-form--ambient .wpcf7-radio {
		grid-template-columns: 1fr;
		row-gap: 1.875rem;
	}

	.contact-form--ambient .wpcf7-checkbox .wpcf7-list-item label,
	.contact-form--ambient .wpcf7-radio .wpcf7-list-item label {
		display: flex;
		inline-size: 100%;
		justify-content: center;
	}

	.contact-form--ambient .field-group {
		align-items: flex-start;
		flex-direction: column;
	}

	.contact-form--ambient .field-group .field:last-child {
		align-self: flex-end;
	}

	.contact-form__locations {
		grid-template-columns: 1fr;
		padding-block: 3.125rem;
	}

	.contact-form__map {
		padding-block-start: 5rem;
	}

	.contact-form__map iframe {
		block-size: 18.75rem;
	}
}
