/* Site footer, shared by every page (each page links this file). One row:
   the data disclaimer, then legal links and the copyright. The top nav
   already links every page, so the footer doesn't repeat it. Separated from
   the page by space, not a rule, as everywhere else in the design system.
   The market scan adds .is-scan to match its 1180px container. */

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--ds-space-6) var(--ds-space-4) var(--ds-space-5);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--ds-space-1-5) var(--ds-space-4);
  color: var(--ds-color-text-muted);
  font-size: var(--ds-text-caption);
}

.site-footer.is-scan { max-width: 1180px; padding-left: 24px; padding-right: 24px; }

.site-footer p { margin: 0; }

.site-footer-links { display: flex; flex-wrap: wrap; gap: var(--ds-space-1) var(--ds-space-3); }

.site-footer a { color: var(--ds-color-text-muted); text-decoration: none; transition: color var(--ds-duration-fast) var(--ds-ease); }
.site-footer a:hover { color: var(--ds-color-text); }
.site-footer a:focus-visible { outline: var(--ds-focus-ring); outline-offset: var(--ds-focus-offset); border-radius: var(--ds-radius); }

@media (max-width: 860px) {
  .site-footer { padding: var(--ds-space-5) var(--ds-space-2) var(--ds-space-4); flex-direction: column; }
  .site-footer.is-scan { padding-left: var(--ds-space-2); padding-right: var(--ds-space-2); }
}

/* Keep the footer at the bottom of the window on short pages (the sign-in
   screens, the 404). Only pages built around a <main> opt in; the market
   scan has none and is always taller than the window anyway. main grows to
   fill the space; width: 100% keeps its max-width + auto-margin centering,
   which a flex item would otherwise shrink to fit its content. */
body:has(> main) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:has(> main) > main { flex: 1 0 auto; width: 100%; }
body:has(> main) > .site-footer { width: 100%; }
