/* ══════════════════════════════════════════════════════════════════
   CODEX SITE FOOTER (redesign step 13 — footer-everywhere)
   See design_handoff_codex_redesign/README.md §Component Vocabulary 9.

   The .site-footer already lives outside .container at the app shell
   level, so it's rendered on every view automatically. This sheet
   layers Codex chrome on top + hides the duplicate inline footer
   that homeView.js still emits at the bottom of the home page.

   Single row: logo + version + footer links + disclaimer.
   ══════════════════════════════════════════════════════════════════ */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 5px 20px;
  /* Override legacy 1400px cap from datasource.css — full-bleed so the
     footer matches the rest of the app shell on 2K+ screens. */
  max-width: none;
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--text-dim);
  /* Wipe legacy gradient */
  background-image: none;
  box-shadow: none;
}

.site-footer .footer-inner {
  /* Single-line flex layout. Brand on the left, nav in the middle (flexes
     to take all extra space), disclaimer + version on the right. Wraps
     gracefully when the viewport gets narrow — nav drops first, then
     the disclaimer drops below as a centered single line. */
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 16px;
  /* Neutralise the legacy datasource.css card chrome (32/24 padding, white
     panel, shadow, rounded border) that otherwise leaks in and bloats the
     footer by ~56px of dead vertical space. */
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.site-footer .footer-inner > .footer-brand {
  flex: 0 0 auto;
}
.site-footer .footer-inner > .footer-nav {
  flex: 1 1 auto;
}
.site-footer .footer-inner > .footer-bottom {
  flex: 0 0 auto;
  text-align: right;
  white-space: nowrap;
}

/* ── Brand block ──────────────────────────────────────────────────── */
.site-footer .footer-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  /* Reset legacy datasource.css spacing + divider line. */
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.site-footer .footer-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.site-footer .footer-logo .brand-chonky {
  font-family: 'ChonkyBrand', sans-serif;
  font-size: 1em;
  font-weight: 500;
  /* ChonkyBrand ships a very tall intrinsic line box (~2.2×); pin it to 1
     so the brand doesn't inflate the whole footer row. */
  line-height: 1;
  letter-spacing: -0.02em;
}
.site-footer .footer-logo .brand-cards {
  color: var(--text-dim);
}
.site-footer .footer-logo .brand-dot {
  color: var(--text);
}

.site-footer .footer-tagline {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-mute);
  font-style: italic;
}

/* ── Nav links ────────────────────────────────────────────────────── */
.site-footer .footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0; /* reset legacy datasource.css */
}

.site-footer .footer-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 23px;
  padding: 0 9px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 5px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.site-footer .footer-nav-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}
.site-footer .footer-nav-link:hover {
  background: var(--surface2);
  color: var(--text);
}
.site-footer .footer-nav-link:hover svg {
  color: var(--accent);
}

/* ── Bottom disclaimer row ────────────────────────────────────────── */
.site-footer .footer-bottom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--text-mute);
  /* Reset legacy datasource.css: it pinned a border-top + 16px padding-top
     + tall line-height on .footer-bottom (meant for the old stacked card
     footer), which drew a stray divider line above the disclaimer. */
  border-top: 0;
  padding-top: 0;
  line-height: 1.4;
}
.site-footer .footer-bottom > span {
  /* Each disclaimer fragment stays on one line; the parent flex handles
     wrapping when there isn't room. */
  white-space: nowrap;
}
.site-footer .footer-sep {
  color: var(--text-mute);
  opacity: 0.5;
}

/* ── Dark-mode safety ─────────────────────────────────────────────── */
body.dark-mode .site-footer {
  background: var(--surface);
  border-top-color: var(--border);
}
/* The legacy dark-mode.css gives .footer-inner its own dark rgba panel +
   border + shadow, which clashed with the .site-footer surface behind it
   (two stacked backgrounds). Keep the inner transparent so the footer
   reads as one flat band. */
body.dark-mode .site-footer .footer-inner {
  background: transparent;
  border: 0;
  box-shadow: none;
}
body.dark-mode .site-footer .footer-bottom {
  border-top: 0;
}

/* ── Responsive ───────────────────────────────────────────────────── */
/* On the home page hide the long "not-affiliated" disclaimer — same text
   appears in the static footer-bottom of the home view AND in the legal
   pages. Keeping only the short tagline keeps the chrome quiet. */
@media (max-width: 1400px) {
  .site-footer .footer-bottom [data-i18n="filter.chonkycardsIsNotAffiliatedWithThe"],
  .site-footer .footer-bottom .footer-sep {
    display: none;
  }
}

/* Below 1100px, push the disclaimer onto its own row so the nav has
   room to breathe and stay on a single line above it. */
@media (max-width: 1100px) {
  .site-footer .footer-inner > .footer-bottom {
    flex-basis: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* Phone-ish — stack the three blocks, but keep the nav links flowing
   horizontally (wrapping) instead of the legacy datasource.css one-link-
   per-row column, which made the footer absurdly tall on mobile. */
@media (max-width: 720px) {
  .site-footer .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .site-footer .footer-nav {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }
  .site-footer .footer-nav-link {
    width: auto;
  }
  .site-footer .footer-inner > .footer-bottom {
    text-align: left;
    justify-content: flex-start;
  }
}
