/* ==========================================================================
   Contact page
   Loaded only by contact.html. Two columns: copy on the left, the enquiry
   card on the right, collapsing to one column on tablet.
   ========================================================================== */

/* Clearing the fixed header is `.section--below-header` in layout.css, on the
   section itself, so every hero-less page uses the same value. */

.contact__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 570px);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: start;
}

/* Copy column ------------------------------------------------------------ */

.contact__title {
  font-size: var(--step-h2);
  line-height: var(--leading-heading);
  max-width: 16ch;
}

.contact__title em {
  font-style: normal;
  color: var(--gm-lime-700);
}

.contact__lede {
  max-width: 46ch;
  margin-block-start: var(--space-lg);
  line-height: var(--leading-body);
}

.contact__direct {
  margin-block-start: var(--space-2xl);
}

.contact__email {
  font-family: var(--font-body);
  font-size: var(--step-body);
  color: var(--gm-green-700);
  text-underline-offset: 0.25em;
}

.contact__email:hover {
  color: var(--gm-green-900);
}

/* Enquiry card ----------------------------------------------------------- */

.contact__card {
  padding: clamp(1.75rem, 1rem + 2.5vw, 2.5rem);
  border: 1px solid rgb(2 64 60 / 0.1);
  border-radius: var(--radius-lg);
  background-color: var(--gm-white);
  box-shadow: var(--shadow-md);
}

.contact__card-title {
  font-size: var(--step-h5);
  font-weight: var(--weight-semibold);
  color: var(--gm-green-700);
}

/* Form ------------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-block-start: var(--space-lg);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.field__label {
  font-family: var(--font-body);
  font-size: var(--step-body-sm);
  font-weight: var(--weight-medium);
  color: var(--gm-green-700);
}

/* Required is marked in text as well as with the mark, so it is not
   communicated by a glyph alone. */
.field__required {
  color: var(--gm-lime-700);
}

.field__control {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgb(2 64 60 / 0.18);
  border-radius: var(--radius-sm);
  background-color: var(--gm-sand-050);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.5;
  color: var(--gm-green-900);
  transition:
    border-color var(--duration-base) var(--ease-out),
    background-color var(--duration-base) var(--ease-out);
}

.field__control::placeholder {
  color: rgb(2 64 60 / 0.45);
}

.field__control:hover {
  border-color: rgb(2 64 60 / 0.32);
}

.field__control:focus {
  outline: none;
  background-color: var(--gm-white);
  border-color: var(--gm-green-700);
}

.field__control:focus-visible {
  outline: var(--focus-ring-width) solid var(--focus-ring-on-light);
  outline-offset: 1px;
}

textarea.field__control {
  min-height: 7.5rem;
  resize: vertical;
}

/* Validation ------------------------------------------------------------- */

.field__error {
  display: none;
  font-family: var(--font-body);
  font-size: var(--step-body-sm);
  line-height: 1.4;
  color: #a3241b;
}

.field[data-invalid] .field__error {
  display: block;
}

.field[data-invalid] .field__control {
  border-color: #a3241b;
  background-color: #fdf5f4;
}

/* Spam trap -------------------------------------------------------------- */

/* Moved out of view rather than `display: none`, because a submitter that
   skips undisplayed inputs would step around the trap entirely. It is out of
   the tab order and hidden from assistive technology at the markup. */
.form__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Captcha ---------------------------------------------------------------- */

/* Holds the widget's height before it loads so the submit button does not
   jump under the pointer. */
.form__captcha {
  min-height: 65px;
}

/* Submit and status ------------------------------------------------------ */

.form__submit {
  width: 100%;
  background-color: var(--gm-green-900);
  color: var(--gm-lime-500);
}

.form__submit:hover {
  background-color: var(--gm-green-600);
}

/* The label stays put while sending — the pending state is announced through
   the status region instead, so the button keeps its accessible name. */
.form__submit[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

.form__submit:disabled {
  cursor: not-allowed;
}

.form__status {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-body-sm);
  line-height: 1.5;
}

.form__status:empty {
  display: none;
}

.form__status[data-tone="error"] {
  color: #a3241b;
}

.form__status[data-tone="info"] {
  color: var(--text-body);
}

.form__status[data-tone="success"] {
  color: var(--gm-green-700);
  font-weight: var(--weight-medium);
}

.form__status a {
  color: inherit;
}

@media (max-width: 900px) {
  .contact__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact__title {
    max-width: none;
  }
}
