/*
 * Module comment-form : formulaire « Laisser un commentaire » (`#respond`, Sequex `comments.php`).
 * Champs « outlined » Material 3, accent bleu du thème (#2196F3), Roboto hérité.
 * Tout est préfixé `#respond` : aucun autre formulaire du site n'est concerné.
 */

#respond {
	--qf-cf-accent: #2196F3;
	--qf-cf-accent-hover: #1e88e5;
	--qf-cf-ring: rgb(33 150 243 / 0.18);
	--qf-cf-border: #E0E0E0;
	--qf-cf-border-hover: #BDBDBD;
	--qf-cf-text: #444;
	--qf-cf-input: #212121;
	--qf-cf-muted: #757575;
	--qf-cf-placeholder: #9E9E9E;
	--qf-cf-danger: #E53935;
	--qf-cf-radius: 8px;
}

/* Titre : filet d'accent sous « Laisser un commentaire ». */
#respond h3 {
	position: relative;
	margin-bottom: 20px;
	padding-bottom: 12px;
}

#respond h3::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 32px;
	height: 3px;
	border-radius: 3px;
	background: var(--qf-cf-accent);
}

#respond .sequex_cancel a {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.4;
	text-decoration: none;
}

/* Grille : Commentaire pleine largeur, Nom / E-mail / Site web sur une ligne (≥ 768 px). */
#respond .qf-comment-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 20px 16px;
	margin: 20px;
}

#respond .qf-comment-form > * {
	grid-column: 1 / -1;
	margin: 0;
}

@media only screen and (min-width: 768px) {
	#respond .qf-comment-form {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	#respond .qf-comment-form > .comment-form-author,
	#respond .qf-comment-form > .comment-form-email,
	#respond .qf-comment-form > .comment-form-url {
		grid-column: auto;
	}
}

/* Textes d'aide. */
#respond .comment-notes,
#respond .logged-in-as {
	font-size: 14px;
	line-height: 1.5;
	color: var(--qf-cf-muted);
}

#respond .logged-in-as {
	margin-top: 0;
}

/* Libellés. */
#respond .comment-form-comment > label,
#respond .comment-form-author > label,
#respond .comment-form-email > label,
#respond .comment-form-url > label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--qf-cf-text);
}

#respond .required {
	color: var(--qf-cf-accent);
}

/* Champs. */
#respond textarea,
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"] {
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--qf-cf-border);
	border-radius: var(--qf-cf-radius);
	background: #fff;
	-webkit-box-shadow: none;
	box-shadow: none;
	color: var(--qf-cf-input);
	font-size: 15px;
	line-height: 1.5;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#respond textarea {
	min-height: 160px;
	resize: vertical;
}

#respond textarea::placeholder,
#respond input::placeholder {
	color: var(--qf-cf-placeholder);
	opacity: 1;
}

#respond textarea:hover,
#respond input[type="text"]:hover,
#respond input[type="email"]:hover,
#respond input[type="url"]:hover {
	border-color: var(--qf-cf-border-hover);
}

#respond textarea:focus,
#respond input[type="text"]:focus,
#respond input[type="email"]:focus,
#respond input[type="url"]:focus {
	border-color: var(--qf-cf-accent);
	-webkit-box-shadow: 0 0 0 3px var(--qf-cf-ring);
	box-shadow: 0 0 0 3px var(--qf-cf-ring);
	color: var(--qf-cf-input);
}

/* Erreur seulement après interaction (pas au chargement). */
#respond textarea:user-invalid,
#respond input:user-invalid {
	border-color: var(--qf-cf-danger);
}

#respond textarea:user-invalid:focus,
#respond input:user-invalid:focus {
	-webkit-box-shadow: 0 0 0 3px rgb(229 57 53 / 0.15);
	box-shadow: 0 0 0 3px rgb(229 57 53 / 0.15);
}

/* Consentement cookies : case du thème, texte aligné à côté. */
#respond .comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

#respond .comment-form-cookies-consent input[type="checkbox"] {
	flex: 0 0 auto;
	margin: 3px 0 0;
}

#respond .comment-form-cookies-consent label {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--qf-cf-muted);
	cursor: pointer;
}

/* Bouton d'envoi. */
#respond .form-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

#respond #submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 28px;
	border: 0;
	border-radius: var(--qf-cf-radius);
	background-color: var(--qf-cf-accent);
	-webkit-box-shadow: 0 1px 2px rgb(0 0 0 / 0.15);
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.15);
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

#respond #submit:hover {
	background-color: var(--qf-cf-accent-hover);
	-webkit-box-shadow: 0 3px 8px rgb(33 150 243 / 0.3);
	box-shadow: 0 3px 8px rgb(33 150 243 / 0.3);
	transform: translateY(-1px);
}

#respond #submit:active {
	transform: translateY(0);
	-webkit-box-shadow: 0 1px 2px rgb(0 0 0 / 0.15);
	box-shadow: 0 1px 2px rgb(0 0 0 / 0.15);
}

#respond #submit:focus {
	outline: none;
}

#respond #submit:focus-visible {
	-webkit-box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--qf-cf-accent);
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--qf-cf-accent);
}

/* Mobile. */
@media only screen and (max-width: 480px) {
	/* Bloc commentaires (Sequex : 20px en haut). */
	.sequex_comments_block {
		padding: 40px 0 0 0;
	}

	#respond .qf-comment-form {
		gap: 16px;
	}

	/* 16 px : pas de zoom automatique sur iOS. */
	#respond textarea,
	#respond input[type="text"],
	#respond input[type="email"],
	#respond input[type="url"] {
		font-size: 16px;
	}

	#respond #submit {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	#respond textarea,
	#respond input,
	#respond #submit {
		transition: none;
	}

	#respond #submit:hover {
		transform: none;
	}
}
