/*
 * Contact: details column with the map panel, the message form, and the FAQ
 * accordion.
 *
 * Phase 4 made the form real. Every rule below the "Message form" divider is
 * the one Phase 2 shipped, unchanged, plus the states a working form needs:
 * a field that was rejected, the message that says why, the result banner, and
 * the button while the browser is posting. Nothing was restyled to accommodate
 * a form engine, because there is no form engine — the markup is the theme's,
 * so the design never had to negotiate with anyone else's class names.
 */

.contact-head__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
	text-align: center;
}

.contact-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 4rem;
	align-items: start;
	padding-inline: 1.5rem;
}

.contact-details {
	display: flex;
	flex-direction: column;
	gap: 4rem;
}

.contact-details__pair {
	display: grid;
	grid-template-columns: 1fr;
	gap: 3rem;
}

.contact-details__value {
	display: block;
	margin-top: 1rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	font-style: italic;
	color: var(--wp--preset--color--brand-wood);
	text-decoration: underline;
	text-decoration-color: rgba(196, 163, 90, 0.2);
	text-underline-offset: 8px;
	overflow-wrap: anywhere;
	transition: color 0.5s, text-decoration-color 0.5s;
}

.contact-details__value:hover {
	color: var(--wp--preset--color--brand-gold);
	text-decoration-color: var(--wp--preset--color--brand-gold);
}

.contact-details__note {
	margin-top: 1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	font-weight: 300;
	color: rgba(90, 90, 90, 0.6);
}

@media (min-width: 640px) {
	.contact-details__pair {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* --- Map panel ---------------------------------------------------------- */

.contact-map {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	border-radius: 2.5rem;
}

.contact-map__head {
	display: flex;
	align-items: flex-start;
	gap: 1.5rem;
}

.contact-map__mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 3.5rem;
	height: 3.5rem;
	transform: skewX(3deg);
	border-radius: 1rem;
	background: var(--wp--preset--color--brand-gold);
	color: var(--wp--preset--color--brand-wood);
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.contact-map__mark svg {
	width: 1.5rem;
	height: 1.5rem;
}

.contact-map__address {
	margin-top: 0.5rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	font-style: italic;
	line-height: 1.1;
}

.contact-map__country {
	margin-top: 0.75rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	font-weight: 300;
	color: rgba(245, 240, 232, 0.4);
}

.contact-map__frame {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 2rem;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.contact-map__frame iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.contact-map__actions {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.contact-map__socials {
	display: flex;
	justify-content: center;
	gap: 1rem;
}

@media (min-width: 640px) {
	.contact-map__actions {
		flex-direction: row;
		align-items: center;
	}

	.contact-map__actions .btn {
		flex: 1;
		justify-content: center;
	}
}

@media (min-width: 768px) {
	.contact-map {
		padding: 3rem;
		border-radius: 3.75rem;
	}

	.contact-map__address {
		font-size: 1.875rem;
	}
}

/* --- Message form ------------------------------------------------------- */

.contact-form-card {
	/*
	 * The palette has no error colour, because the design had nothing to
	 * report until now. This is a warm brick chosen to sit with the wood and
	 * the gold rather than a stock red — declared once, here, rather than
	 * added to theme.json, because one page needs it and theme.json is the
	 * client-facing palette.
	 */
	--contact-error: #a4442f;
	position: relative;
	padding: 2rem;
	border: 1px solid rgba(26, 42, 30, 0.05);
	border-radius: 2.5rem;
	background: #fff;
	box-shadow: var(--luxury-shadow);
}

.contact-form-card__mark {
	position: absolute;
	top: 2rem;
	right: 2rem;
	opacity: 0.05;
	color: var(--wp--preset--color--brand-wood);
}

.contact-form-card__mark svg {
	width: 5rem;
	height: 5rem;
}

.contact-form-card__title {
	margin-bottom: 2.5rem;
	font-size: 2.25rem;
	font-style: italic;
	letter-spacing: -0.02em;
}

.contact-form fieldset {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	margin: 0;
	padding: 0;
	border: 0;
}

/* Only the no-handler fallback is greyed out, and only because it is inert. */
.contact-form fieldset[disabled] {
	opacity: 0.75;
}

.contact-form__row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

.contact-form__field {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.contact-form label {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.5625rem;
	font-weight: 900;
	letter-spacing: 0.4em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
	width: 100%;
	padding: 1.25rem;
	border: 0;
	border-bottom: 1px solid rgba(26, 42, 30, 0.1);
	border-radius: 1rem;
	background: rgba(250, 246, 239, 0.5);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1rem;
	color: var(--wp--preset--color--brand-wood);
}

.contact-form textarea {
	border-radius: 2rem;
	resize: none;
}

.contact-form__select {
	position: relative;
	display: block;
}

.contact-form__select select {
	appearance: none;
}

.contact-form__caret {
	position: absolute;
	top: 50%;
	right: 1.5rem;
	transform: translateY(-50%);
	pointer-events: none;
	color: var(--wp--preset--color--brand-gold);
}

.contact-form__caret svg {
	width: 1rem;
	height: 1rem;
}

.contact-form__consent {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	padding: 0.5rem;
	/*
	 * Wraps so a rejected consent tick puts its message on its own line under
	 * the label, rather than beside it where it reads as a second column.
	 */
	flex-wrap: wrap;
}

.contact-form__consent input {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.15rem;
	accent-color: var(--wp--preset--color--brand-gold);
}

.contact-form__consent label {
	letter-spacing: 0.1em;
	font-weight: 500;
	line-height: 1.7;
	color: var(--wp--preset--color--brand-stone);
	text-transform: uppercase;
	font-size: 0.625rem;
}

/*
 * The state box is the honest part of this card: it names the working
 * contact routes rather than implying the button does anything.
 */
.contact-form__state {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-top: 2rem;
	padding: 1.5rem;
	border: 1px solid rgba(196, 163, 90, 0.15);
	border-radius: 1.5rem;
	background: rgba(250, 246, 239, 0.6);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	line-height: 1.7;
	color: var(--wp--preset--color--brand-stone);
}

.contact-form__state a {
	color: var(--wp--preset--color--brand-gold);
	font-weight: 600;
}

.contact-form__state-icon svg {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.15rem;
	color: var(--wp--preset--color--brand-gold);
}

.contact-form__submit {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 2rem;
	text-align: center;
}

.contact-form__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	width: 100%;
	padding: 1.75rem 3rem;
	border: 1px solid rgba(26, 42, 30, 0.1);
	border-radius: 999px;
	background: var(--wp--preset--color--brand-gold);
	color: var(--wp--preset--color--brand-wood);
	cursor: pointer;
	transition: background-color 0.5s, color 0.5s, opacity 0.3s;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	font-weight: 900;
	letter-spacing: 0.5em;
	text-transform: uppercase;
}

.contact-form__button:hover,
.contact-form__button:focus-visible {
	background: #fff;
}

/* The no-handler fallback, and the moment between the click and the redirect. */
.contact-form__button:disabled,
.contact-form__button[aria-disabled="true"] {
	background: rgba(90, 90, 90, 0.25);
	color: rgba(26, 42, 30, 0.5);
	cursor: not-allowed;
}

/*
 * Busy. The label is replaced rather than joined by a spinner: one sentence
 * that says what is happening reads better at this size than a glyph, and it
 * needs no animation to be understood with prefers-reduced-motion set.
 */
.contact-form[data-busy="true"] .contact-form__button-label,
.contact-form[data-busy="true"] .contact-form__button-icon {
	visibility: hidden;
}

.contact-form[data-busy="true"] .contact-form__button {
	position: relative;
}

.contact-form[data-busy="true"] .contact-form__button::after {
	content: attr(data-busy-label);
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	letter-spacing: 0.3em;
}

.contact-form__button-icon svg {
	width: 1.25rem;
	height: 1.25rem;
}

.contact-form__caption {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: rgba(90, 90, 90, 0.6);
}

@media (min-width: 768px) {
	.contact-form-card {
		padding: 4rem;
		border-radius: 3.75rem;
	}

	.contact-form-card__title {
		font-size: 3rem;
	}

	.contact-form__row {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.contact-grid {
		grid-template-columns: 5fr 7fr;
		gap: 3rem;
	}
}

@media (min-width: 1280px) {
	.contact-grid {
		gap: 6rem;
	}
}

/* --- Live states -------------------------------------------------------- */

/*
 * The honeypot. Positioned off-screen rather than display:none, because a bot
 * that skips hidden inputs walks straight past a trap that is display:none.
 * It is aria-hidden and out of the tab order in the markup, so nothing that
 * reads or tabs the page can reach it however it is positioned.
 */
.contact-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/*
 * A rejected field. The border carries the signal and the message states it in
 * words — colour alone would say nothing to a visitor who cannot distinguish
 * it, and the message is the part a screen reader announces anyway.
 */
.contact-form__field.has-error input,
.contact-form__field.has-error select,
.contact-form__field.has-error textarea {
	border-bottom-color: var(--contact-error);
	box-shadow: inset 0 -1px 0 var(--contact-error);
	background: rgba(164, 68, 47, 0.04);
}

.contact-form__error {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: normal;
	text-transform: none;
	color: var(--contact-error);
}

.contact-form__consent.has-error .contact-form__error {
	flex-basis: 100%;
	margin-left: 2.25rem;
}

.contact-form__consent.has-error input {
	outline: 2px solid var(--contact-error);
	outline-offset: 3px;
}

/*
 * The result banner. Same shape as the informational state box below it, so a
 * confirmation and a note read as the same family; the tone is carried by the
 * rule down the leading edge and by the mark, never by the layout moving.
 */
.contact-form__result {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 2.5rem;
	padding: 1.5rem;
	border: 1px solid rgba(196, 163, 90, 0.15);
	border-left-width: 3px;
	border-radius: 1.5rem;
	background: rgba(250, 246, 239, 0.6);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.8125rem;
	line-height: 1.7;
	color: var(--wp--preset--color--brand-stone);
}

/*
 * The site header is `position: fixed`, so the browser scrolling this into
 * view puts it UNDERNEATH the header — the confirmation the guest most needs
 * to read becomes the one thing they cannot see. Measured: the solid header is
 * 119px at 1440 and 100px at 375, so 9rem clears both with room to spare.
 * qa/contact.spec.mjs asserts the clearance at three widths, because this is
 * the kind of breakage that looks fine in a component screenshot and is only
 * visible where the visitor actually lands.
 */
.contact-form__result {
	scroll-margin-top: 9rem;
}

.contact-form__result:focus {
	outline: none;
}

.contact-form__result:focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-gold);
	outline-offset: 4px;
}

.contact-form__result strong {
	display: block;
	margin-bottom: 0.35rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.125rem;
	font-style: italic;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--brand-wood);
}

.contact-form__result-icon svg {
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.35rem;
}

.contact-form__result-routes {
	margin-top: 0.75rem;
	font-weight: 600;
}

.contact-form__result a {
	color: var(--wp--preset--color--brand-gold);
	font-weight: 600;
}

.contact-form__result.is-ok {
	border-left-color: var(--wp--preset--color--brand-gold);
	background: rgba(196, 163, 90, 0.08);
}

.contact-form__result.is-ok .contact-form__result-icon {
	color: var(--wp--preset--color--brand-gold);
}

.contact-form__result.is-error {
	border-color: rgba(164, 68, 47, 0.2);
	border-left-color: var(--contact-error);
	background: rgba(164, 68, 47, 0.05);
}

.contact-form__result.is-error .contact-form__result-icon {
	color: var(--contact-error);
}

/* --- FAQ ---------------------------------------------------------------- */

.contact-faq__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	margin-bottom: 4rem;
	text-align: center;
}

.faq-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.faq {
	padding: 2rem;
	border: 1px solid rgba(26, 42, 30, 0.05);
	border-radius: 2.5rem;
	background: #fff;
	box-shadow: var(--luxury-shadow);
}

.faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	cursor: pointer;
	list-style: none;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.25rem;
	font-style: italic;
	letter-spacing: -0.02em;
}

.faq__question::-webkit-details-marker {
	display: none;
}

.faq__marker {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 3rem;
	height: 3rem;
	border-radius: 999px;
	background: rgba(250, 246, 239, 1);
	transition: transform 0.5s var(--ease-luxury), background-color 0.5s, color 0.5s;
}

.faq[open] .faq__marker {
	transform: rotate(180deg);
	background: var(--wp--preset--color--brand-gold);
	color: var(--wp--preset--color--brand-wood);
}

.faq__marker svg {
	width: 1.25rem;
	height: 1.25rem;
}

.faq__answer {
	margin-top: 2rem;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1rem;
	line-height: 1.75;
	color: var(--wp--preset--color--brand-stone);
}

@media (min-width: 768px) {
	.faq {
		padding: 3rem;
	}

	.faq__question {
		font-size: 1.5rem;
	}

	.faq__answer {
		font-size: 1.125rem;
	}
}

/* Link to the privacy policy beside the consent tick. */
.contact-form__consent-link {
	color: var(--wp--preset--color--brand-gold);
	text-decoration: underline;
	text-underline-offset: 0.2em;
	white-space: nowrap;
}
