/* Shared footer: phones first, tablet and desktop when the content has room. */
.footer {
  --footer-bg: var(--page-bg);
  --footer-text: var(--page-text);
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: 24px;
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.footer .footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand copyright" "meta meta";
  align-items: center;
  justify-items: start;
  gap: 2px 12px;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  text-align: center;
}
.footer .brand {
  grid-area: brand;
  max-width: 100%;
  min-height: 44px;
  color: var(--page-text);
  font-size: 20px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.footer .brand::before {
  flex: 0 0 auto;
  margin: 0;
  border-color: var(--frame);
  box-shadow: 3px 3px 0 var(--frame);
}
@media (max-width: 880px) { .footer .brand { font-size: 18px; } }
.footer .footer-meta {
  grid-area: meta;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  justify-self: stretch;
  gap: 0 12px;
  min-width: 0;
  max-width: 100%;
  font-size: .8125rem;
  line-height: 1.6;
  letter-spacing: .04em;
  text-align: inherit;
  opacity: 1;
  overflow-wrap: anywhere;
}
.footer .footer-contact {
  display: contents;
}
.footer .footer-identity { max-width: 100%; }
.footer .footer-meta a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 6px 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.footer .footer-meta .footer-legal { flex-basis: 100%; }
.footer .copyright {
  grid-area: copyright;
  justify-self: end;
  text-align: right;
  max-width: 100%;
  font-size: .8125rem;
  line-height: 1.6;
  letter-spacing: .04em;
  opacity: 1;
}
.footer a:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

@media (min-width: 700px) {
  .footer .footer-meta .footer-legal { flex-basis: auto; }
}

@media (min-width: 1080px) {
  .footer .footer-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand meta copyright";
    gap: 16px;
  }
}

@media (min-width: 1080px) and (hover: hover) and (pointer: fine) {
  .footer .footer-inner { padding: 6px 0 max(6px, env(safe-area-inset-bottom)); }
  .footer .brand { min-height: 36px; }
  .footer .footer-meta a { min-height: 28px; padding: 4px 0; }
}
