/*
 * The Contact page (ADR-0036; the owner's request of 2026-10-12 for a beautiful page that follows the design tokens,
 * ADR-0023 D3 point 6): page-contact.php's `main.lcr-contact`, on the Contact page only (cili/contact/contact.php).
 *
 * One column on a phone and, from the tablet breakpoint, in the text container; from the desktop breakpoint two
 * columns inside the page's row, the introduction and the form on the left and the company's details, in a panel, on
 * the right. The fields are the site's fields: the fill gray, no border, the field's radius and height, the web body
 * type; the send button is the primary pill with the send icon; a refused field is told by a line of text and an ink
 * outline, never by a colour (ADR-0018, Q48: grayscale only). The refused submit's summary and the confirmation are
 * panels. The focus ring is the frame's (layout-frame.css, WEB-622). Nothing is animated and nothing is drawn by an
 * icon font: the two icons are lcr_icon()'s inline SVGs. Every value is a design token (design-tokens.css);
 * ./scripts/verify.sh refuses one written by hand. Every rule starts with `html body`, as the other layouts do, so it
 * wins a tie with a vendor rule whatever the order. A rule that sets `display` leaves a `hidden` element alone
 * (`:not([hidden])`): the script toggles `hidden`, which an author `display` would otherwise override.
 */

/* ------------------------------------------------------------------------------------------------- the page */

html body .lcr-contact {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--lcr-space-32);
	max-width: var(--lcr-web-container-text);
	margin: var(--lcr-space-24) 0 0;
}

html body .lcr-contact > * {
	min-width: 0;
}

html body .lcr-contact h2 {
	margin: 0;
	color: var(--lcr-color-ink);
	font-size: var(--lcr-type-section-font-size);
	font-weight: var(--lcr-type-section-font-weight);
	letter-spacing: var(--lcr-type-section-letter-spacing);
	line-height: var(--lcr-type-section-line-height);
}

html body .lcr-contact p {
	margin: 0;
}

/* The introduction. */
html body .lcr-contact .lcr-contact-intro p {
	margin-top: var(--lcr-space-12);
	color: var(--lcr-color-body);
	font-size: var(--lcr-type-body-large-font-size);
	font-weight: var(--lcr-type-body-large-font-weight);
	line-height: var(--lcr-type-body-large-line-height);
	text-wrap: pretty; /* no lone last word */
}

/* ------------------------------------------------------------------------------------------------- the form */

html body .lcr-contact .lcr-contact-fields:not([hidden]) {
	display: grid;
	gap: var(--lcr-space-20);
}

html body .lcr-contact .lcr-contact-required {
	color: var(--lcr-color-muted);
	font-size: var(--lcr-type-small-font-size);
	line-height: var(--lcr-type-small-line-height);
}

html body .lcr-contact .lcr-contact-field label {
	display: block;
	margin: 0 0 var(--lcr-space-8);
	color: var(--lcr-color-ink);
	font-size: var(--lcr-type-label-font-size);
	font-weight: var(--lcr-type-label-font-weight);
	letter-spacing: var(--lcr-type-label-letter-spacing);
	line-height: var(--lcr-type-label-line-height);
}

/* The mark of a required field: the dot after its label, the pale red every form's required fields have
   (layout-fields.css; the one line above says every field is required). */
html body .lcr-contact .lcr-contact-field label::after {
	content: "";
	display: inline-block;
	width: var(--lcr-space-8);
	height: var(--lcr-space-8);
	margin-left: var(--lcr-space-6);
	border-radius: var(--lcr-radius-pill);
	background-color: var(--lcr-web-signal-required);
	vertical-align: middle;
}

html body .lcr-contact .lcr-contact-field :is(input[type="text"], input[type="email"], textarea) {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: auto; /* Heilz's theme.css: `height: 100%` on every text input */
	min-height: var(--lcr-size-field);
	margin: 0;
	padding: 0 var(--lcr-space-16);
	border: 0;
	border-radius: var(--lcr-radius-field);
	background-color: var(--form-background);
	box-shadow: none;
	color: var(--lcr-color-ink);
	font-family: var(--lcr-font-family-sans);
	font-size: var(--lcr-web-type-body-font-size);
	font-weight: var(--lcr-web-type-body-font-weight);
	line-height: var(--lcr-web-type-body-line-height);
	transition: none;
}

html body .lcr-contact .lcr-contact-field textarea {
	min-height: calc(3 * var(--lcr-size-field));
	padding: var(--lcr-space-14) var(--lcr-space-16);
	resize: vertical;
}

/* A refused field: an ink outline around it, and its own line of text under it (never a colour). */
html body .lcr-contact .lcr-contact-field :is(input, textarea)[aria-invalid="true"] {
	box-shadow: inset 0 0 0 var(--lcr-web-focus-ring) var(--lcr-color-ink);
}

html body .lcr-contact .lcr-contact-hint,
html body .lcr-contact .lcr-contact-error {
	margin-top: var(--lcr-space-6);
	font-size: var(--lcr-type-small-font-size);
	line-height: var(--lcr-type-small-line-height);
}

html body .lcr-contact .lcr-contact-hint {
	color: var(--lcr-color-muted);
}

html body .lcr-contact .lcr-contact-error {
	color: var(--lcr-color-ink);
	font-weight: var(--lcr-font-weight-semibold);
}

/* The summary of a refused submit: an alert panel in ink outline, with a link to each field. */
html body .lcr-contact .lcr-contact-summary {
	padding: var(--lcr-space-16) var(--lcr-space-20);
	border-radius: var(--lcr-radius-panel);
	background-color: var(--lcr-color-panel);
	box-shadow: inset 0 0 0 var(--lcr-web-focus-ring) var(--lcr-color-ink);
	color: var(--lcr-color-ink);
}

html body .lcr-contact .lcr-contact-summary-message {
	font-size: var(--lcr-type-label-font-size);
	font-weight: var(--lcr-type-label-font-weight);
	line-height: var(--lcr-type-label-line-height);
}

html body .lcr-contact .lcr-contact-summary ul {
	margin: var(--lcr-space-8) 0 0;
	padding: 0 0 0 var(--lcr-space-20);
	list-style: disc;
}

html body .lcr-contact .lcr-contact-summary a {
	display: inline-block;
	min-height: var(--lcr-size-icon);
	color: var(--lcr-color-ink);
	font-size: var(--lcr-type-body-font-size);
	line-height: var(--lcr-size-icon);
	text-decoration: underline;
}

/* The send button: the primary pill with the send icon, full width on a phone. */
html body .lcr-contact .lcr-contact-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--lcr-space-8);
	box-sizing: border-box;
	width: 100%;
	min-height: var(--lcr-size-cta);
	margin: 0;
	padding: 0 var(--lcr-space-24);
	border: 0;
	border-radius: var(--lcr-radius-pill);
	background-color: var(--lcr-color-ink);
	box-shadow: none;
	color: var(--lcr-color-on-ink);
	font-family: var(--lcr-font-family-sans);
	font-size: var(--lcr-web-type-label-font-size);
	font-weight: var(--lcr-font-weight-semibold);
	line-height: var(--lcr-web-type-label-line-height);
	cursor: pointer;
	transition: none;
}

html body .lcr-contact .lcr-contact-send:hover {
	background-color: var(--lcr-color-ink-raised);
}

html body .lcr-contact .lcr-contact-send:disabled {
	background-color: var(--lcr-color-ink-raised);
	cursor: progress;
}

html body .lcr-contact .lcr-contact-send .lcr-icon {
	flex: none;
	width: var(--lcr-space-20);
	height: var(--lcr-space-20);
}

html body .lcr-contact .lcr-contact-send > span {
	margin: 0;
}

/* The confirmation, in the form's place: a panel with the check in a round ink badge. */
html body .lcr-contact .lcr-contact-success:not([hidden]) {
	display: flex;
	align-items: center;
	gap: var(--lcr-space-16);
	padding: var(--lcr-space-24);
	border-radius: var(--lcr-radius-card);
	background-color: var(--lcr-color-panel);
	color: var(--lcr-color-ink);
}

html body .lcr-contact .lcr-contact-success-icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: var(--lcr-size-icon-button);
	height: var(--lcr-size-icon-button);
	border-radius: var(--lcr-radius-pill);
	background-color: var(--lcr-color-ink);
	color: var(--lcr-color-on-ink);
}

html body .lcr-contact .lcr-contact-success-icon .lcr-icon {
	width: var(--lcr-size-icon);
	height: var(--lcr-size-icon);
}

html body .lcr-contact .lcr-contact-success-message {
	font-size: var(--lcr-type-body-large-font-size);
	font-weight: var(--lcr-font-weight-medium);
	line-height: var(--lcr-type-body-large-line-height);
}

/* The fixed header never hides what takes focus (WCAG 2.4.11). */
html body .lcr-contact :is(input, textarea, a, .lcr-contact-summary, .lcr-contact-success) {
	scroll-margin-top: calc(var(--lcr-web-header-height-phone) + var(--lcr-space-16));
}

/* ------------------------------------------------------------------------------------------------- the details */

html body .lcr-contact .lcr-contact-aside {
	display: grid;
	gap: var(--lcr-space-24);
	padding: var(--lcr-space-24);
	border-radius: var(--lcr-radius-card);
	background-color: var(--lcr-color-panel);
}

html body .lcr-contact .lcr-contact-aside h2 {
	margin: 0 0 var(--lcr-space-8);
	color: var(--lcr-color-muted);
	font-size: var(--lcr-type-label-font-size);
	font-weight: var(--lcr-type-label-font-weight);
	letter-spacing: var(--lcr-type-label-letter-spacing);
	line-height: var(--lcr-type-label-line-height);
}

html body .lcr-contact .lcr-contact-aside p {
	color: var(--lcr-color-ink);
	font-size: var(--lcr-type-body-large-font-size);
	font-weight: var(--lcr-type-body-large-font-weight);
	line-height: var(--lcr-type-body-large-line-height);
	overflow-wrap: anywhere;
}

html body .lcr-contact .lcr-contact-aside p + p {
	margin-top: var(--lcr-space-4);
}

html body .lcr-contact .lcr-contact-address {
	padding-top: var(--lcr-space-24);
	border-top: var(--lcr-size-hairline) solid var(--lcr-color-divider);
}

/* ------------------------------------------------------------------------------------------------- tablet and up */

@media (min-width: 768px) {

	html body .lcr-contact {
		margin-top: var(--lcr-space-32);
		gap: var(--lcr-space-40);
	}

	html body .lcr-contact h2 {
		font-size: var(--lcr-web-type-section-font-size);
		font-weight: var(--lcr-web-type-section-font-weight);
		letter-spacing: var(--lcr-web-type-section-letter-spacing);
		line-height: var(--lcr-web-type-section-line-height);
	}

	html body .lcr-contact .lcr-contact-intro p {
		font-size: var(--lcr-web-type-body-large-font-size);
		line-height: var(--lcr-web-type-body-large-line-height);
	}

	html body .lcr-contact .lcr-contact-send {
		justify-self: start; /* a grid item stretches, auto width or not */
		width: auto;
		min-width: var(--lcr-space-96);
	}

	html body .lcr-contact .lcr-contact-aside {
		padding: var(--lcr-space-32);
	}

	html body .lcr-contact .lcr-contact-aside h2 {
		font-size: var(--lcr-web-type-label-font-size);
		font-weight: var(--lcr-web-type-label-font-weight);
		letter-spacing: var(--lcr-web-type-label-letter-spacing);
		line-height: var(--lcr-web-type-label-line-height);
	}

	html body .lcr-contact .lcr-contact-aside p {
		font-size: var(--lcr-web-type-body-font-size);
		line-height: var(--lcr-web-type-body-line-height);
	}

	html body .lcr-contact .lcr-contact-success-message {
		font-size: var(--lcr-web-type-body-large-font-size);
		line-height: var(--lcr-web-type-body-large-line-height);
	}
}

/* ------------------------------------------------------------------------------------------------- desktop */

@media (min-width: 1200px) {

	html body .lcr-contact {
		grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
		grid-template-areas:
			"intro aside"
			"form aside";
		grid-template-rows: auto 1fr;
		column-gap: var(--lcr-space-64);
		row-gap: var(--lcr-space-32);
		max-width: none;
	}

	html body .lcr-contact .lcr-contact-intro {
		grid-area: intro;
		max-width: var(--lcr-web-container-text);
	}

	html body .lcr-contact .lcr-contact-form {
		grid-area: form;
		max-width: var(--lcr-web-container-text);
	}

	html body .lcr-contact .lcr-contact-aside {
		grid-area: aside;
		align-self: start;
		position: sticky;
		top: calc(var(--lcr-web-header-height-desktop) + var(--lcr-space-24));
	}

	html body .lcr-contact :is(input, textarea, a, .lcr-contact-summary, .lcr-contact-success) {
		scroll-margin-top: calc(var(--lcr-web-header-height-desktop) + var(--lcr-space-16));
	}
}
