/* ---------- Site footer (Figma component 77:96) ----------
   Reusable on every page. Relies on the :root design tokens, the Archivo /
   Big Shoulders Display fonts and the .nav-link styles (Default / Hover /
   Active states, Figma 65:144) defined in index.html. */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  /* 78px top; content ends 142px above the bottom of the 849px frame */
  padding: 78px var(--page-margin) 142px;
  background: var(--neutral-bg);
}

/* Header: Display/L title + Display/M email with a 496px underline */
.footer-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.footer-cta-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  line-height: 68px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--neutral-surface);
}
.footer-email {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  line-height: 48px;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--signal-orange);
  text-decoration: none;
  transition: color 0.15s ease;
}
.footer-email::after {
  content: "";
  display: block;
  /* Ends exactly at the "M": full text width minus the glyph's trailing
     side bearing (~2.4px at 44px, so expressed in em to scale on phones) */
  width: calc(100% - 0.055em);
  height: 1px;
  background: currentColor;
}
.footer-email:hover { color: var(--signal-orange-dark); }
.footer-email:focus-visible { outline: 1px solid var(--signal-orange); outline-offset: 4px; }

/* Columns / divider / bottom bar span the full content width (inside the
   page margins) and reflow as the screen narrows */
.footer-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  width: 100%;
}

.footer-columns {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-logo { display: block; flex-shrink: 0; }
.footer-logo img { display: block; width: 107.212px; height: 78px; }

.footer-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 179px;
}
.footer-col--site { width: 57px; }
.footer-col--social { width: 120px; }
.footer-col-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 1.08px;
  text-transform: uppercase;
  color: var(--neutral-surface);
}
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-links .nav-link { justify-content: flex-start; }

/* Social: icon + Nav Link, 15px apart; hover colours the label like Nav Link */
.footer-social {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
}
.footer-social img { display: block; flex-shrink: 0; }
.footer-social:hover .nav-link,
.footer-social:focus-visible .nav-link { color: var(--signal-orange); }
.footer-social:focus-visible { outline: 1px solid var(--signal-orange); outline-offset: 4px; }
.footer-social--x { gap: 15px; }
/* X/Twitter label is Body/L (20/30) in the Figma component */
.footer-social--x .nav-link { font-size: 20px; line-height: 30px; }

/* Primary/Signal 50% hairline */
.footer-divider {
  height: 1px;
  background: rgba(255, 74, 28, 0.5);
}

.footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-fine {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--neutral-hairline);
  white-space: nowrap;
}
.footer-fine--location { white-space: pre; }

/* Back To Top (Figma 79:179): 130×37 Signal Orange button with arrow */
.btn-back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 130px;
  height: 37px;
  padding: 12px 10px;
  border: 0.5px solid var(--signal-orange);
  border-radius: 4px;
  background: linear-gradient(to bottom, var(--signal-orange), var(--signal-orange-dark));
  color: var(--black);
  font-size: 14px;
  line-height: 22px;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
/* Arrow box is 10×13; the SVG includes its stroke overhang */
.btn-back-to-top img { display: block; width: 12px; height: 15.3966px; margin: -1.4px -1px -1px; }
/* Hover (Figma 79:201): flat Signal Hover fill, border stays Signal Orange */
.btn-back-to-top:hover { background: var(--signal-orange-dark); }
.btn-back-to-top:focus-visible { outline: 1px solid var(--neutral-surface); outline-offset: 3px; }

/* Tablet: columns keep their order but can tighten */
@media (max-width: 1100px) {
  .footer-columns { gap: var(--space-md); }
}
/* Small tablets: the fine print + button no longer fit one line, so the
   row wraps (button drops below) instead of running off the screen */
@media (max-width: 960px) {
  .footer-bar { flex-wrap: wrap; gap: var(--space-xs) var(--space-md); }
}

/* Phone: stacked on the 24px margins, 44px touch targets */
@media (max-width: 640px) {
  .site-footer {
    gap: var(--space-xl);
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
  }
  /* Display/L Mobile, scaled down when needed to stay inside the margins
     (the title is ~338px wide at 40px) */
  .footer-cta-title {
    font-size: min(40px, calc((100vw - 2 * var(--space-md)) / 8.6));
    line-height: 1.1;
  }
  /* Email stays on one line: Display/M scaled to the 327px+ content width */
  .footer-email {
    font-size: min(28px, calc((100vw - 2 * var(--space-md)) / 11.7));
    line-height: 1.15;
  }
  .footer-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg) var(--space-md);
  }
  .footer-logo { grid-column: 1 / -1; }
  .footer-logo img { width: 84px; height: auto; }
  .footer-col,
  .footer-col--site,
  .footer-col--social { width: auto; }
  .footer-col--social { grid-column: 1 / -1; }
  .footer-links { gap: var(--space-xs); }
  .footer-links .nav-link,
  .footer-social { min-height: var(--touch-target); }
  .footer-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .footer-fine { white-space: normal; }
  .btn-back-to-top { width: auto; height: var(--touch-target); padding: 0 var(--space-md); margin-top: var(--space-xs); }
}
