.contact-form {
  background-color: rgb(var(--color-background));
}

/* Match the site-wide container so the section lines up with every other
   section's edges instead of the platform's default page width. */
.contact-form .page-width {
  max-width: var(--ss-container-max);
  padding-inline: var(--ss-container-pad);
}

.contact-form__inner {
  max-width: 100%;
  margin-inline: auto;
}

.contact-form__main {
  min-width: 0;
}

.contact-form__layout--with-media {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 48px;
  align-items: stretch;
}

.contact-form__media {
  position: relative;
  overflow: hidden;
}

/* On desktop the image is taken out of flow so its column height is driven by
   the form, keeping the image exactly as tall as the form (never taller). */
.contact-form__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Show the top of the image rather than its center when cropped. */
  object-position: top;
}

.contact-form__layout--with-media .contact-form__main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 959px) {
  .contact-form__layout--with-media {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Back to normal flow on mobile, kept short so the form stays reachable. */
  .contact-form__media img {
    position: static;
    height: auto;
    max-height: 38vh;
    /* Show the top of the image rather than its center when cropped. */
    object-position: top;
  }
}

/* Drop the global rounded focus ring; keep the brand underline instead. */
.contact-form .field__input:focus,
.contact-form .field__input:focus-visible,
.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
  outline: none;
  border-radius: 0;
}

.contact-form__group {
  gap: 20px;
}

@media (max-width: 959px) {
  .contact-form__group {
    display: block;
  }
}

.contact-form__title {
  margin-block-end: 30px;
  text-align: left;
  margin-bottom: 0;
}

.contact-form__title.title1 {
  font-size: calc(var(--title1-font-size) * 1.08);
}

.contact-form__title.title2 {
  font-size: calc(var(--title2-font-size) * 1.08);
}

.contact-form__title.title3 {
  font-size: calc(var(--title3-font-size) * 1.08);
}

.contact-form__title.title4 {
  font-size: calc(var(--title4-font-size) * 1.08);
}

@media (max-width: 959px) {
  .contact-form__title {
    margin-block-end: 20px;
  }
}

.contact-form .textarea {
  height: 150px;
}

@media (max-width: 959px) {
  .contact-form .textarea {
    height: 100px;
  }
}

.contact-form__button {
  margin-block-start: 40px;
  text-align: left;
}

@media (min-width: 960px) {
  .contact-form__button .button {
    padding-inline: 69px;
  }
}

@media (max-width: 959px) {
  .contact-form__button {
    margin-block-start: 20px;
  }
}
