/* Contact (contact.php): the form next to the office details, the map under them, then the
   company registration details. */

.ct-hero {
  padding-bottom: clamp(36px, 5vw, 64px);
}

.ct-hero .gtp-page-hero__title {
  max-width: 17em;
  font-size: clamp(2.25rem, 1.5rem + 3.2vw, 4.5rem);
}

.ct-intro {
  max-width: var(--text-wrap);
  margin-bottom: clamp(40px, 5vw, 64px);
}

.ct-grid {
  display: grid;
  gap: clamp(48px, 6vw, 96px);
  margin-bottom: clamp(64px, 8vw, 120px);
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--line-accent);
}

/* From 1000px: the form and the office box side by side and as tall as each other, the map
   across both columns under them. Without a form the office box takes the whole row. */
@media (min-width: 1000px) {
  .ct-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    row-gap: clamp(40px, 4vw, 64px);
  }

  .ct-grid > .ct-office:first-child,
  .ct-map {
    grid-column: 1 / -1;
  }
}

/* Phones and tablets: the phone numbers and e-mail, then the form, then the map. */
@media (max-width: 999px) {
  .ct-office {
    order: -1;
  }
}

/* ---------- Form: name and e-mail, department and subject side by side ---------- */

@media (min-width: 640px) {
  .ct-form .wpcf7-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }

  .ct-form .wpcf7-form > * {
    grid-column: 1 / -1;
  }

  .ct-form .wpcf7-form > p:nth-of-type(-n + 4) {
    grid-column: auto;
  }
}

.wpcf7 .hidden-fields-container {
  display: none;
}

/* ---------- Office details in the light blue box ---------- */

/* A column: the details at the top, the directions button at the bottom, so the box can be
   stretched to the height of the form. */
.ct-office {
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.5vw, 48px);
}

.ct-office__inner {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.ct-office .gtp-contours {
  --contours-opacity: 0.12;
}

.ct-office__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  color: var(--ink);
  font-family: var(--ff-text);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ct-office__title::before {
  content: "";
  width: 32px;
  height: 1px;
  background: currentColor;
}

.ct-office__address {
  margin: 0 0 24px;
  color: var(--ink);
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
  line-height: 1.25;
}

.ct-office__links {
  display: grid;
  gap: 6px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.ct-office__links li {
  margin: 0;
  list-style: none;
}

/* Each link is at least 44px tall, a comfortable tap target. */
.ct-office__links a,
.ct-office__fax {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  color: var(--ink);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.ct-office__links a {
  background: linear-gradient(currentColor, currentColor) 32px calc(100% - 6px) / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease);
}

.ct-office__links a:hover,
.ct-office__links a:focus-visible {
  background-size: calc(100% - 32px) 1px;
}

.ct-office__links svg {
  flex: none;
}

/* Secondary by weight only: navy at a lower opacity would fall under 4.5:1 on the light blue. */
.ct-office__fax {
  font-weight: 400;
}

.ct-office__route {
  align-self: flex-start;
  margin-top: auto;
}

.ct-office__route svg {
  flex: none;
}

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

.ct-map {
  display: block;
}

.ct-map__map.gtp-map {
  height: clamp(320px, 26vw, 420px);
}

.ct-map__coords {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.12em;
}

/* ---------- Registration details ---------- */

.ct-company {
  padding-top: clamp(28px, 3vw, 40px);
  border-top: 1px solid var(--line);
}

.ct-company__title {
  margin-bottom: 28px;
}

/* Columns no narrower than the bank account number on one line (about 345px at 19px). */
.ct-company__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 32px clamp(32px, 4vw, 64px);
  margin: 0;
}

.ct-company__item {
  margin: 0;
}

.ct-company__item dt {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.ct-company__item dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

/* The account number never breaks; only the narrowest phones may wrap it. */
@media (min-width: 600px) {
  .ct-company__account {
    white-space: nowrap;
  }
}

/* The copy button on its own line under the number. */
.ct-copy,
button.ct-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line-accent);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-family: var(--ff-text);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}

.ct-copy:hover,
.ct-copy:focus-visible,
.ct-copy.is-copied {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--navy);
}

.ct-copy[hidden] {
  display: none;
}

/* On paper: the office and the company details, without the form, the map and the copy button. */
@media print {
  .ct-form,
  .ct-map,
  .ct-copy {
    display: none !important;
  }
}
