/**
 * Contact Form 7 — styles scoped to the block-form ACF layout.
 *
 * All selectors start with .single__form, which is the container in
 * template-parts/part_info/block-form.php (and its news variant). This
 * isolates the restyle from other CF7 forms on the site (e.g. the
 * post-form layout used on news entries) and avoids regressing any
 * custom styling that already exists there.
 *
 * Specificity note: the theme ships rules like
 *   .single__form form input         { border: none; border-bottom: 4px solid; padding: 1%; font-size: 24px; }
 *   .single__form form input.wpcf7-submit { color: #9195cb; float: right; }
 * so the selectors below include the `form` tag to match or beat
 * that specificity, plus explicitly set every property the theme
 * was winning (border, padding, margin-top, font-size, line-height,
 * background, submit color, float).
 *
 * Palette matches MDN-26 donation form:
 *   --cf-primary:    #0390BF
 *   --cf-primary-dk: #027599
 *   --cf-accent:     #f7bf0f  (reserved for future accents)
 *   --cf-text:       #333
 *   --cf-border:     #d1d5db
 *   --cf-bg-soft:    #f9fafb
 *   --cf-error:      #dc2626
 */

.single__form {
	font-size: 1rem;
	color: #333;
}

/* Labels — block-level, above each field */
.single__form form label {
	display: block;
	font-weight: 600;
	font-size: 0.95rem;
	margin-bottom: 0.4rem;
	color: #333;
}

/* Space between fields. Each <label> usually wraps an input, so
   gap-control lives on the label; but if author used bare inputs we
   still want a gap — target the wpcf7-form-control-wrap too. */
.single__form form p,
.single__form form .wpcf7-form-control-wrap {
	margin-bottom: 1.25rem;
}

/* Inputs and textarea. Selector includes `form` to beat the theme's
   .single__form form input rule (specificity 0,2,3 vs theme 0,1,2).
   Theme-conflicting properties are explicitly re-set: border (theme
   sets border:none + border-bottom:4px), padding (theme 1%), margin-top
   (theme 3%), font-size (theme 24px), line-height (theme 32px),
   background (theme transparent). */
.single__form form input[type="text"],
.single__form form input[type="email"],
.single__form form input[type="url"],
.single__form form input[type="tel"],
.single__form form input[type="number"],
.single__form form textarea {
	width: 100%;
	padding: 0.75rem 0.9rem;
	margin-top: 0;
	font-size: 1rem;
	line-height: 1.4;
	color: #333;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	box-sizing: border-box;
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}

/* The theme's 4px border-bottom ships via a separate rule; neutralise
   it explicitly so the full frame border wins on every edge. */
.single__form form input[type="text"],
.single__form form input[type="email"],
.single__form form input[type="url"],
.single__form form input[type="tel"],
.single__form form input[type="number"],
.single__form form textarea {
	border-bottom: 1px solid #d1d5db !important;
}

.single__form form textarea {
	min-height: 140px;
	resize: vertical;
	line-height: 1.5;
}

.single__form form input:focus,
.single__form form textarea:focus {
	outline: none;
	border-color: #0390BF;
	box-shadow: 0 0 0 3px rgba(3, 144, 191, 0.2);
}

/* Honeypot — the template recommends an inline off-screen wrapper
   but we also cover the case where the wrapper uses the hp class. */
.single__form .wpcf7-hp-wrap {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Submit button — solid primary (same as MDN-26 donate).
   Theme rule is .single__form form input.wpcf7-submit { color:#9195cb; float:right; padding:2% } —
   specificity (0,2,2). We use .wpcf7-submit in our selector too, and
   also match on form input[type=submit] / form button[type=submit]
   for non-CF7 fallbacks. float:none undoes the theme's right-float. */
.single__form form input[type="submit"].wpcf7-submit,
.single__form form input[type="submit"],
.single__form form button[type="submit"] {
	display: inline-block;
	width: auto;
	background: #0390BF;
	color: #fff !important;
	border: none;
	padding: 0.85rem 2.2rem;
	margin-top: 1rem;
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.2;
	border-radius: 8px;
	cursor: pointer;
	float: none;
	transition: background 0.15s;
}

.single__form form input[type="submit"].wpcf7-submit:hover,
.single__form form input[type="submit"]:hover,
.single__form form button[type="submit"]:hover {
	background: #027599 !important;
	color: #fff !important;
}

/* :focus must use !important on background to beat the theme rule
   `.single__form form input:focus { background-color: transparent !important }`,
   which would otherwise turn the submit button invisible the moment
   the user clicks it (focus is set before hover disappears). */
.single__form form input[type="submit"].wpcf7-submit:focus,
.single__form form input[type="submit"]:focus,
.single__form form button[type="submit"]:focus {
	background: #0390BF !important;
	color: #fff !important;
	outline: 2px solid rgba(3, 144, 191, 0.4);
	outline-offset: 2px;
}

.single__form form input[type="submit"].wpcf7-submit:active,
.single__form form input[type="submit"]:active,
.single__form form button[type="submit"]:active {
	background: #015f7d !important;
	color: #fff !important;
}

.single__form form input[type="submit"].wpcf7-submit:disabled,
.single__form form input[type="submit"]:disabled,
.single__form form button[type="submit"]:disabled {
	background: #9ca3af;
	cursor: not-allowed;
}

/* CF7 inline validation hint (per-field) */
.single__form .wpcf7-not-valid-tip {
	color: #dc2626;
	font-size: 0.875rem;
	margin-top: 0.3rem;
	display: block;
	font-weight: 400;
}

.single__form form input.wpcf7-not-valid,
.single__form form textarea.wpcf7-not-valid {
	border-color: #dc2626;
}

.single__form form input.wpcf7-not-valid:focus,
.single__form form textarea.wpcf7-not-valid:focus {
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

/* CF7 form response block at the bottom */
.single__form .wpcf7-response-output {
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin-top: 1rem;
	font-size: 0.95rem;
	line-height: 1.45;
}

.single__form .wpcf7 form.sent .wpcf7-response-output,
.single__form .wpcf7-mail-sent-ok {
	border-color: #10b981;
	background: #f0fdf4;
	color: #047857;
}

.single__form .wpcf7 form.failed .wpcf7-response-output,
.single__form .wpcf7 form.aborted .wpcf7-response-output,
.single__form .wpcf7-mail-sent-ng,
.single__form .wpcf7-validation-errors,
.single__form .wpcf7-spam-blocked {
	border-color: #dc2626;
	background: #fef2f2;
	color: #991b1b;
}

/* CF7 loading spinner alignment next to submit */
.single__form .wpcf7-spinner {
	vertical-align: middle;
	margin-left: 0.5rem;
}

/* Responsive */
@media (max-width: 640px) {
	.single__form form input[type="submit"].wpcf7-submit,
	.single__form form input[type="submit"],
	.single__form form button[type="submit"] {
		width: 100%;
		padding: 0.9rem 1rem;
	}
}

/* ---------------------------------------------------------------
   Layout tweaks scoped to the block-form row wrapper
   (class `block-form-wrap` added on the outer .row in
   template-parts/part_info/block-form.php). This keeps the tweaks
   from affecting any other two-column row on the site.
   --------------------------------------------------------------- */

/* Constrain the whole row to a readable width and centre it on the
   page. Without this the outer Foundation row hugs the left edge of
   the page template, making the form look awkwardly offset. */
.block-form-wrap {
	max-width: 900px;
	margin-left: auto;
	margin-right: auto;
	justify-content: center;
}

/* Centre the title column content — both the text and the flex
   alignment, so the h4 sits in the middle regardless of the stock
   `aifs jcfs saic sjcc` theme classes on the column. */
.block-form-wrap .large-3 {
	align-items: center;
	justify-content: center;
	text-align: center;
}

.block-form-wrap .large-3 h4.h3 {
	text-align: center;
}

/* Desktop (Foundation `large` ≥1024px): collapse the two-column
   layout into a single centered column — the header sits above the
   form, both centered on the page. The original two-column flex is
   a narrow-header / wide-form split that looked off-balance on the
   contact page; stacking makes the form dominant as intended. */
@media (min-width: 64em) {
	.block-form-wrap {
		flex-direction: column;
		align-items: center;
	}

	.block-form-wrap .large-3,
	.block-form-wrap .large-9 {
		flex: 0 0 100%;
		max-width: 100%;
		width: 100%;
	}

	.block-form-wrap .large-3 {
		margin-bottom: 1.5rem;
	}

	.block-form-wrap .single__form {
		width: 100%;
		max-width: 100%;
	}

	.block-form-wrap .single__form form {
		width: 100%;
		max-width: 720px;
		margin-left: auto;
		margin-right: auto;
	}

	/* Ensure inputs grow to the widened form width — needed because
	   some theme rules cap input width implicitly via container sizes. */
	.block-form-wrap .single__form form input[type="text"],
	.block-form-wrap .single__form form input[type="email"],
	.block-form-wrap .single__form form input[type="url"],
	.block-form-wrap .single__form form input[type="tel"],
	.block-form-wrap .single__form form input[type="number"],
	.block-form-wrap .single__form form textarea {
		width: 100%;
		max-width: 100%;
	}
}
