footer {
  border-top: 1px solid var(--line);
  padding: 28px 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

/* Highlighted (base.css sets its colours): the muted text and the line are
 * the page's, so they're redone for the accent background. */
footer.is-highlighted {
  border-top-color: transparent;
  color: var(--hl-ink);
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
  footer.is-highlighted {
    color: color-mix(in srgb, var(--hl-ink) 80%, var(--hl-base));
  }
}

/* With a privacy policy link and/or a partner: privacy on the left, the
 * copyright in the middle, the partner on the right. */
.footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px 24px;
}

/* Flex, so a partner with a logo lines up with the text beside it. */
.footer-side {
  display: flex;
  align-items: center;
}

.footer-privacy {
  justify-self: start;
}

.footer-partner {
  justify-self: end;
}

footer a {
  color: inherit;
  text-decoration: none;
  transition: color .2s;
}

footer a:hover {
  color: var(--text);
}

.footer-privacy a:hover,
.partner:hover span {
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer a:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
  border-radius: 4px;
}

.partner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.partner-logo {
  display: block;
  height: 24px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

/* A logo drawn only in black; dark themes set --logo-mono-filter to lighten it. */
.partner-logo.mono {
  filter: var(--logo-mono-filter, none);
}

@media (max-width: 640px) {
  .footer-row {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }

  .footer-privacy,
  .footer-partner {
    justify-self: center;
  }

  /* Links first, the copyright last. */
  .footer-copy {
    order: 1;
  }

  .footer-side:empty {
    display: none;
  }
}
