/**
 * Contact page ("お問い合わせ"). Figma node 83:1400 (Narrow) / 83:1518 (Wide).
 */

/* -- Other channels (compact LINE/Tel row under the page heading) -- */

.other-channels {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: 100%;
}

.other-channels__row {
	display: flex;
	gap: 8px;
}

.channel-btn {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 44px;
	padding: 0 16px 0 14px;
	background-color: var(--color-bg-base);
	border: 1.5px solid var(--color-brand-primary);
	border-radius: var(--radius-full);
	text-decoration: none;
	font: 700 14px/1 var(--font-sans);
	color: var(--color-text-accent);
}

.channel-btn svg {
	width: 18px;
	height: 18px;
}

/* -- Form section: bg/subtle + the Form card -- */

.contact-form-section {
	display: flex;
	justify-content: center;
	padding: 0 var(--container-px) var(--section-py);
	background-color: var(--color-bg-subtle);
}

.contact-form-card {
	width: 100%;
	max-width: 720px;
	padding: 28px 20px;
	background-color: var(--color-bg-base);
	border: 1px solid var(--color-border-base);
	border-radius: var(--radius-lg);
}

/**
 * The markup below is generated by Contact Form 7, not this theme — it is
 * styled here to match the Form Field component (node 82:384). Pair each
 * CF7 tag with the matching label/badge markup documented in
 * page-templates/contact.php's header comment when building the form in
 * wp-admin.
 */

.contact-form-card > .wpcf7 > form {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.contact-form-card .form-heading {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.contact-form-card .form-heading__title {
	font: 700 20px/1.5 var(--font-sans); /* Subhead */
	color: var(--color-text-primary);
	margin: 0;
}

.contact-form-card .form-heading__note {
	font: 400 14px/1.7 var(--font-sans);
	color: var(--color-text-primary);
	margin: 0;
}

.contact-form-card .form-heading__note strong {
	color: var(--color-text-accent);
}

.form-field {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Neutralize any <p>/<br> wpautop inserts around the CF7 form-tag line,
   so the gap above is the only source of spacing. */
.form-field p {
	margin: 0;
}

.form-field br {
	display: none;
}

.form-field__label-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.form-field__label {
	font: 700 15px/1.5 var(--font-sans);
	color: var(--color-text-primary);
}

.form-field__badge {
	display: inline-flex;
	/* Belt-and-suspenders alongside .form-field__label-row's flex `gap`,
	   in case CF7's generated markup breaks the label/badge out of the
	   same flex line (e.g. a stray <br> from wpautop). */
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: var(--radius-sm);
	font: 700 11px/1.5 var(--font-sans);
}

.form-field__badge--required {
	background-color: var(--color-brand-primary);
	color: var(--color-text-inverse);
}

.form-field__badge--optional {
	background-color: var(--color-bg-muted);
	color: var(--color-text-primary);
}

/* CF7's generated inputs (span.wpcf7-form-control-wrap wraps each control) */
.contact-form-card .wpcf7-form-control-wrap {
	display: block;
}

.contact-form-card .wpcf7-form-control {
	width: 100%;
	min-height: 52px;
	padding: 14px 16px;
	background-color: var(--color-bg-base);
	border: 1.5px solid var(--color-border-strong);
	border-radius: var(--radius-md);
	font: 400 16px/1.8 var(--font-sans);
	color: var(--color-text-primary);
}

.contact-form-card textarea.wpcf7-form-control {
	min-height: 200px;
	resize: vertical;
}

.contact-form-card select.wpcf7-form-control {
	appearance: none;
	background-image: url(../img/icons/chevron-down-20.svg);
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 44px;
}

.contact-form-card .wpcf7-form-control:focus-visible {
	outline: 3px solid var(--color-brand-primary);
	outline-offset: 2px;
}

/* Error state — exact error color not yet confirmed against the Guideline
   "States" page; using a conventional red until verified. */
.contact-form-card .wpcf7-form-control[aria-invalid="true"] {
	border-color: #dc2626;
}

.contact-form-card .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	font: 400 13px/1.5 var(--font-sans);
	color: #dc2626;
}

.contact-form-card .wpcf7-response-output {
	/* !important: CF7 core ships its own `.wpcf7-response-output` margin
	   (2em 0.5em 1em) that was winning the cascade and pushing this well
	   below the submit button regardless of the gap set here. */
	margin: 16px 0 0 !important;
	padding: 14px 16px;
	border-radius: var(--radius-md);
	border: 1.5px solid var(--color-border-strong);
	font: 400 14px/1.7 var(--font-sans);
}

.contact-form-card form.sent .wpcf7-response-output {
	border-color: var(--color-brand-primary);
	color: var(--color-text-accent);
}

.contact-form-card form.failed .wpcf7-response-output,
.contact-form-card form.aborted .wpcf7-response-output {
	border-color: #dc2626;
	color: #dc2626;
}

.form-privacy-note {
	font: 400 14px/1.7 var(--font-sans);
	color: var(--color-text-primary);
	margin: 0;
}

.form-privacy-note a {
	color: var(--color-text-accent);
	text-decoration: underline;
}

.form-submit .wpcf7-form-control-wrap {
	width: 100%;
}

.form-submit input.wpcf7-form-control[type="submit"] {
	display: flex;
	width: 100%;
	min-height: 0;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 16px 32px;
	background-color: var(--color-brand-primary);
	border: none;
	border-radius: var(--radius-full);
	font: 700 16px/1 var(--font-sans);
	color: var(--color-text-inverse);
	cursor: pointer;
}

.form-submit input.wpcf7-form-control[type="submit"]:hover {
	opacity: 0.9;
}

@container site (min-width: 720px) {
	.form-submit input.wpcf7-form-control[type="submit"] {
		width: auto;
		min-width: 320px;
		margin-inline: auto;
	}
}
