/* =========================================================================
   Component — site footer
   -------------------------------------------------------------------------
   THE PAGE ENDS WITH A RULE (DESIGN_TOKENS.md §9.7)
   -------------------------------------------------------------------------
   A hairline across the column, then the type drops a weight and a size. On
   the public pages the footer is the card surface below that hairline, as on
   the approved canvas (U-2277); the portal's slim foot keeps no fill. Its bottom
   line carries a rule of its own.

   The ink is themed. Measured on `--doc-bg` before U-2277: the quiet ink
   `--doc-ink-soft` 5.61:1 in light and 7.45:1 in dark; on the card surface
   computed from the tokens, 4.74:1 and 6.23:1.
   ========================================================================= */

.site-footer {
  border-top: 1px solid var(--doc-line);
  color: var(--doc-ink-soft);
}

/* The public frame's footer is a surface: the card ground under the rule. */
:is(.marketing-page, .splash-page) .site-footer {
  background: var(--doc-panel);
}

/* THERE IS NO `.site-footer a { color: … }` RULE, and there was one for a
   minute. It named `--sd-secondary`, which is exactly what `base.css` already
   gives every anchor — an inert declaration that looks like a decision, which
   is audit rule `D-10` and [`L-FE-49`]. The hover IS load-bearing: base.css
   underlines on hover and changes no colour, and the footer is the one place a
   reader meets twenty links at once.
   Measured on `--doc-bg`: 9.80:1 in light, 10.08:1 in dark. */
.site-footer a:hover {
  color: var(--sd-secondary-hover);
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  padding: 48px 0 40px;
}

.footer-brand img {
  height: 32px;
  width: auto;
}

.footer-brand p {
  margin: 12px 0 0;
  max-width: 280px;
  color: var(--doc-ink-soft);
}

/* The quiet label of §9.6's third weight, at the report's own size. It was
   12 px at weight 700: a column heading in the same voice as the page's own
   headings, four times over, above the links it labels. */
.footer-col h2 {
  margin: 0 0 12px;
  font: var(--font-eyebrow);
  letter-spacing: var(--eyebrow-tracking);
  text-transform: uppercase;
  color: var(--doc-ink-soft);
}

/* The public frame's footer links are ink and turn to the link colour on
   hover (U-2277); eight pixels between two. */
.footer-col a {
  display: block;
  padding: var(--space-xs) 0;
  color: var(--doc-ink);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 0 28px;
  /* `--doc-line`, and the quieter `--sd-divider` is what §9.2's grammar asks
     for here — this separates two parts of one footer, where the rule above
     separates the footer from the page.
   *
   * THE PAIR IS STATED AGAINST `--doc-panel`, AND THIS RULE IS NOT ON ONE.
   * §9.2's figures (1.35:1 and 1.21:1 in light) are measured against the
   * surface. The footer carries no fill, so both of its rules land on
   * `--doc-bg`, and there they measure **1.12:1** and **1.01:1**. The quieter
   * one is not faint on the page ground; it is not there. Written as
   * `--sd-divider` first, and the screenshot showed nothing at all between the
   * link columns and the copyright line.
   *
   * So on the page ground there is one usable hairline, and both rules use it.
   * That is the ground's property, not a fault in the pair. */
  border-top: 1px solid var(--doc-line);
  font-size: var(--text-caption);
  line-height: var(--text-caption-lh);
  color: var(--doc-ink-soft);
}

/* The slim foot of the admin and the portal half (U-1710): the bottom line
   alone. `.site-footer` already draws the rule above it, so this one draws none —
   two hairlines a line apart would be the doubled rule §9.2 avoids. */
.footer-slim {
  border-top: 0;
}

/* The portal's and the administration's footer sits on the page ground, not on
   a band of its own (R2a). */
.portal-layout .site-footer {
  border-top: 0;
  background: transparent;
}

.footer-slim-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}

@media (max-width: 1023px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 639px) {
  .footer-top {
    grid-template-columns: 1fr;
  }
}
