/**
 * Contact.
 *
 * The form is the page, so it takes the wider column and the aside sits beside
 * it rather than above. Fields are square and generous, matching the rest of
 * the system: nothing in this design has a corner radius.
 *
 * Every colour here is a token. Orange never carries text on white anywhere on
 * this site, because it measures 3.37:1 and fails AA, so the error state uses
 * charcoal text with an orange rule to do the signalling.
 */

.contact__grid {
  display: grid;
  gap: var(--space-9) var(--space-8);
  grid-template-columns: 1fr;
}

@media (min-width: 62rem) {
  .contact__grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    align-items: start;
  }
}

.contact__heading {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  line-height: 1.15;
  margin: 0 0 var(--space-6);
}

/* ---------------------------------------------------------------- the form */

.enquiry__grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .enquiry__grid {
    grid-template-columns: 1fr 1fr;
  }

  .enquiry__field--wide {
    grid-column: 1 / -1;
  }
}

.enquiry__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;
}

.enquiry__label {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

.enquiry__optional {
  font-weight: 400;
  color: var(--sgh-slate);
  margin-left: var(--space-1);
}

.enquiry__input {
  font: inherit;
  font-size: 1rem;
  color: var(--sgh-charcoal);
  background: var(--sgh-white);
  /*
   * Slate, not stone. An input's border is the only thing telling somebody
   * where the field is, which makes it a user interface component under WCAG
   * 1.4.11 and puts it on the 3:1 line rather than the decorative one. Stone
   * on white measures 1.75:1 and is not close. Slate measures 8.32:1.
   */
  border: 1px solid var(--sgh-slate);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  width: 100%;
  /* Without this a padded input overflows its grid cell at narrow widths. */
  box-sizing: border-box;
}

.enquiry__input:hover {
  border-color: var(--sgh-charcoal);
}

.enquiry__input:focus-visible {
  outline: 2px solid var(--sgh-orange);
  outline-offset: 1px;
  border-color: var(--sgh-orange);
}

textarea.enquiry__input {
  resize: vertical;
  min-height: 9rem;
}

/*
 * The native arrow is removed and redrawn so the control matches the rest of
 * the system. background-image rather than a pseudo-element, because a select
 * cannot carry one.
 */
.enquiry__select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--sgh-charcoal) 50%),
                    linear-gradient(135deg, var(--sgh-charcoal) 50%, transparent 50%);
  background-position: calc(100% - 1.1rem) 55%, calc(100% - 0.75rem) 55%;
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
}

/* ------------------------------------------------------------ error states */

.enquiry__field.is-invalid .enquiry__input {
  border-color: var(--sgh-orange);
  border-left-width: 3px;
}

.enquiry__error {
  font-size: 0.875rem;
  color: var(--sgh-charcoal);
  font-weight: 600;
}

/*
 * Not display:none. A hidden input is skipped by some bots precisely because it
 * is hidden, and an off-screen one is filled in far more often. aria-hidden and
 * tabindex="-1" on the wrapper keep it away from real people.
 */
.enquiry__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.enquiry__actions {
  margin: var(--space-7) 0 0;
}

.enquiry__small {
  font-size: 0.8125rem;
  color: var(--sgh-slate);
  margin: var(--space-4) 0 0;
  max-width: 46ch;
}

.enquiry__small a {
  color: var(--sgh-charcoal);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* --------------------------------------------------------------- notices */

.form-notice {
  padding: var(--space-5) var(--space-6);
  margin: 0 0 var(--space-7);
  border-left: 4px solid var(--sgh-orange);
  background: #F4F5F5;
}

.form-notice p {
  margin: 0 0 var(--space-3);
}

.form-notice p:last-child {
  margin-bottom: 0;
}

.form-notice--success {
  border-left-color: var(--sgh-charcoal);
}

.form-notice--success .contact__heading {
  margin-bottom: var(--space-4);
}

.form-notice a {
  color: var(--sgh-charcoal);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.form-notice:focus-visible {
  outline: 2px solid var(--sgh-orange);
  outline-offset: 4px;
}

/* ----------------------------------------------------------------- aside */

.contact__aside-heading {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--space-5);
}

.contact__details {
  margin: 0;
  border-top: 1px solid var(--sgh-stone);
}

.contact__detail {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--sgh-stone);
}

.contact__detail dt {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sgh-slate);
  margin: 0 0 var(--space-2);
}

.contact__detail dd {
  margin: 0;
  font-size: 1.125rem;
}

.contact__detail a {
  color: var(--sgh-charcoal);
  text-decoration: none;
}

.contact__detail a:hover,
.contact__detail a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.contact__promise {
  margin: var(--space-7) 0 0;
  font-size: 1.125rem;
  line-height: 1.45;
  border-left: 3px solid var(--sgh-orange);
  padding-left: var(--space-5);
}
