/* Shared site footer — the single source of truth.
 *
 * This file replaces four copies that had drifted apart: home.css (mobile rules
 * only, so it clipped from 721px to 1543px), styles.css (the only correct one),
 * services.html (desktop rules locked inside a min-width:721px block) and
 * contact.html (declared unconditionally after styles.css, so it overrode the
 * working media queries and overflowed by 1110px on a 390px phone).
 *
 * The overflow all came from one thing: three grid tracks with a combined
 * minmax() floor of 1456px, which grid will not shrink below. Every screen
 * narrower than 1544px clipped, and `body { overflow-x: hidden }` turned that
 * into silently missing content rather than a scrollbar.
 *
 * Sizing is container-driven rather than viewport-driven, so the footer is
 * correct wherever it is placed rather than only at the bottom of a full-width
 * page. Type scales with cqi and floors at 13px. The widest tier restores the
 * original desktop grid verbatim — that composition is pixel-locked by the
 * parity harness, so those numbers must not be "tidied".
 */

/* No `width` here on purpose. styles.css sizes .site-footer as part of a shared
   group with .intro/.offer/.process, constraining the inner pages to a
   min(1240px, 100vw - 2rem) column. Setting width would flatten that column to
   full-bleed and change those pages' layout. Being container-driven, the footer
   adapts to whichever column it lands in.

   This file must load AFTER the page stylesheet: the same group sets
   padding-top/bottom to 7rem, which the removed .site-footer rule used to
   override with a shorthand. */
.site-footer {
  container: footer / inline-size;
  background: #070e0b;
  /* Reaches the original 60px/44px by 1200px wide and holds it, so the two
     desktop reference sizes stay pixel-identical. */
  padding: clamp(30px, 5vw, 60px) clamp(18px, 4vw, 44px);
}

.site-footer-inner {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

.site-footer-brand {
  max-width: 520px;
}

.site-footer-logo {
  display: inline-flex;
  align-items: center;
}

.site-footer-logo img {
  width: 133px;
  /* The markup carries width/height attributes for CLS. They are presentational
     hints that set BOTH dimensions, so a rule setting only width lets the height
     attribute through and squashes the logo to 133x96. */
  height: auto;
  display: block;
}

.site-footer-copy {
  margin: 28px 0 0;
  font-size: clamp(14px, 1.2cqi, 16px);
  line-height: 1.28;
  letter-spacing: -0.04em;
  font-weight: 400;
  color: rgba(216, 193, 177, 0.82);
}

.site-footer-nav {
  order: 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.site-footer-group {
  display: grid;
  gap: 18px;
  align-content: start;
}

.site-footer-heading {
  margin: 0 0 8px;
  font-size: clamp(14px, 1.4cqi, 18px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 400;
  color: rgba(216, 193, 177, 0.66);
}

.site-footer-link {
  font-size: clamp(15px, 1.2cqi, 16px);
  line-height: 1.22;
  letter-spacing: -0.035em;
  font-weight: 400;
  color: #f0d0b7;
  text-decoration: none;
  transition: color 220ms ease, opacity 220ms ease;
}

.site-footer-link:hover,
.site-footer-link:focus-visible {
  color: #ffffff;
}

.site-footer-cta-wrap {
  order: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.site-footer-card,
.site-footer-contact {
  min-height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  padding: 16px;
  /* The email address is a single long unbroken token; without this it forces
     the track wider than its share and reintroduces the overflow. */
  overflow-wrap: anywhere;
  transition:
    background-color 240ms ease,
    transform 240ms ease,
    color 240ms ease;
}

.site-footer-card {
  background: rgba(82, 78, 66, 0.72);
  color: #f0d0b7;
  font-size: clamp(16px, 1.7cqi, 22px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 400;
}

.site-footer-card:hover,
.site-footer-card:focus-visible,
.site-footer-contact:hover,
.site-footer-contact:focus-visible {
  background: rgba(96, 91, 78, 0.92);
  transform: translateY(-2px);
}

.site-footer-contact {
  background: #943310;
  color: #f0d0b7;
  font-size: clamp(16px, 1.7cqi, 22px);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 600;
}

.site-footer-meta {
  margin: 32px 0 0;
  font-size: clamp(13px, 1.2cqi, 16px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 400;
  color: rgba(216, 193, 177, 0.64);
  text-align: left;
}

/* Two columns: the link list and the calls to action sit side by side while the
   brand block keeps the full width above them. */
@container footer (min-width: 620px) {
  .site-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }

  .site-footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }

  .site-footer-nav {
    order: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .site-footer-cta-wrap {
    order: 3;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .site-footer-meta {
    text-align: center;
  }
}

/* Three columns. The tracks are ratio-only (minmax floor of 0) so they compress
   with the container instead of forcing it wider. */
@container footer (min-width: 1000px) {
  .site-footer-inner {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 40px;
  }

  .site-footer-brand {
    grid-column: auto;
    max-width: 520px;
  }

  .site-footer-nav {
    padding-top: 8px;
  }

  .site-footer-card,
  .site-footer-contact {
    min-height: 112px;
    border-radius: 20px;
    padding: 20px;
  }
}

/* The original desktop composition, restored verbatim. 1456px is exactly the
   width at which the fixed floors below stop overflowing their container. */
@container footer (min-width: 1456px) {
  .site-footer-inner {
    grid-template-columns: minmax(320px, 1.45fr) minmax(520px, 1.2fr) minmax(520px, 1fr);
    gap: 48px;
  }

  .site-footer-nav {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 24px;
  }

  .site-footer-cta-wrap {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 32px;
  }

  .site-footer-card,
  .site-footer-contact {
    min-height: 144px;
    border-radius: 24px;
    padding: 24px;
  }

  .site-footer-meta {
    margin-top: 44px;
  }
}

/* Touch targets. Scoped to coarse pointers so the desktop composition, which is
   pixel-locked by the parity harness, is untouched: a 20px link with an 18px gap
   is fine for a mouse and unusable with a thumb. */
@media (pointer: coarse) {
  .site-footer-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .site-footer-group {
    gap: 4px;
  }

  .site-footer-logo {
    min-height: 44px;
  }
}
