@layer components {
  /* Site footer — utility nav with copyright, legal links, language switcher.
     Shared between default shell, login, and public page layouts. Mobile-first. */
  footer.site-footer {
    border-top: 1px solid var(--app-muted-border-color);
    padding-block: var(--app-spacing);
    padding-inline: var(--app-spacing);
    color: var(--app-muted-color);
  }

  footer.site-footer > nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--app-spacing) * 0.5) var(--app-spacing);
    overflow: visible;
  }

  footer.site-footer ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(var(--app-spacing) * 0.25) calc(var(--app-spacing) * 0.75);
    margin: 0;
    padding: 0;
    list-style: none;
  }

  footer.site-footer li {
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
  }

  /* Reset Pico's zero-width-space before-marker on nav li. */
  footer.site-footer li::before {
    content: none;
  }

  footer.site-footer a {
    color: var(--app-muted-color);
    text-decoration: none;
    padding-inline: calc(var(--app-spacing) * 0.25);
    padding-block: calc(var(--app-spacing) * 0.25);
    margin: 0;
    border-radius: var(--app-border-radius);
    transition:
      color var(--app-transition),
      background-color var(--app-transition);
  }

  footer.site-footer a:hover {
    color: var(--app-color);
    background: color-mix(in srgb, var(--app-contrast) 6%, transparent);
  }

  footer.site-footer a:focus-visible {
    outline: 2px solid var(--app-primary);
    outline-offset: -2px;
    color: var(--app-color);
  }

  footer.site-footer small {
    font-size: var(--text-xs);
    line-height: var(--leading-tight);
  }

  /* Language switcher (inline <select>) — compact, sits next to the links. */
  footer.site-footer select {
    margin: 0;
    padding: calc(var(--app-spacing) * 0.2) calc(var(--app-spacing) * 0.5);
    font-size: var(--text-xs);
    height: auto;
    min-height: 0;
    width: auto;
    background-position: right 0.5rem center;
  }

  /* xs — stack link group and language group vertically, centered.
     Better readability than cramming both on one wrapped row. */
  @media (max-width: 576px) {
    footer.site-footer {
      text-align: center;
    }

    footer.site-footer > nav {
      flex-direction: column;
      justify-content: center;
      gap: calc(var(--app-spacing) * 0.75);
    }

    footer.site-footer ul {
      justify-content: center;
    }
  }

  /* Desktop — more breathing room on the sides. */
  @media (min-width: 768px) {
    footer.site-footer {
      padding-block: calc(var(--app-spacing) * 1.25);
      padding-inline: calc(var(--app-spacing) * 2);
    }
  }
}
