/*
 * Apex — Contact (Get in touch) and footer. Measured in the Figma frame
 * "Wireframe - HomePage - Black - v4": contact links column starts at x≈970,
 * photo left / form right below, office & phone rows under the photo.
 */

/* -------------------------------------------------------------- Contact */

.apex-contact__grid {
  display: grid;
  /* left column 410→960, right column 970→1999 in the design frame */
  grid-template-columns: minmax(0, 35fr) minmax(0, 65fr);
  column-gap: 0.625rem;
  row-gap: 2.5rem;
}

.apex-contact__title {
  font-size: clamp(1.75rem, 2.2vw, 2.75rem);
  line-height: 1.15;
  text-transform: uppercase;
}

.apex-contact__links {
  display: grid;
  align-content: start;
}

.apex-contact__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.125rem;
  padding-left: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: clamp(1.5rem, 2.4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  transition: padding-left var(--apex-transition), border-color var(--apex-transition);
}

.apex-contact__link:first-child { padding-top: 0; }

.apex-contact__link:last-child { border-bottom: 0; }

/* Hover: the label glides right, the rule brightens, the arrow box inverts */
.apex-contact__link:hover {
  padding-left: 0.75rem;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

.apex-contact__link:hover .apex-arrow {
  background: #fff;
  color: #000;
}

.apex-contact__photo img {
  width: 100%;
  height: 100%;
  min-height: 22rem;
  object-fit: cover;
}

.apex-contact__details {
  display: grid;
  margin-top: 1.5rem;
}

.apex-contact__detail {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 2fr;
  gap: 1.5rem;
  align-items: center;
  padding-block: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.apex-contact__detail:last-child {
  border-bottom: 0; /* no rule under the final row */
  padding-bottom: 0;
}

.apex-contact__detail-label {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.apex-contact__detail-value {
  font-size: 1.25rem;
  line-height: 1.4;
}

.apex-contact__form {
  background: #101315;
  /* rhythm tuned so the panel bottom lines up with the PHONE row */
  padding: 4.5rem 2rem 2rem;
  display: grid;
  gap: 3rem;
  align-content: start;
}

/*
 * Contact Form 7 wraps the form in a .wpcf7 div and each control in a
 * .wpcf7-form-control-wrap span. Neutralise both so the panel keeps the exact
 * look of the original static form: the wrapper stretches to the grid cell so
 * the panel bottom still lines up with the PHONE row, and controls stay
 * full-width inside their field.
 */
.apex-contact__grid .wpcf7 { display: flex; flex-direction: column; }

.apex-contact__grid .wpcf7 > .apex-contact__form { flex: 1 1 auto; }

.apex-form-field { display: grid; gap: 0.875rem; }

.apex-form-field .wpcf7-form-control-wrap { display: block; }

/* CF7 feedback appears only after a submit attempt; keep it inside the panel. */
.apex-contact__form .wpcf7-response-output {
  margin: 1.5rem 0 0;
  padding: 0.75rem 1rem;
  border-width: 1px;
  font-size: 0.875rem;
}

.apex-contact__form .wpcf7-not-valid-tip {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
}

.apex-form-field label {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--apex-text);
}

.apex-form-field input,
.apex-form-field textarea {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0;
  color: var(--apex-text);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
}

.apex-form-field input { height: 2.5rem; }

.apex-form-field textarea {
  padding-block: 0.5rem 0.75rem;
}

.apex-form-field input:focus,
.apex-form-field textarea:focus {
  outline: none;
  border-bottom-color: #fff; /* white focus line */
}

.apex-contact__submit {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: #fff;
  border: 0;
  color: #000;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--apex-transition), color var(--apex-transition);
}

.apex-contact__submit:hover {
  background: #000; /* prototype hover: inverted */
  color: #fff;
}

/* --------------------------------------------------------------- Footer */

.apex-footer {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-block: clamp(3rem, 6vw, 5rem) 1.5rem;
  overflow: hidden;
}

.apex-footer__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #0a2a66;
}

.apex-footer__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apex-footer__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 20, 0.25);
}

.apex-footer__intro {
  /* paragraph block starts at x≈575 in the 1999px frame */
  margin-left: clamp(1.5rem, 28.8%, 36rem);
  max-width: 52rem;
  padding-right: 2rem;
}

.apex-footer__blurb {
  /* 24/32 Regular, max 850px, measured in Figma */
  font-size: clamp(1.125rem, 1.2vw, 1.5rem);
  line-height: 1.3333;
  max-width: 53.125rem;
  color: var(--apex-text);
}

.apex-footer__tagline {
  /* 16 / 33.84 Medium, ls -0.72px, measured in Figma (em dash lives in the text) */
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: 2.115;
  font-weight: 500;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  color: var(--apex-text);
}

.apex-footer__bottom {
  margin-top: clamp(4rem, 14vh, 12rem);
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.25rem;
}

.apex-footer__nav {
  display: flex;
  gap: 2rem;
}

.apex-footer__nav a {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: color var(--apex-transition);
}

.apex-footer__nav a:hover { color: var(--apex-primary); }

.apex-footer__wordmark {
  line-height: 0;
}

.apex-footer__wordmark img {
  /* the vector logo spans 1044px in the 1999px frame (52.2vw) */
  width: clamp(16rem, 52.2vw, 65.25rem);
  height: auto;
}

.apex-footer__copy {
  font-size: 0.875rem;
  color: var(--wp--custom--color--text--100);
}

.apex-backtotop {
  position: absolute;
  right: 2rem;
  bottom: clamp(2rem, 6vw, 4rem);
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  /* 12/18 Regular #BBBBBB, measured in Figma */
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #bbb;
}

.apex-backtotop__btn {
  display: grid;
  place-items: center;
  width: 5.5rem; /* 88px, measured in Figma */
  height: 5.5rem;
  border: 1px solid rgba(255, 255, 255, 0.15); /* measured in Figma */
  background: transparent; /* the footer photo shows through */
  color: #fff;
  font-size: 0;
  transition: background var(--apex-transition);
}

.apex-backtotop__btn::after {
  content: "";
  width: 1.375rem;
  height: 1.375rem;
  background-color: currentColor;
  -webkit-mask: var(--apex-arrow-down-icon) center / contain no-repeat;
  mask: var(--apex-arrow-down-icon) center / contain no-repeat;
  transform: rotate(180deg);
}

.apex-backtotop__btn:hover {
  background: rgba(0, 0, 0, 0.4);
}

/* ----------------------------------------------------------- Responsive */

@media (max-width: 960px) {
  .apex-contact__grid { grid-template-columns: 1fr; }
  .apex-footer__intro { margin-left: 1.5rem; }
}
