/*
 * Formulaire de contact.
 * Chargée par Blocs Creator sur les seules pages qui portent le bloc.
 */

.kahel-contact-form-section {
	/* Plus resserré qu'une section ordinaire. */
	padding-top: clamp(56px, 7vw, 96px);
	padding-bottom: clamp(56px, 7vw, 96px);
}

.kahel-contact-form-section .kahel-contact-form-grille {
	display: grid;
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
	gap: clamp(40px, 7vw, 110px);
	align-items: start;
}

/* L'introduction suit le défilement, sous l'en-tête, jusqu'au bas du formulaire. */
.kahel-contact-form-section .kahel-contact-form-intro {
	position: sticky;
	top: calc(var(--kahel-entete, 0px) + 40px);
	transition: top 450ms var(--wp--custom--motion--ease);
}

.kahel-contact-form-section .kahel-contact-form-titre {
	max-width: 12ch;
	margin: 0;
}

.kahel-contact-form-section .kahel-contact-form-texte {
	max-width: 46ch;
	margin: 26px 0 0;
}

.kahel-contact-form-section .kahel-contact-form-infos {
	max-width: 46ch;
	margin: 28px 0 0;
	padding-left: 18px;
	border-left: 3px solid var(--wp--preset--color--orange);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.7;
}

.kahel-contact-form-section .kahel-contact-form-carte-col {
	position: relative;
}

.kahel-contact-form-section .kahel-contact-form-carte {
	padding: clamp(26px, 3.4vw, 44px);
	border-radius: var(--wp--custom--radius--default);
	background: var(--wp--preset--color--cream);
	box-shadow: var(--wp--preset--shadow--card);
	scroll-margin-top: 120px;
}

.kahel-contact-form-section .kahel-contact-form {
	margin: 0;
}

.kahel-contact-form-section .kahel-contact-champs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 16px;
}

/* Nom, objet et message sur toute la largeur ; e-mail et téléphone côte à côte. */
.kahel-contact-form-section .kahel-contact-champ-nom,
.kahel-contact-form-section .kahel-contact-champ-objet,
.kahel-contact-form-section .kahel-contact-champ-message {
	grid-column: 1 / -1;
}

.kahel-contact-form-section .kahel-contact-champ {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin: 0;
}

.kahel-contact-form-section .kahel-contact-champ label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--weight--strong);
}

.kahel-contact-form-section .kahel-contact-facultatif {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.kahel-contact-form-section :is(input, select, textarea) {
	box-sizing: border-box;
	width: 100%;
	min-height: 50px;
	margin: 0;
	padding: 12px 16px;
	border: 1px solid var(--wp--preset--color--line-strong);
	border-radius: var(--wp--custom--radius--md);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.4;
	transition: border-color var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease), box-shadow var(--wp--custom--motion--duration-fast) var(--wp--custom--motion--ease);
}

.kahel-contact-form-section textarea {
	min-height: 150px;
	resize: vertical;
}

.kahel-contact-form-section :is(input, select, textarea):hover {
	border-color: rgba(36, 23, 15, 0.32);
}

.kahel-contact-form-section :is(input, select, textarea):focus {
	border-color: var(--wp--preset--color--orange);
	outline: none;
	box-shadow: var(--wp--preset--shadow--focus);
}

.kahel-contact-form-section [aria-invalid="true"] {
	border-color: #b3261e;
}

/* La liste déroulante, avec son propre chevron. */
.kahel-contact-form-section .kahel-contact-select {
	position: relative;
	display: block;
}

.kahel-contact-form-section .kahel-contact-select select {
	padding-right: 44px;
	appearance: none;
	cursor: pointer;
}

.kahel-contact-form-section .kahel-contact-select select:invalid {
	color: var(--wp--preset--color--muted);
}

.kahel-contact-form-section .kahel-contact-select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 18px;
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--wp--preset--color--orange-deep);
	border-bottom: 2px solid var(--wp--preset--color--orange-deep);
	pointer-events: none;
	transform: translateY(-70%) rotate(45deg);
}

.kahel-contact-form-section .kahel-contact-erreur {
	color: #b3261e;
	font-size: var(--wp--preset--font-size--caption);
	font-weight: 600;
}

/* Le piège à robots : hors de l'écran, pas simplement masqué. */
.kahel-contact-form-section .kahel-contact-piege {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.kahel-contact-form-section .kahel-contact-envoi {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
	margin-top: 26px;
}

.kahel-contact-form-section .kahel-contact-envoi .wp-element-button {
	min-height: 50px;
	padding-inline: 26px;
	cursor: pointer;
}

.kahel-contact-form-section .kahel-contact-statut {
	flex: 1 1 220px;
	margin: 0;
	color: var(--wp--preset--color--leaf);
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--weight--strong);
}

.kahel-contact-form-section .kahel-contact-statut.is-erreur {
	color: #b3261e;
}

.kahel-contact-form-section .kahel-contact-mention {
	margin: 22px 0 0;
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.6;
}

@media (max-width: 900px) {
	.kahel-contact-form-section .kahel-contact-form-grille {
		grid-template-columns: 1fr;
	}

	.kahel-contact-form-section .kahel-contact-form-intro {
		position: static;
	}
}

@media (max-width: 560px) {
	.kahel-contact-form-section .kahel-contact-champs {
		grid-template-columns: 1fr;
	}
}
