/* Canonical site footer.  This is the only footer layout to maintain. */
/* Covers the browser canvas after the last block: it must continue the footer,
   rather than reveal the page's white background. */
html { background: #000 !important; }

html body .site-footer,
html body.story-page .story-feed > footer.site-footer.project-site-footer {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 164px !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 18px clamp(24px, 3.2vw, 48px) !important;
  grid-template-columns: 108px minmax(0, 1fr) auto !important;
  grid-template-rows: auto auto !important;
  grid-template-areas: "brand social year" "meta meta meta" !important;
  gap: 12px 24px !important;
  align-items: center !important;
  overflow: visible !important;
  background: #000 !important;
  color: #f7f6f2 !important;
}

html body .site-footer .brand-mark {
  grid-area: brand !important;
  display: block !important;
  width: 108px !important;
  height: 72px !important;
  min-width: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
}
html body .site-footer .brand-mark img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: left center !important;
  filter: none !important;
}
html body .site-footer .footer-social {
  grid-area: social !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px 18px !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html body .site-footer > span {
  grid-area: year !important;
  justify-self: end !important;
  margin: 0 !important;
  white-space: nowrap !important;
}
html body .site-footer .footer-meta {
  grid-area: meta !important;
  grid-column: auto !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px 14px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 10px 0 0 !important;
  border-top: 1px solid rgba(255,255,255,.32) !important;
  white-space: normal !important;
  overflow: visible !important;
}
html body .site-footer .footer-social a,
html body .site-footer > span,
html body .site-footer .footer-meta a {
  color: inherit !important;
  font-family: "Bodoni Moda", Georgia, serif !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap !important;
}

/* Primary contact links are intentionally more prominent than footer metadata. */
html body .site-footer .footer-social a {
  font-size: 15px !important;
  line-height: 1.2 !important;
}

@media (max-width: 700px) {
  html body .site-footer,
  html body.story-page .story-feed > footer.site-footer.project-site-footer {
    min-height: 0 !important;
    padding: 16px 18px 18px !important;
    grid-template-columns: 76px minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    gap: 12px 14px !important;
  }
  html body .site-footer .brand-mark {
    width: 76px !important;
    height: 56px !important;
  }
  html body .site-footer .footer-social { gap: 7px 10px !important; }
  html body .site-footer .footer-meta { gap: 5px 10px !important; }
  html body .site-footer .footer-social a,
  html body .site-footer > span,
  html body .site-footer .footer-meta a {
    font-size: 10px !important;
  }
  html body .site-footer .footer-social a {
    font-size: 13px !important;
  }
}

/* Keep the legal links together on one line at every viewport width. */
html body .site-footer .footer-meta {
  flex-wrap: nowrap !important;
  grid-column: 1 / -1 !important;
  white-space: nowrap !important;
  overflow: visible !important;
}
html body .site-footer .footer-meta a {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
@media (max-width: 700px) {
  html body .site-footer .footer-meta { gap: 7px !important; }
  html body .site-footer .footer-meta a { font-size: 9px !important; }
}

/* Final footer contract: compact black signature, social links beside the logo and
   one consistent mono face instead of the legacy serif footer overrides. */
html body .site-footer,
html body.story-page .story-feed > footer.site-footer.project-site-footer {
  min-height: 150px !important;
  padding: 18px clamp(24px, 3.2vw, 48px) 14px !important;
  grid-template-columns: 108px minmax(0, 1fr) auto !important;
  grid-template-areas: "brand social year" "meta meta meta" !important;
  gap: 10px 24px !important;
  align-items: center !important;
}
html body .site-footer .footer-social {
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 18px !important;
}
html body .site-footer .footer-social a,
html body .site-footer > span,
html body .site-footer .footer-meta a {
  font-family: "Bodoni Moda", Georgia, serif !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}
html body .site-footer .footer-meta {
  padding-top: 9px !important;
  justify-content: flex-start !important;
  gap: 8px 14px !important;
}

@media (max-width: 700px) {
  html body .site-footer,
  html body.story-page .story-feed > footer.site-footer.project-site-footer {
    min-height: 126px !important;
    padding: 14px 20px 11px !important;
    grid-template-columns: 76px minmax(0, 1fr) auto !important;
    gap: 10px 14px !important;
  }
  html body .site-footer .brand-mark { width: 76px !important; height: 56px !important; }
  html body .site-footer .footer-social { justify-content: flex-start !important; gap: 10px !important; }
  html body .site-footer .footer-social a,
  html body .site-footer > span,
  html body .site-footer .footer-meta a { font-size: 8px !important; letter-spacing: .035em !important; }
  html body .site-footer .footer-meta { gap: 7px !important; }
}

/* Use the exact same mark as the header, with the light artwork for the black
   footer.  The old tg-logo-light.svg had a different drawing. */
html body .site-footer .brand-mark img {
  content: url("assets/tg-logo-original-light.png?v=20261201-1") !important;
}

/* Legal pages had a more specific legacy footer rule. Keep their footer on the
   same compact grid as portfolio and project pages. */
html body.legal-page .site-footer {
  min-height: 150px !important;
  padding: 18px clamp(24px, 3.2vw, 48px) 14px !important;
  grid-template-columns: 108px minmax(0, 1fr) auto !important;
  grid-template-areas: "brand social year" "meta meta meta" !important;
  gap: 10px 24px !important;
  align-items: center !important;
}
html body.legal-page .site-footer .brand-mark {
  grid-area: brand !important;
  width: 108px !important;
  height: 72px !important;
  margin: 0 !important;
}
html body.legal-page .site-footer .footer-social {
  grid-area: social !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 18px !important;
}
html body.legal-page .site-footer > span {
  grid-area: year !important;
  justify-self: end !important;
}
html body.legal-page .site-footer .footer-meta {
  grid-area: meta !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  gap: 8px 14px !important;
  white-space: nowrap !important;
}
html body.legal-page .site-footer .footer-meta a {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}
@media (max-width: 700px) {
  html body.legal-page .site-footer {
    min-height: 126px !important;
    padding: 14px 20px 11px !important;
    grid-template-columns: 76px minmax(0, 1fr) auto !important;
    gap: 10px 14px !important;
  }
  html body.legal-page .site-footer .brand-mark {
    width: 76px !important;
    height: 56px !important;
  }
  html body.legal-page .site-footer .footer-social { gap: 10px !important; }
  html body.legal-page .site-footer .footer-meta { gap: 7px !important; }
}

/* Prevent the legal-page reset from leaving an extra black canvas below the
   compact footer. Short legal pages still fill the viewport; long policies
   continue naturally past it. */
html:has(body.legal-page),
html body.legal-page {
  min-height: 100vh !important;
}
html body.legal-page {
  min-height: 100vh !important;
}
