/*
 * Tarheroya Security - comment-form challenge layout.
 * One tidy line: label, image, answer box. Works in RTL and LTR; wraps on phones.
 */
.trhs-captcha-comment {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin: 0 0 12px;
	padding: 0;
	width: auto;
	max-width: 100%;
	box-sizing: border-box;
}

.trhs-captcha-comment .trhs-captcha-label {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: #555;
	white-space: nowrap;
}

.trhs-captcha-comment .trhs-captcha-img {
	display: block;
	width: auto;
	height: 48px;
	max-width: 100%;
	margin: 0;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #f5f6f8;
	vertical-align: middle;
}

.trhs-captcha-comment .trhs-captcha-q {
	font-weight: 600;
	font-size: 16px;
}

.trhs-captcha-comment input.trhs-captcha-answer,
#wpdcom .trhs-captcha-comment input.trhs-captcha-answer {
	display: block;
	box-sizing: border-box;
	width: 96px;
	max-width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 10px;
	text-align: center;
	direction: ltr;
	font-size: 16px;
	border: 1px solid #c8c8c8;
	border-radius: 8px;
	background: #fff;
}

.trhs-captcha-comment input.trhs-captcha-answer:focus {
	outline: none;
	border-color: #111;
}

/* ------------------------------------------------------------------ *
 * wpDiscuz: name / email take the full row on top; below them the
 * submit button comes first and the challenge sits beside it, both on
 * one line and centred on the same axis.
 * ------------------------------------------------------------------ */

/* The row and column that hold the submit button get a line of their own. */
#wpdcom .wpd-form-row:has(.wc-field-submit) {
	clear: both;
	float: none;
	width: 100%;
	flex: 0 0 100%;
}

#wpdcom .wpd-form-row:has(.wc-field-submit) > [class*="wpd-form-col-"]:has(.wc-field-submit) {
	float: none;
	width: 100%;
	max-width: 100%;
}

/* Button + challenge: one flex line. DOM order is challenge, button; "order"
   puts the button first. */
#wpdcom .wc-field-submit {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 10px 14px;
	float: none;
	width: 100%;
	margin: 0;
	text-align: start;
}

#wpdcom .wc-field-submit .wpd-prim-button {
	order: 0;
	flex: 0 0 auto;
	min-height: 48px;
	margin: 0;
}

#wpdcom .wc-field-submit .trhs-captcha-wpd {
	order: 1;
	flex: 0 0 auto;
	flex-wrap: nowrap;
	margin: 0;
	float: none;
	clear: none;
}

#wpdcom .wc-field-submit .wpd_label {
	order: 2;
}

#wpdcom .trhs-captcha-wpd .trhs-captcha-label {
	display: none; /* the image and the box are self-explanatory here */
}

/* Fallback (a form without the submit hook): the challenge on its own line. */
#wpdcom form > .trhs-captcha-wpd {
	margin: 10px 0 0;
}

@media (max-width: 600px) {
	#wpdcom .wc-field-submit .trhs-captcha-wpd {
		flex-wrap: wrap;
	}
}
