/*
 * Contact page (template-contact.php, template-parts/contact/*). Built in the R1 system
 * (no mock for this page): a Pebble band, the heading and two short blocks on the left,
 * the enquiry form on a white panel on the right. On a desktop window everything above
 * the footer fits one screen; vertical spacing, control heights and type follow the
 * window height (vh clamps) as on the home page screens. Tokens only, square corners, no
 * shadows. Rules sit under .gp-contact so they outrank the Elementor kit
 * (.elementor-kit-N a, h1) while Elementor stays active.
 */

.gp-contact {
  color: var(--gp-text);
  background: var(--gp-surface-lt);
  --ct-control-h: 44px;
  --ct-row-gap: 16px;
  --ct-label-gap: 6px;
  --ct-area-h: 96px;
}
.gp-contact p { margin: 0; }

.gp-contact .ct { background: var(--gp-surface-lt); }
.gp-contact .ct__inner {
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(0, 11fr);
  gap: clamp(40px, 5vw, 96px);
  align-items: start;
  padding-top: 72px;
  padding-bottom: 72px;
}

/* ---------- Left column ---------- */

.gp-contact .ct__title { font-family: var(--gp-font); color: var(--gp-navy); }
.gp-contact .ct__intro { margin-top: 20px; max-width: 600px; }
/* No stranded words: even lines where a sentence must wrap (pretty where balance is unsupported). */
.gp-contact .ct__intro p,
.gp-contact .ct__steps li,
.gp-contact .ct-form__never { text-wrap: pretty; text-wrap: balance; }
.gp-contact .ct-check label { text-wrap: pretty; }
.gp-contact .ct__intro p { font-size: 17px; line-height: 1.6; color: var(--gp-text); }
.gp-contact .ct__intro p + p { margin-top: 6px; }

.gp-contact .ct__block { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--gp-rule-lt); }
.gp-contact .ct__block + .ct__block { margin-top: 24px; }
.gp-contact .ct__label {
  margin: 0 0 12px;
  font-family: var(--gp-font);
  font-weight: 500;
  font-size: var(--gp-fs-label-sm);
  line-height: 1.4;
  letter-spacing: var(--gp-track-label);
  text-transform: uppercase;
  color: var(--gp-navy);
}

.gp-contact .ct__steps { margin: 0; padding: 0; list-style: none; counter-reset: ct-step; }
.gp-contact .ct__steps li {
  position: relative;
  padding-left: 32px;
  font-size: 14.5px;
  line-height: 1.5;
  counter-increment: ct-step;
}
.gp-contact .ct__steps li + li { margin-top: 8px; }
.gp-contact .ct__steps li::before {
  content: counter(ct-step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .1em;
  color: var(--gp-navy);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .06em;
}

.gp-contact .ct__reach { display: grid; gap: 8px; margin: 0; }
.gp-contact .ct__reach > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: baseline; gap: 16px; }
.gp-contact .ct__reach dt {
  font-weight: 500;
  font-size: var(--gp-fs-label-xs);
  letter-spacing: var(--gp-track-label);
  text-transform: uppercase;
  color: var(--gp-text);
}
.gp-contact .ct__reach dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; color: var(--gp-text); }
.gp-contact .ct__reach a { color: var(--gp-navy); font-weight: 500; }

.gp-contact .ct__social { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 14px 0 0; padding: 0; list-style: none; }
.gp-contact .ct__social a {
  padding-bottom: 2px;
  border-bottom: 1px solid var(--gp-rule-lt);
  color: var(--gp-navy);
  font-weight: 500;
  font-size: var(--gp-fs-label-sm);
  letter-spacing: var(--gp-track-btn);
  text-transform: uppercase;
  text-decoration: none;
  transition: border-color var(--gp-dur-fast) ease-out;
}
.gp-contact .ct__social a:hover { border-color: var(--gp-accent); }

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

.gp-contact .ct__main { background: var(--gp-white); padding: 36px 40px; }

.gp-contact .ct-form { position: relative; margin: 0; }
.gp-contact .ct-form__note { margin-bottom: 18px; font-size: 13px; line-height: 1.5; color: var(--gp-text-2); }
.gp-contact .ct-req { margin-left: 2px; color: var(--gp-navy); font-weight: 600; }
.gp-contact .ct-form__note .ct-req { margin-left: 0; }

.gp-contact .ct-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ct-row-gap) 20px; }
.gp-contact .ct-field { grid-column: 1 / -1; min-width: 0; }
.gp-contact .ct-field--half { grid-column: auto; }
/* WP Armour's admin-only test notice lands inside the form; keep it full width. */
.gp-contact .ct-form > .wpa-test-msg { margin-top: 12px; }

.gp-contact .ct-field__label {
  display: block;
  margin-bottom: var(--ct-label-gap);
  font-weight: 500;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--gp-navy);
}

.gp-contact .ct-field input:not([type="checkbox"]),
.gp-contact .ct-field select,
.gp-contact .ct-field textarea {
  display: block;
  width: 100%;
  height: var(--ct-control-h);
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--gp-gunmetal); /* 8.8:1 on White; a field outline needs 3:1 */
  border-radius: 0;
  background: var(--gp-white);
  color: var(--gp-navy);
  font-family: var(--gp-font);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color var(--gp-dur-fast) ease-out;
}
.gp-contact .ct-field textarea {
  height: var(--ct-area-h);
  min-height: 0;
  padding-block: 10px;
  resize: vertical;
}
.gp-contact .ct-field input::placeholder,
.gp-contact .ct-field textarea::placeholder { color: var(--gp-text); opacity: 1; }
.gp-contact .ct-field input:not([type="checkbox"]):hover,
.gp-contact .ct-field select:hover,
.gp-contact .ct-field textarea:hover { border-color: var(--gp-navy); }
.gp-contact .ct-field input:not([type="checkbox"]):focus,
.gp-contact .ct-field select:focus,
.gp-contact .ct-field textarea:focus {
  border-color: var(--gp-navy);
  outline: 2px solid var(--gp-accent);
  outline-offset: 1px;
}

/* Select: native control, arrow drawn in CSS. */
.gp-contact .ct-select { position: relative; }
.gp-contact .ct-select select { padding-right: 44px; cursor: pointer; }
.gp-contact .ct-select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 18px;
  width: 7px;
  height: 7px;
  margin-top: -6px;
  border-right: 1.5px solid var(--gp-navy);
  border-bottom: 1.5px solid var(--gp-navy);
  transform: rotate(45deg);
  pointer-events: none;
}

/* Consent: a plain square box, the tick drawn in CSS. */
.gp-contact .ct-check { display: flex; align-items: flex-start; gap: 12px; }
.gp-contact .ct-check input[type="checkbox"] {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border: 1px solid var(--gp-gunmetal);
  border-radius: 0;
  background: var(--gp-white);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.gp-contact .ct-check input[type="checkbox"]:checked { background: var(--gp-navy); border-color: var(--gp-navy); }
.gp-contact .ct-check input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border-right: 2px solid var(--gp-white);
  border-bottom: 2px solid var(--gp-white);
  transform: rotate(45deg);
}
.gp-contact .ct-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--gp-accent); outline-offset: 2px; }
.gp-contact .ct-check label { font-size: 13px; line-height: 1.55; color: var(--gp-text); cursor: pointer; }
.gp-contact .ct-check a { color: var(--gp-navy); }

/* Errors: a firm Dark Blue edge and the message under the field. */
.gp-contact .ct-field.is-invalid input:not([type="checkbox"]),
.gp-contact .ct-field.is-invalid select,
.gp-contact .ct-field.is-invalid textarea { border-color: var(--gp-navy); border-left-width: 3px; padding-left: 12px; }
.gp-contact .ct-field.is-invalid input[type="checkbox"] { border-color: var(--gp-navy); border-width: 2px; }
/* The message sits on the label's line, right aligned, so showing it never moves the
   form (the send button must stay on screen). */
.gp-contact .ct-field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 12px; }
.gp-contact .ct-field > * { grid-column: 1 / -1; }
.gp-contact .ct-field > .ct-field__label { grid-column: 1; grid-row: 1; }
.gp-contact .ct-field > .ct-field__error { grid-column: 2; grid-row: 1; }
.gp-contact .ct-field__error {
  margin-bottom: var(--ct-label-gap);
  font-weight: 600;
  font-size: 11.5px;
  line-height: 1.3;
  text-align: right;
  color: var(--gp-navy);
}
.gp-contact .ct-field__error[hidden] { display: none; }

/* Send row: button, the reassurance line beside it, and room for the status message
   so nothing moves when it appears. */
.gp-contact .ct-form__send { display: flex; align-items: center; gap: 12px 24px; margin-top: 22px; }
.gp-contact .ct-form__button { flex: none; }
.gp-contact .ct-form__never { font-size: 12.5px; line-height: 1.5; color: var(--gp-text-2); }
.gp-contact .ct-form__status {
  min-height: 21px;
  margin-top: 10px;
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--gp-navy);
  white-space: pre-line;
}
.gp-contact .ct-form__status.is-error { font-weight: 600; }
.gp-contact .ct-form__status:empty { visibility: hidden; }
.gp-contact .ct-form__noscript { margin-top: 12px; font-size: 14px; }

/* Busy: the button holds its label, dims slightly and its arrow pulses on the spot. */
.gp-contact .ct-form.is-busy .ct-form__button { cursor: progress; opacity: .78; }
.gp-contact .ct-form.is-busy .ct-form__button::after { animation: ct-busy .9s ease-in-out infinite alternate; }
@keyframes ct-busy { from { transform: translateX(0); } to { transform: translateX(6px); } }

/* Without scripts the form cannot be sent (see form.php): the email address stands in. */
html:not(.gp-js) .gp-contact .ct-form__button { display: none; }

/* Phone country picker (intl-tel-input, loaded as on live): brought into the system. */
.gp-contact .iti { display: block; width: 100%; }
.gp-contact .iti .iti__selected-country,
.gp-contact .iti .iti__selected-country:hover,
.gp-contact .iti .iti__selected-country[aria-expanded="true"] { background: transparent; color: var(--gp-navy); border: 0; border-radius: 0; box-shadow: none; padding: 0 6px 0 12px; }
.gp-contact .iti .iti__selected-country:focus-visible { outline: 2px solid var(--gp-accent); outline-offset: -2px; }
.gp-contact .iti .iti__selected-dial-code { font-family: var(--gp-font); font-size: 15px; color: var(--gp-navy); }
.gp-contact .iti__dropdown-content { border: 1px solid var(--gp-stone); border-radius: 0; box-shadow: none; font-family: var(--gp-font); }
.gp-contact .iti__search-input { border-radius: 0; font-family: var(--gp-font); font-size: 14px; }
.gp-contact .iti__country { font-size: 14px; }
.iti--container { z-index: 60; }

/* A short rise-in on load; nothing else moves. Off with reduced motion (base.css). */
.gp-js .gp-contact .ct__aside,
.gp-js .gp-contact .ct__main { animation: ct-rise .5s var(--gp-ease) both; }
.gp-js .gp-contact .ct__main { animation-delay: .06s; }
@keyframes ct-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Desktop window: one screen above the footer ---------- */

@media (min-width: 1101px) and (min-height: 600px) {
  .gp-contact {
    /* Linear in the window height with an offset, so short windows stay tight and
       tall ones open up. */
    --ct-control-h: clamp(34px, calc(7vh - 11px), 56px);
    --ct-row-gap: clamp(6px, calc(2.6vh - 8px), 26px);
    --ct-label-gap: clamp(3px, calc(1vh - 2px), 9px);
    --ct-area-h: clamp(52px, calc(14vh - 35px), 128px);
  }
  .gp-contact .ct__inner {
    min-height: calc(100vh - var(--gp-header-h));
    min-height: calc(100svh - var(--gp-header-h));
    padding-top: clamp(12px, calc(7vh - 27px), 96px);
    padding-bottom: clamp(10px, calc(5vh - 20px), 72px);
  }
  .gp-contact .ct__title { font-size: clamp(28px, calc(7vh - 11px), 52px); }
  .gp-contact .ct__intro { margin-top: clamp(10px, 2vh, 24px); }
  .gp-contact .ct__intro p { font-size: clamp(14px, 2.2vh, 17px); }
  .gp-contact .ct__block { margin-top: clamp(16px, calc(5vh - 14px), 48px); padding-top: clamp(10px, calc(2.4vh - 5px), 24px); }
  .gp-contact .ct__block + .ct__block { margin-top: clamp(12px, calc(4vh - 12px), 36px); }
  .gp-contact .ct__label { margin-bottom: clamp(6px, 1.2vh, 14px); }
  .gp-contact .ct__steps li { font-size: clamp(13px, 1.95vh, 15px); }
  .gp-contact .ct__steps li + li { margin-top: clamp(3px, .8vh, 10px); }
  .gp-contact .ct__reach dd { font-size: clamp(13px, 1.95vh, 15px); }
  .gp-contact .ct__social { margin-top: clamp(8px, 1.6vh, 18px); }

  .gp-contact .ct__main { padding: clamp(12px, calc(4.4vh - 14px), 48px) clamp(24px, 2.6vw, 48px); }
  .gp-contact .ct-form__note { margin-bottom: clamp(6px, 1.3vh, 20px); }
  .gp-contact .ct-field input:not([type="checkbox"]),
  .gp-contact .ct-field select,
  .gp-contact .ct-field textarea { font-size: clamp(14px, 2vh, 16px); }
  .gp-contact .ct-field textarea { padding-block: clamp(6px, 1.2vh, 12px); }
  .gp-contact .ct-form__send { margin-top: clamp(8px, calc(3.4vh - 12px), 32px); }
  .gp-contact .ct-form__status { margin-top: clamp(2px, calc(1.2vh - 4px), 12px); }
  .gp-contact .ct-form__button { padding-block: clamp(12px, 2vh, 16px); }
}

/* ---------- Narrower or shorter windows: stack and scroll ---------- */

@media (max-width: 1100px) {
  .gp-contact .ct__inner { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 56px; padding-bottom: 64px; }
  .gp-contact .ct__intro { max-width: 640px; }
}
@media (max-width: 640px) {
  .gp-contact .ct__main { padding: 24px 20px; }
  .gp-contact .ct-form__grid { grid-template-columns: minmax(0, 1fr); }
  .gp-contact .ct-field--half { grid-column: 1 / -1; }
  .gp-contact .ct-form__send { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   Phone and tablet pass (below 1101px only; the one-screen mode above is desktop only).
   ========================================================================== */

@media (max-width: 1100px) {
  /* One column: heading and introduction, the form, then "What happens next?" and the
     other ways to reach us. (The left column's parts join the page's own grid.) */
  .gp-contact .ct__inner { gap: 0; padding-top: 48px; padding-bottom: 56px; }
  .gp-contact .ct__aside { display: contents; }
  .gp-contact .ct__title,
  .gp-contact .ct__intro { order: 0; }
  .gp-contact .ct__main { order: 1; margin-top: 32px; }
  .gp-contact .ct__block { order: 2; margin-top: 32px; }
  .gp-contact .ct__block + .ct__block { margin-top: 28px; }
  .gp-contact .ct__title { text-wrap: balance; }
  .gp-contact .ct__intro { margin-top: 16px; }

  /* Fields: 16px text so phones do not zoom, 48px controls, roomier labels. */
  .gp-contact {
    --ct-control-h: 48px;
    --ct-row-gap: 20px;
    --ct-label-gap: 8px;
    --ct-area-h: 132px;
  }
  .gp-contact .ct-field input:not([type="checkbox"]),
  .gp-contact .ct-field select,
  .gp-contact .ct-field textarea { font-size: 16px; }
  .gp-contact .iti .iti__selected-dial-code { font-size: 16px; }
  .gp-contact .ct-field__label { font-size: 14px; }
  .gp-contact .ct-form__note { font-size: 14px; }
  .gp-contact .ct-field__error { font-size: 12.5px; }

  /* Consent: a larger box, and the whole label is the target. */
  .gp-contact .ct-check { gap: 14px; }
  .gp-contact .ct-check input[type="checkbox"] { width: 24px; height: 24px; margin-top: 0; }
  .gp-contact .ct-check input[type="checkbox"]:checked::after { left: 7px; top: 2px; width: 7px; height: 13px; }
  .gp-contact .ct-check label { padding: 2px 0 6px; font-size: 14.5px; line-height: 1.55; }

  .gp-contact .ct__steps li,
  .gp-contact .ct__reach dd { font-size: 15px; }
  .gp-contact .ct__steps li + li { margin-top: 10px; }
  .gp-contact .ct__reach { gap: 12px; }
  .gp-contact .ct__reach a { display: inline-block; padding-block: 6px; }
  .gp-contact .ct__social { gap: 16px 28px; }
  .gp-contact .ct__social a { position: relative; }
  .gp-contact .ct__social a::after { content: ''; position: absolute; inset: -12px -12px -10px; }
}
@media (max-width: 640px) {
  /* The white form panel runs edge to edge, so the fields get the full width. */
  .gp-contact .ct__main { margin-inline: calc(-1 * var(--gp-gutter)); padding: 28px var(--gp-gutter) 24px; }
  .gp-contact .ct-form__send { align-items: stretch; gap: 14px; }
  .gp-contact .ct-form__button { justify-content: center; width: 100%; min-height: 52px; }
  .gp-contact .ct-form__never { font-size: 13.5px; text-align: center; }
  .gp-contact .ct-form__status { text-align: center; }
  .gp-contact .ct__reach > div { grid-template-columns: 64px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  /* A field brought into view (first error, or a tap) is never hidden under the bar. */
  .gp-contact .ct-field { scroll-margin-top: calc(var(--gp-header-h) + 24px); }
  /* The country list: 16px search so phones do not zoom, and roomier rows. */
  .iti__search-input { min-height: 44px; padding: 0 12px; font-family: var(--gp-font); font-size: 16px; }
  /* The full-screen list sits above everything, including the back-to-top button. */
  .iti--container.iti--fullscreen-popup { z-index: 1001; }
  .gp-contact .iti__country,
  .iti--fullscreen-popup .iti__country { padding-block: 10px; font-size: 15px; }
}
