/* Contact (views/pages/contact/index.php). The map and the factory cards open
   the page (network.css); below them, on the same night lifted a step, the
   enquiry: the form, and beside it each factory on Google Maps. The social
   profiles close the page. */

/* ------------------------------------------------------------ the dark ground
   The page's tokens turned over inside these two sections only, as About
   turns them for its whole <main>: the shared parts that read them (the head,
   the form, the links) follow without rules of their own. Body text holds 7:1
   or better; the muted greys hold 4.5:1 on both darks. */
.enquiry,
.follow {
  --eme-bg: #121517;
  --eme-text: #f3f5f6;
  --eme-text-muted: #a3a9ae;
  --eme-line: rgb(255 255 255 / 0.1);
  --eme-line-strong: rgb(255 255 255 / 0.16);
  --con-well: var(--eme-night);
  --con-soft: rgb(255 255 255 / 0.86);
  --con-faint: #8c9297;
  color-scheme: dark;
  background: var(--eme-bg);
  color: var(--eme-text);
}

.enquiry {
  padding-block: var(--eme-section) clamp(3rem, 6vw, 5.5rem);
}

/* The head sits one step under the page's own (the map's h1). */
.enquiry__head {
  margin-block-end: clamp(2.25rem, 4.5vw, 4rem);
}
.enquiry .home-head__main {
  font-size: clamp(1.625rem, 1.2rem + 1.4vw, 2.625rem);
}
.enquiry .home-head__lead {
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.5rem);
}

/* The form and the map stand side by side once the form has room for its
   fields in pairs, their tops and feet on the same lines: the map stretches to
   the form's height. Narrower, the map follows the form at full width. */
.enquiry__body {
  display: grid;
  gap: clamp(2.75rem, 6vw, 4rem);
}
@media (min-width: 75rem) {
  .enquiry__body {
    grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
    column-gap: clamp(2.5rem, 4.5vw, 6rem);
    align-items: stretch;
  }
}

/* ------------------------------------------------------------------ the form
   Each field a well sunk into the ground; the red rule under the one in use
   is the same as on the light pages. */
.enquiry .form {
  gap: clamp(1.1rem, 0.9rem + 0.5vw, 1.5rem);
}
.enquiry .form__row {
  gap: clamp(1.1rem, 0.9rem + 0.5vw, 1.5rem);
}
.enquiry .field {
  gap: 0.55rem;
}
.enquiry .field__input {
  border-color: var(--eme-line-strong);
  background-color: var(--con-well);
  color: var(--eme-text);
  transition:
    border-color var(--eme-fast) var(--eme-ease),
    background-color var(--eme-fast) var(--eme-ease),
    box-shadow var(--eme-fast) var(--eme-ease);
}
.enquiry .field__input:hover {
  border-color: rgb(255 255 255 / 0.3);
}
.enquiry .field__input:focus {
  border-color: var(--eme-red);
  background-color: #0a0b0c;
}
.enquiry .field__input[aria-invalid="true"] {
  border-color: var(--eme-red);
  background-color: rgb(218 33 39 / 0.08);
}
.enquiry .field__error {
  color: #ff8a8e;
}
.enquiry .form-alert {
  border-color: rgb(218 33 39 / 0.6);
  background: rgb(218 33 39 / 0.1);
  color: #ffb3b6;
}
/* Autofill paints its own light fill; hold the well's colour under it. */
.enquiry .field__input:-webkit-autofill {
  -webkit-text-fill-color: var(--eme-text);
  caret-color: var(--eme-text);
  box-shadow: inset 0 0 0 100px var(--con-well);
}
.enquiry .field__input:-webkit-autofill:focus {
  box-shadow:
    inset 0 -2px 0 var(--eme-red),
    inset 0 0 0 100px #0a0b0c;
}
/* The native arrow is drawn for a light field; this one is the page's own. */
.enquiry select.field__input {
  appearance: none;
  padding-inline-end: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23a3a9ae' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
  cursor: pointer;
}
html[dir="rtl"] .enquiry select.field__input {
  background-position: left 1rem center;
}
.enquiry textarea.field__input {
  min-block-size: 9.5rem;
}
.enquiry .form__actions {
  margin-block-start: var(--eme-space-3);
}
.enquiry .form__actions .btn {
  padding: 1.05em 2.2em;
}
.enquiry .form__note {
  color: var(--eme-text-muted);
}

/* ------------------------------------------------------------- the factories
   A tab per country over its map. The map is Google's, turned to the night
   and softened so it sits in the page rather than on it; until it has drawn
   (or wherever Google cannot reach) a surveyor's grid holds the place, with
   the factory's coordinates under it. */
.sites {
  display: flex;
  flex-direction: column;
  min-inline-size: 0;
}
.sites__tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--eme-line);
  border-block-end: 0;
}
.sites__tab {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: start;
  align-items: center;
  column-gap: 0.65rem;
  row-gap: 0.1rem;
  min-block-size: 4.25rem;
  padding: 0.85rem clamp(0.85rem, 0.6rem + 0.8vw, 1.35rem);
  border: 0;
  background: transparent;
  color: var(--eme-text-muted);
  text-align: start;
  cursor: pointer;
  transition:
    background-color var(--eme-med) var(--eme-ease),
    color var(--eme-fast) var(--eme-ease);
}
.sites__tab + .sites__tab {
  border-inline-start: 1px solid var(--eme-line);
}
/* The pin, as the map above draws it: head office white ringed in red. */
.sites__tab::before {
  content: "";
  grid-row: 1;
  inline-size: 8px;
  block-size: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  transition:
    background-color var(--eme-fast) var(--eme-ease),
    box-shadow var(--eme-fast) var(--eme-ease),
    opacity var(--eme-fast) var(--eme-ease);
}
/* The chosen tab: a red rule along its foot, drawn from the reading side. */
.sites__tab::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 2px;
  background: var(--eme-red);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 480ms var(--eme-ease-out);
}
html[dir="rtl"] .sites__tab::after {
  transform-origin: 100% 50%;
}
.sites__tab:hover {
  color: var(--eme-text);
  background-color: rgb(255 255 255 / 0.03);
}
.sites__tab[aria-selected="true"] {
  color: var(--eme-white);
  background-color: #171b1e;
}
.sites__tab[aria-selected="true"]::before {
  background: var(--eme-red);
  box-shadow: 0 0 0 3px rgb(218 33 39 / 0.25);
  opacity: 1;
}
.sites__tab--hq[aria-selected="true"]::before {
  background: var(--eme-white);
  box-shadow: 0 0 0 2.5px var(--eme-red);
}
.sites__tab[aria-selected="true"]::after {
  transform: scaleX(1);
}
.sites__tab:focus-visible {
  outline: 2px solid var(--eme-red);
  outline-offset: -2px;
}
.sites__country {
  font-size: var(--eme-step-1);
  font-weight: 600;
  line-height: 1.25;
}
/* A long city ("6th of October City") takes a second line rather than an
   ellipsis; the tabs keep one height between them. */
.sites__city {
  grid-column: 2;
  font-size: var(--eme-step--1);
  line-height: 1.35;
  color: var(--con-faint);
  text-wrap: balance;
}
.sites__tab[aria-selected="true"] .sites__city {
  color: var(--eme-text-muted);
}

.sites__panel {
  display: flex;
  flex: 1;
  flex-direction: column;
}
.sites__panel[hidden] {
  display: none;
}
.sites__frame {
  position: relative;
  flex: 1;
  min-block-size: clamp(19rem, 30vw + 8rem, 30rem);
  overflow: hidden;
  border: 1px solid var(--eme-line);
  background: var(--con-well);
  isolation: isolate;
}
/* Held a little under full light and colour so the photograph sits in the
   night instead of glaring from it. */
.sites__frame iframe {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
  filter: saturate(0.8) brightness(0.88) contrast(1.04);
  transition:
    opacity 700ms var(--eme-ease),
    filter var(--eme-med) var(--eme-ease);
}
.sites__frame:hover iframe {
  filter: none;
}
.sites__frame.is-loading iframe {
  opacity: 0;
}

/* The surveyor's grid: a fine mesh with a heavier line every fourth, fading
   out from the centre, and a crosshair on the factory. */
.sites__survey {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.07) 1px, transparent 1px),
    linear-gradient(rgb(255 255 255 / 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: center;
  -webkit-mask-image: radial-gradient(closest-side, #000 40%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 40%, transparent 100%);
}
.sites__cross {
  position: absolute;
  left: 50%;
  top: 50%;
  inline-size: 0;
  block-size: 0;
}
.sites__cross::before,
.sites__cross::after {
  content: "";
  position: absolute;
  background: rgb(218 33 39 / 0.7);
}
.sites__cross::before {
  left: -28px;
  top: -0.5px;
  width: 56px;
  height: 1px;
}
.sites__cross::after {
  left: -0.5px;
  top: -28px;
  width: 1px;
  height: 56px;
}
/* The dot and its ring ride on the frame so the crosshair's lines stay put. */
.sites__survey::before,
.sites__survey::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
}
.sites__survey::before {
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  background: var(--eme-red);
}
.sites__survey::after {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border: 1px solid rgb(218 33 39 / 0.6);
  opacity: 0;
}
.sites__frame.is-loading .sites__survey::after {
  animation: sites-ping 1.8s var(--eme-ease-out) infinite;
}

.sites__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--eme-space-3) var(--eme-space-5);
  padding-block-start: var(--eme-space-4);
}
.sites__where {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  font-size: var(--eme-step--1);
  line-height: 1.5;
  color: var(--con-soft);
}
.sites__street {
  color: var(--con-soft);
}
/* Where it is and what time it is there, on one line when it fits. */
.sites__fix {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  color: var(--con-faint);
  font-variant-numeric: tabular-nums;
}
.sites__time {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.sites__time::before {
  content: "";
  inline-size: 3px;
  block-size: 3px;
  margin-inline-end: 0.4rem;
  border-radius: 50%;
  background: currentColor;
}
.sites__time time {
  color: var(--con-soft);
}
/* The map's own link stands on the night; nc__go comes from network.css. */
.sites .nc__go:focus-visible {
  outline: 2px solid var(--eme-red);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- follow us
   The profiles by name and handle, one row of three under a hairline. */
.follow__inner {
  display: grid;
  gap: var(--eme-space-5) clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding-block: clamp(2.25rem, 4vw, 3.25rem) clamp(3.5rem, 7vw, 6rem);
  border-block-start: 1px solid var(--eme-line);
}
@media (min-width: 75rem) {
  .follow__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}
.follow__title {
  margin: 0 0 0.4rem;
  font-size: var(--eme-step-3);
  font-weight: 600;
  color: var(--eme-white);
}
.follow__head p {
  max-inline-size: 46ch;
  margin: 0;
  color: var(--eme-text-muted);
}
.follow__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--eme-line);
  border: 1px solid var(--eme-line);
}
/* Three abreast once each has room for its handle; stacked, never two and one. */
@media (min-width: 48rem) {
  .follow__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.follow__list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.9rem;
  block-size: 100%;
  min-block-size: 4.75rem;
  padding: 1rem clamp(1rem, 0.7rem + 0.8vw, 1.5rem);
  background: var(--eme-bg);
  color: var(--con-soft);
  transition:
    background-color var(--eme-med) var(--eme-ease),
    color var(--eme-fast) var(--eme-ease);
}
.follow__list a > svg:first-child {
  grid-row: 1 / span 2;
  inline-size: 26px;
  block-size: 26px;
  color: var(--eme-white);
}
.social__name {
  grid-column: 2;
  font-size: var(--eme-step-0);
  font-weight: 600;
  line-height: 1.3;
  color: var(--eme-white);
}
.social__handle {
  grid-column: 2;
  justify-self: start;
  overflow: hidden;
  max-inline-size: 100%;
  font-size: var(--eme-step--1);
  line-height: 1.4;
  color: var(--eme-text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social__out {
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--eme-text-muted);
  transition:
    transform var(--eme-med) var(--eme-ease-out),
    color var(--eme-fast) var(--eme-ease);
}
html[dir="rtl"] .social__out {
  transform: scaleX(-1);
}
.follow__list a:hover {
  background: #171b1e;
}
.follow__list a:hover .social__out {
  color: var(--eme-red);
  transform: translate(2px, -2px);
}
html[dir="rtl"] .follow__list a:hover .social__out {
  transform: scaleX(-1) translate(2px, -2px);
}
.follow__list a:focus-visible {
  outline: 2px solid var(--eme-red);
  outline-offset: -2px;
}

/* -------------------------------------------------------------- the thank-you
   Opens over the page once an enquiry is sent (?enquiry=sent). Rendered open,
   so it reads without a script; contact.js makes it modal. A red rule along
   its top, the tick drawing itself in, the same night as the section under it. */
.sent {
  position: fixed;
  inset: 0;
  z-index: var(--eme-z-drawer);
  inline-size: min(36rem, calc(100% - 2rem));
  block-size: fit-content;
  max-inline-size: none;
  max-block-size: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
  overflow: auto;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-block-start: 2px solid var(--eme-red);
  background: #121517;
  color: #f3f5f6;
  color-scheme: dark;
  box-shadow: 0 2rem 5rem rgb(0 0 0 / 0.55);
}
.sent::backdrop {
  background: rgb(6 7 8 / 0.74);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
/* The page under a modal thank-you holds still. */
html:has(.sent:modal) {
  overflow: hidden;
}

.sent__x {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-end: 0.5rem;
  margin: 0;
}
.sent__close {
  display: grid;
  place-items: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a3a9ae;
  cursor: pointer;
  transition: color var(--eme-fast) var(--eme-ease);
}
.sent__close:hover {
  color: var(--eme-white);
}
.sent :focus-visible {
  outline: 2px solid var(--eme-red);
  outline-offset: 3px;
}

.sent__mark svg {
  display: block;
  inline-size: 3rem;
  block-size: 3rem;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sent__ring {
  stroke: rgb(218 33 39 / 0.35);
  stroke-width: 1.5;
}
.sent__tick {
  stroke: var(--eme-red);
  stroke-width: 2.5;
}

.sent__title {
  margin: 1.25rem 0 0;
  color: var(--eme-white);
}
.sent__lead {
  display: block;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  font-weight: 300;
  line-height: 1.3;
  color: rgb(255 255 255 / 0.86);
}
.sent__main {
  display: block;
  margin-block-start: 0.2rem;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
html[lang="ar"] .sent__main {
  line-height: 1.45;
  letter-spacing: 0;
}
.sent__body {
  max-inline-size: 46ch;
  margin: 1rem 0 0;
  line-height: 1.7;
  color: #a3a9ae;
}

/* A faster way in, for whoever cannot wait a working day. */
.sent__sooner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.1rem;
  margin: 1.25rem 0 0;
  font-size: var(--eme-step--1);
  color: #a3a9ae;
}
.sent__sooner a {
  font-weight: 600;
  color: var(--eme-white);
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.3);
  text-underline-offset: 0.3em;
  transition: text-decoration-color var(--eme-fast) var(--eme-ease);
}
.sent__sooner a:hover {
  text-decoration-color: var(--eme-red);
}

.sent__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-block-start: 1.75rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid rgb(255 255 255 / 0.1);
}
.sent__next {
  display: grid;
  justify-items: start;
  gap: 0.6rem;
}
.sent .line-link {
  --link: rgb(255 255 255 / 0.82);
  --link-hover: var(--eme-white);
}
.sent__foot form {
  margin: 0;
}
@media (max-width: 29.99rem) {
  .sent__foot form,
  .sent__foot .btn {
    inline-size: 100%;
  }
}

/* It rises into place and the tick draws itself in. */
.sent:modal {
  animation: sent-in 460ms var(--eme-ease-out) both;
}
.sent:modal::backdrop {
  animation: sent-fade 360ms var(--eme-ease) both;
}
.sent__ring,
.sent__tick {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}
.sent:modal .sent__ring {
  animation: sent-draw 700ms var(--eme-ease-out) 120ms both;
}
.sent:modal .sent__tick {
  animation: sent-draw 520ms var(--eme-ease-out) 480ms both;
}
@keyframes sent-in {
  from {
    opacity: 0;
    transform: translate3d(0, 1rem, 0) scale(0.98);
  }
}
@keyframes sent-fade {
  from {
    opacity: 0;
  }
}
@keyframes sent-draw {
  from {
    stroke-dashoffset: 1;
  }
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 35.99rem) {
  .sites__tab {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding-inline: 0.5rem;
    text-align: center;
  }
  .sites__tab::before {
    display: none;
  }
  .sites__city {
    grid-column: 1;
    max-inline-size: 100%;
  }
  .sites__frame {
    min-block-size: 20rem;
  }
}

/* ---------------------------------------------------------------- arrival
   site.js arms a section only when it starts below the fold. The head rises
   and its blade grows, then the form, then the map beside it. */
:is(.enquiry, .follow).is-armed [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.5rem, 0);
}
:is(.enquiry, .follow).is-armed [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity 700ms var(--eme-ease) calc(var(--d, 0) * 140ms),
    transform 1000ms var(--eme-ease-out) calc(var(--d, 0) * 140ms);
}
.enquiry.is-armed .home-head__blade {
  transform: skewX(var(--eme-slant)) scaleY(0);
}
.enquiry.is-armed .is-in .home-head__blade {
  transform: skewX(var(--eme-slant));
  transition: transform 900ms var(--eme-ease-out) 200ms;
}
.enquiry__form {
  --d: 1;
}
.sites {
  --d: 2;
}

/* A map chosen from its tab settles in. */
.sites__panel:not([hidden]) {
  animation: sites-in 420ms var(--eme-ease) both;
}

@keyframes sites-in {
  from {
    opacity: 0;
  }
}
@keyframes sites-ping {
  0% {
    transform: scale(0.3);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sites__panel:not([hidden]) {
    animation: none;
  }
  .sites__frame.is-loading .sites__survey::after {
    animation: none;
  }
  .sites__tab::after,
  .sites__frame iframe,
  .social__out {
    transition: none;
  }
  .sent:modal,
  .sent:modal::backdrop,
  .sent:modal .sent__ring,
  .sent:modal .sent__tick {
    animation: none;
  }
}

/* The hero's two ways on: the form below, and the company profile. */
.home-head__aside .contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.75rem;
  margin-block-start: var(--eme-space-4);
}
