/* Footer alignment: center the brand message independently of side content. */
footer:not(.legal-footer) {
  grid-template-columns: minmax(220px, 1fr) auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "brand links"
    "copyright links";
  column-gap: 3rem;
  row-gap: 0.35rem;
  position: relative;
}

footer:not(.legal-footer) .footer-logo {
  grid-area: brand;
  justify-self: start;
}

footer:not(.legal-footer) > p {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: 32vw;
  margin: 0;
  text-align: center;
  transform: translate(-50%, -50%);
}

footer:not(.legal-footer) .footer-links {
  grid-area: links;
  align-self: center;
}

footer:not(.legal-footer) > small {
  grid-area: copyright;
  justify-self: start;
  width: 220px;
  margin-top: 0.8rem;
  text-align: center;
}

@media (max-width: 900px) {
  footer:not(.legal-footer) {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "tagline"
      "links"
      "copyright";
    justify-items: center;
    row-gap: 1.35rem;
  }

  footer:not(.legal-footer) .footer-logo,
  footer:not(.legal-footer) > p,
  footer:not(.legal-footer) > small {
    justify-self: center;
  }

  footer:not(.legal-footer) > p,
  footer:not(.legal-footer) > small {
    width: auto;
    margin-top: 0;
  }

  footer:not(.legal-footer) > p {
    position: static;
    max-width: none;
    transform: none;
  }
}
