/* ==========================================================================
   Contact — /contact
   Paper artboard "21 Contact" (2LR-0). Everything shared comes from site.css
   (the enquiry form included: forms.css); this file holds only what is
   particular to this page. Tokens only, logical properties only, every rule
   under .page-contact.
   ========================================================================== */

.page-contact {
  /* The 56/62 contact values (Email, Web, Location): 56 → 28 */
  --contact-value-size: clamp(1.75rem, 1.1667rem + 2.5926vw, 3.5rem);
  --contact-value-lh: calc(62 / 56);
}

/* Arabic needs the taller line of its own headings. */
.page-contact:lang(ar) { --contact-value-lh: var(--lh-h2); }

/* ---- Text links of this page: a 44px touch target without changing the 20px row ---- */
.page-contact main .link { position: relative; }

.page-contact main .link::after {
  content: "";
  position: absolute;
  inset: -0.75rem -0.5rem;
}

/* The two in-page links carry a vertical chevron: it moves along its own axis, not sideways. */
@media (hover: hover) {
  .page-contact .contact-jump--down:hover .icon { translate: 0 3px; }
  .page-contact .contact-jump--up:hover .icon { translate: 0 -3px; }
}

/* ---- 01 Hero (3LV-0) ---- */

/* 56px above the breadcrumbs, and Paper's one teal glow from the top end corner. */
.page-contact .contact-hero {
  padding-block-start: calc(var(--header-offset) + var(--space-14));
  background-image: radial-gradient(ellipse 46% 80% at 100% 0%, color-mix(in srgb, var(--color-teal) 7%, transparent) 0%, transparent 70%);
  background-repeat: no-repeat;
}

[dir="rtl"] .page-contact .contact-hero {
  background-image: radial-gradient(ellipse 46% 80% at 0% 0%, color-mix(in srgb, var(--color-teal) 7%, transparent) 0%, transparent 70%);
}

.page-contact .contact-hero .hero__copy {
  --hero-top: clamp(2.5rem, 3.8889vw, 3.5rem);       /* 56 */
  --hero-gap: clamp(1.5rem, 2.2222vw, 2rem);         /* 32 */
  --hero-bottom: clamp(2.5rem, 3.8889vw, 3.5rem);    /* 56 */
}

/* Lower row, 72px under the headline: the link at the start, the lead (5 columns) at the end, on one baseline. */
.page-contact .contact-hero__row {
  align-items: end;
  padding-block-start: clamp(1rem, 2.7778vw, 2.5rem);  /* 40, on top of the 32px gap */
}

.page-contact .contact-hero__row > * { grid-row: 1; }

/* When the headline wraps, the emphasised phrase stays whole instead of leaving one word on a line. */
.page-contact .contact-hero h1 em { white-space: nowrap; }

.page-contact .contact-hero__jump { display: flex; }

/* ---- 02 Project enquiry form (3R4-0) ---- */
.page-contact .contact-enquiry {
  padding-block: clamp(3.5rem, 2.3333rem + 5.1852vw, 7rem) clamp(2.5rem, 2rem + 2.2222vw, 4rem);   /* 112 / 64 */
}

/* Reassurance column: 56 above, 48 below, 64 kept clear of the form panel */
.page-contact .contact-intro {
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 2.1667rem + 3.7037vw, 5.5rem);      /* 88 */
  padding-block: var(--space-14) var(--space-12);
  padding-inline-end: var(--space-16);
}

.page-contact .contact-intro__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-10);
}

.page-contact .contact-points { align-self: stretch; }

.page-contact .contact-points__label { padding-block-end: var(--space-4); }

/* "What to include": hairline rows, 20px padding, a 24px numeral lane on the first text line */
.page-contact .contact-points__list {
  --rule-key: var(--space-6);
  --rule-pad-top: var(--space-5);
  --rule-pad-bottom: var(--space-5);
}

.page-contact .contact-points__list .rule-list__row { gap: var(--space-5); }

.page-contact .contact-points__list .rule-list__key { line-height: calc(var(--fs-body) * var(--lh-body)); }

/* Direct email: 28/34, underlined, with the outward arrow */
.page-contact .contact-direct {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.page-contact .contact-direct__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  max-inline-size: 100%;
  color: var(--c-ink);
}

/* 44px touch target around the line, whatever size the line has */
.page-contact .contact-direct__link::after {
  content: "";
  position: absolute;
  inset: min(0px, (100% - 2.75rem) / 2) 0;
}

.page-contact .contact-direct__address {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
  transition: text-underline-offset var(--dur-base) var(--ease-out);
}

.page-contact .contact-direct__link .icon { transition: translate var(--dur-base) var(--ease-out); }

@media (hover: hover) {
  .page-contact .contact-direct__link:hover .contact-direct__address { text-underline-offset: 8px; }
  /* Physical on purpose: the outward arrow is not mirrored in Arabic. */
  .page-contact .contact-direct__link:hover .icon { translate: 2px -2px; }
}

/* The form adapts to its own width (forms.css names it the container "enquiry"). Half of a narrow row cannot
   hold the English phone placeholder, "Your number, with country code": about 243px of text. While the form is
   narrower than 36.5rem (the two-column desktop layout from 1025px to about 1320px, and a short band near 700px
   just before forms.css gives every field its own row), the email and phone fields take a full row each. The
   other rows keep Paper's two fields per row. */
@container enquiry (max-width: 36.5rem) {
  .page-contact .form__row > :is([data-field="email"], [data-field="phone"]) { grid-column: 1 / -1; }
}

/* TEMPORARY, while the enquiry service is not connected: no enquiry can have been sent, so the page must never
   say one was. Without JavaScript the shared form shows its messages by address (forms.css: `:target` on
   #enquiry-sent), which lets a hand-made link ending in #enquiry-sent display "Enquiry sent." and hide the
   fields. Until the service is connected that address shows what is true instead: the "temporarily unavailable"
   notice above the form, with the fields left in place.
   REMOVE THIS BLOCK when CONTACT-INTEGRATION.md is followed: with it, a visitor without JavaScript would not see
   the confirmation of a real enquiry. !important answers the same flag in forms.css. */
.page-contact .form:not([data-js]) .form__success:target { display: none !important; }
.page-contact .form:not([data-js]):has(.form__success:target) .form__notice { display: flex !important; }
.page-contact .form:not([data-js]):has(.form__success:target) :is(.form__fields, .form__actions) { display: flex; }

/* ---- 04 Other contact methods (6WD-0) ---- */
.page-contact .contact-methods {
  padding-block: clamp(4.5rem, 3.0833rem + 6.2963vw, 8.75rem);   /* 140 */
}

/* The label sits on the first line of the 22/32 lead. */
.page-contact .contact-methods__label {
  align-self: start;
  min-block-size: calc(var(--fs-lead) * var(--lh-lead));
}

.page-contact .contact-methods__list {
  margin-block-start: clamp(2.5rem, 1.8333rem + 2.963vw, 4.5rem);   /* 72 */
  border-block-end: 1px solid var(--c-rule);
}

/* One row: label column (3) · value (8) · arrow (1), on the page grid so the value lines up with the lead above. */
.page-contact .contact-method {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
  column-gap: var(--grid-gap);
  align-items: center;
  padding-block: var(--space-10);
  border-block-start: 1px solid var(--c-rule);
}

.page-contact .contact-method__label {
  grid-column: 1 / span 3;
  display: flex;
  align-items: center;
  gap: var(--space-3);                        /* a 20px icon in Paper's 32px slot */
  font-size: var(--fs-label);
  font-weight: var(--weight-light);
  line-height: var(--lh-label);
  letter-spacing: var(--tracking-normal);
  text-transform: uppercase;
  color: var(--c-muted);
}

.page-contact .contact-method__label .icon { color: var(--c-ink); }

.page-contact .contact-method__value {
  grid-column: 4 / span 8;
  min-inline-size: 0;
  font-size: var(--contact-value-size);
  line-height: var(--contact-value-lh);
  letter-spacing: var(--tracking-tight);
  color: var(--c-heading);
  text-wrap: balance;
}

.page-contact .contact-method__arrow {
  grid-column: 12;
  display: flex;
  justify-content: flex-end;
  color: var(--c-ink);
}

.page-contact .contact-method__arrow .icon { transition: translate var(--dur-base) var(--ease-out); }

@media (hover: hover) {
  /* Physical on purpose: the outward arrow is not mirrored in Arabic. */
  .page-contact a.contact-method:hover .contact-method__arrow .icon { translate: 3px -3px; }
}

/* ---- 05 What happens next (6XY-0) ---- */
.page-contact .contact-next { --section-gap: clamp(2.5rem, 1.3333rem + 5.1852vw, 6rem); }   /* 96 */

/* Label · title · the link back to the form at the end of the row, 14px above the title's last baseline box */
.page-contact .contact-next__header { align-items: end; }

.page-contact .contact-next__header .section-header__label { align-self: start; }

.page-contact .contact-next__header .section-header__title { grid-column: 4 / span 6; }

.page-contact .contact-next__back {
  grid-column: 10 / -1;
  display: flex;
  justify-content: flex-end;
  padding-block-end: 0.875rem;
}

/* Three steps on one hairline; a 7px square marks where each begins. */
.page-contact .contact-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--grid-gap);
  border-block-start: 1px solid var(--c-rule);
}

.page-contact .contact-steps__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-14);
  padding-block-start: var(--space-8);
  padding-inline-end: var(--space-14);
}

.page-contact .contact-steps__item::before {
  content: "";
  position: absolute;
  inset-block-start: -4px;
  inset-inline-start: 0;
  inline-size: 7px;
  block-size: 7px;
  background-color: var(--c-marker);
}

.page-contact .contact-steps__num {
  font-size: var(--fs-label);
  font-weight: var(--weight-light);
  line-height: var(--lh-label);
  color: var(--c-muted);
}

/* Paper breaks these sentences where the line fills, not into even lines. */
.page-contact .contact-steps__text { text-wrap: pretty; }

/* ---- 06 Closing brand statement (7D1-0) ----
   The shared closing banner's ground with this page's own content: mark and place, statement, tagline and link. */
.page-contact .contact-closing {
  gap: clamp(3rem, 7.2222vw, 6.5rem);                                         /* 104 */
  min-block-size: 0;
  padding-block: clamp(4rem, 7.7778vw, 7rem) clamp(3rem, 6.1111vw, 5.5rem);   /* 112 / 88 */
}

.page-contact .contact-closing__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-6);
}

/* The mark at 230 × 140 */
.page-contact .contact-closing__mark {
  inline-size: clamp(7.5rem, 15.9722vw, 14.375rem);
  block-size: auto;
  aspect-ratio: 294 / 179;
  color: var(--color-on-dark);
}

/* Paper sets this statement at -5% so that its first line fills the measure exactly. Below 1440 the size
   follows the container, so the two lines keep their shape down to the tablet. */
.page-contact .contact-closing .cta-closing__statement { font-size: min(var(--fs-display), 8.3333vw); }

.page-contact:lang(en) .contact-closing .cta-closing__statement { letter-spacing: -0.05em; }

.page-contact .contact-closing__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--grid-gap);
  padding-block-start: var(--space-8);
  border-block-start: 1px solid var(--c-rule);
}

.page-contact .contact-closing__action {
  display: flex;
  flex: none;
}

/* ---- Narrow desktop: the reassurance column gives half of its clear space back to its text ---- */
@media (max-width: 1280px) {
  .page-contact .contact-intro { padding-inline-end: var(--space-8); }
}

/* ---- Tablet ---- */
@media (max-width: 1024px) {
  /* Hero: the lead, then the link under it */
  .page-contact .contact-hero__row { --grid-row-gap: var(--space-6); }
  .page-contact .contact-hero__row > * { grid-row: auto; }

  /* Enquiry: the reassurance column sits above the form */
  .page-contact .contact-intro {
    gap: var(--space-10);
    padding-block: 0;
    padding-inline-end: 0;
  }

  .page-contact .contact-intro__main { gap: var(--space-8); }

  .page-contact .contact-points { max-inline-size: 39.25rem; }   /* 628: six columns */

  /* Other contact methods: the label above the lead, and above each value */
  .page-contact .contact-methods__intro { --grid-row-gap: var(--space-5); }
  .page-contact .contact-methods__label { min-block-size: 0; }

  .page-contact .contact-method {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: var(--space-4);
    padding-block: var(--space-8);
  }

  .page-contact .contact-method__label { grid-column: 1 / -1; }
  .page-contact .contact-method__value { grid-column: 1; }
  .page-contact .contact-method__arrow { grid-column: 2; }

  /* What happens next: the link back sits under the title */
  .page-contact .contact-next__header .section-header__title { grid-column: 1 / -1; }

  .page-contact .contact-next__back {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-block-end: 0;
  }

  .page-contact .contact-steps__item {
    gap: var(--space-10);
    padding-inline-end: var(--space-4);
  }

  .page-contact .contact-steps__text { text-wrap: balance; }

}

/* ---- Phone ---- */
@media (max-width: 768px) {
  .page-contact .contact-hero__row { padding-block-start: 0; }

  /* "What to include": the numeral stays beside its line */
  .page-contact .contact-points__list .rule-list__row {
    flex-direction: row;
    gap: var(--space-4);
    --rule-pad-top: var(--space-4);
    --rule-pad-bottom: var(--space-4);
  }

  .page-contact .contact-points__list .rule-list__key {
    inline-size: var(--space-6);
    line-height: calc(var(--fs-body) * var(--lh-body));
  }

  .page-contact .contact-method { padding-block: var(--space-6) var(--space-7); }

  /* Steps: one under another, each on its own hairline */
  .page-contact .contact-steps {
    grid-template-columns: minmax(0, 1fr);
    border-block-start: 0;
  }

  .page-contact .contact-steps__item {
    gap: var(--space-4);
    padding-block: var(--space-6) var(--space-8);
    padding-inline-end: 0;
    border-block-start: 1px solid var(--c-rule);
  }

  .page-contact .contact-steps__item:last-child { padding-block-end: 0; }

  /* Closing statement: the first line wraps, so it takes the fluid display size again */
  .page-contact .contact-closing .cta-closing__statement { font-size: var(--fs-display); }

  .page-contact .contact-closing__row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Small phone ---- */
@media (max-width: 480px) {
  /* Closing banner: the place line under the mark */
  .page-contact .contact-closing__top {
    flex-direction: column;
    gap: var(--space-8);
  }
}
