/**
 * Contact page template. The eyebrow, accent and buttons are shared components.
 *
 * 1. Hero
 * 2. Layout
 * 3. Contact details
 * 4. Offices
 * 5. Consultation form
 * 6. Area combobox
 */

/* 1. Hero ----------------------------------------------------------------- */

.contact-hero {
	padding: clamp(72px, 9vw, 128px) 0 clamp(64px, 8vw, 112px);
	background: var(--c-cream);
}

.contact-hero__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(24px, 3vw, 36px);
	text-align: center;
}

.contact-hero__title {
	color: var(--c-navy);
	font-size: clamp(40px, 5.8vw, 86px);
	font-weight: 300;
	line-height: 1.04;
	letter-spacing: -0.03em;
}

/* Room for descenders inside the masks. */
.contact-hero__title .reveal-mask {
	margin-bottom: -0.12em;
	padding-bottom: 0.16em;
}

.contact-hero__title .accent {
	font-size: 1.08em;
}

.contact-hero__lead {
	max-width: 600px;
	color: #2a3147;
	font-size: clamp(17px, 1.5vw, 20px);
	font-weight: 300;
	line-height: 1.65;
	text-wrap: pretty;
}

/* 2. Layout --------------------------------------------------------------- */

.contact-body {
	padding: clamp(72px, 9vw, 128px) 0;
	background: var(--c-white);
}

.contact-body__inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
	align-items: start;
	gap: clamp(56px, 7vw, 110px);
}

.contact-details {
	display: flex;
	flex-direction: column;
	gap: 48px;
}

.contact-block {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* 3. Contact details ------------------------------------------------------ */

.contact-channels {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--c-navy);
	list-style: none;
}

.contact-channel {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 0;
	border-bottom: 1px solid rgba(23, 34, 63, 0.14);
	color: var(--c-navy);
	transition: padding 0.4s;
}

.contact-channel:hover {
	padding-left: 8px;
	color: var(--c-gold-deep);
}

.contact-channel__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.contact-channel__label {
	color: #6b7186;
	font-size: 12px;
}

.contact-channel__value {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: clamp(17px, 1.5vw, 20px);
	overflow-wrap: anywhere;
}

.contact-channel__icon {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

.contact-channel__arrow {
	color: var(--c-gold);
}

.contact-social {
	display: flex;
	gap: 10px;
	margin: 10px 0 0;
	padding: 0;
	list-style: none;
}

.contact-social__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 1px solid rgba(23, 34, 63, 0.2);
	color: var(--c-navy);
	transition: border-color 0.3s, color 0.3s, background-color 0.3s;
}

.contact-social__link--text {
	width: auto;
	padding: 0 16px;
	font-size: 12px;
	letter-spacing: 0.04em;
}

.contact-social__link:hover {
	border-color: var(--c-navy);
	background: var(--c-navy);
	color: var(--c-white);
}

.contact-social__icon {
	display: block;
	width: 17px;
	height: 17px;
}

/* 4. Offices -------------------------------------------------------------- */

.contact-offices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
	gap: 28px 32px;
	padding-top: 20px;
	border-top: 1px solid var(--c-navy);
}

.contact-office {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.contact-office__city {
	color: var(--c-navy);
	font-size: 17px;
	font-weight: 600;
}

.contact-office__address {
	color: #4a5165;
	font-size: 15px;
	line-height: 1.75;
}

.contact-office__map {
	align-self: flex-start;
	margin-top: 6px;
	padding: 4px 0;
	border-bottom: 1px solid var(--c-navy);
	color: var(--c-navy);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	transition: color 0.3s, border-color 0.3s;
}

.contact-office__map:hover {
	border-color: var(--c-gold);
	color: var(--c-gold-deep);
}

/* 5. Consultation form ---------------------------------------------------- */

.contact-form {
	display: flex;
	flex-direction: column;
	gap: 30px;
	padding: clamp(28px, 4vw, 56px);
	background: var(--c-navy);
	color: var(--c-white);
}

.contact-form__head {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.contact-form__title {
	font-size: clamp(24px, 2.2vw, 30px);
	font-weight: 300;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.contact-form__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
	gap: 26px 28px;
}

.contact-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.contact-field--area {
	position: relative;
	z-index: 5;
}

.contact-field__label {
	color: rgba(255, 255, 255, 0.7);
	font-size: 12px;
	font-weight: 500;
}

/* Underlined fields; the line turns gold on focus and rose on an error. */
.contact-field__input {
	width: 100%;
	padding: 10px 0 12px;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 0;
	outline: 0;
	background: transparent;
	color: var(--c-white);
	font: 400 16px var(--font-sans);
	transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-field__input::placeholder {
	color: #a3a8b8;
	opacity: 1;
}

.contact-field__input:focus,
.contact-select__box:focus-visible {
	border-bottom-color: var(--c-gold);
	box-shadow: 0 1px 0 var(--c-gold);
	outline: 0;
}

.contact-field__input[aria-invalid="true"] {
	border-bottom-color: #f0b4a4;
}

.contact-field__textarea {
	min-height: 120px;
	line-height: 1.6;
	resize: vertical;
}

/* Native select, shown until contact.js replaces it with the combobox. */
.contact-field__select {
	padding-right: 28px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23e3cfa9' stroke-width='1.5'%3E%3Cpath d='M2 4.5l4 4 4-4'/%3E%3C/svg%3E") no-repeat right center;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.contact-field__select:has(option[value=""]:checked) {
	color: #a3a8b8;
}

.contact-field__select option {
	background: var(--c-white);
	color: var(--c-navy);
}

.contact-field__select[hidden] {
	display: none;
}

.contact-field__error {
	color: #f0b4a4;
	font-size: 12px;
}

.contact-form__end {
	display: flex;
	flex-direction: column;
}

.contact-form__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding-top: 8px;
}

.contact-form__note {
	max-width: 300px;
	color: rgba(255, 255, 255, 0.6);
	font-size: 12.5px;
	line-height: 1.6;
}

.contact-form__submit {
	gap: 12px;
	padding: 18px 26px;
	border: 0;
	cursor: pointer;
}

.contact-form__submit-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
}

/* A live region, so it stays in the page while empty. */
.contact-form__status {
	color: var(--c-gold-light);
	font-size: 13px;
}

.contact-form__status:not(:empty) {
	margin-top: 30px;
}

.contact-form__status a {
	border-bottom: 1px solid var(--c-gold-light);
	color: var(--c-white);
}

/* 6. Area combobox -------------------------------------------------------- */

.contact-select {
	position: relative;
}

.contact-select__box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.28);
	font: 400 16px var(--font-sans);
	cursor: pointer;
	transition: border-color 0.3s, box-shadow 0.3s;
}

.contact-select.is-open .contact-select__box {
	border-bottom-color: var(--c-gold);
}

.contact-select__value {
	color: #a3a8b8;
}

.contact-select.has-value .contact-select__value {
	color: var(--c-white);
}

.contact-select__chevron {
	display: flex;
	color: var(--c-gold-light);
	transition: transform 0.4s var(--ease-out);
}

.contact-select.is-open .contact-select__chevron {
	transform: rotate(180deg);
}

.contact-select__list {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	/* All practice areas are listed, so the list scrolls past a certain height. */
	max-height: min(360px, 60vh);
	margin: 8px 0 0;
	padding: 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	background: var(--c-white);
	box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity 0.3s ease, transform 0.4s var(--ease-out), visibility 0s 0.4s;
}

.contact-select.is-open .contact-select__list {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.contact-select__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 13px 14px;
	color: var(--c-navy);
	font-size: 14.5px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.contact-select__option:hover,
.contact-select.is-keyboard .contact-select__option.is-active,
.contact-select__option[aria-selected="true"] {
	background: var(--c-cream);
}

.contact-select__option[aria-selected="true"] {
	font-weight: 600;
}

.contact-select__check {
	color: var(--c-gold-deep);
	font-size: 13px;
	opacity: 0;
}

.contact-select__option[aria-selected="true"] .contact-select__check {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.contact-channel,
	.contact-select__chevron,
	.contact-select__list {
		transition: none;
	}
}
