/* Footer fit (2026-10-16, patches/footer_social v3). Served max-age=604800: ship a new name.
 * footer-fit.v1.js sets data-ffit="row|stack" on the footer row and data-ffit-b1/b2 (line breaks)
 * on the link row and the pill group. Without the script the footer keeps its old wrapping. */

/* --- the landing footer: spacing that lets one row hold in every language ------------------ */
footer div:has(> .jpa-social) { column-gap: 24px; }
footer div:has(> .jpa-social) > nav { column-gap: 16px; }
footer .jpa-social { column-gap: 8px; }
footer .jpa-social > a { padding-left: 13px; padding-right: 13px; }
/* wide screens: the header's frame (max 1680px, logo 80px in, last button 48px in), as the hero
   since 09-27, so the footer starts under the logo instead of in the narrower page column */
@media (min-width: 1024px) {
  footer > .max-w-page { max-width: 1680px; padding-left: 80px; padding-right: 48px; }
}
/* small phones: a little less air so three pills share a line down to 360px */
@media (max-width: 400px) {
  footer > .max-w-page { padding-left: 20px; padding-right: 20px; }
  footer .jpa-social { column-gap: 6px; }
  footer .jpa-social > a { padding-left: 12px; padding-right: 12px; column-gap: 6px; }
}

/* --- stacked: everything centred ---------------------------------------------------------- */
[data-ffit="stack"] { flex-direction: column; align-items: center; row-gap: 18px; }
[data-ffit="stack"] > * { margin-left: 0 !important; margin-right: 0 !important; }
[data-ffit="stack"] > nav,
[data-ffit="stack"] > .jpa-social,
[data-ffit="stack"] > .social { justify-content: center; }
footer:has([data-ffit="stack"]) p { text-align: center; margin-left: auto; margin-right: auto; }

/* --- a list split over two or three lines -------------------------------------------------- */
[data-ffit-b1] { row-gap: 0 !important; }
[data-ffit-b1] > * { order: 1; }
[data-ffit-b1]::before { content: ""; flex-basis: 100%; height: 0; order: 2; }
[data-ffit-b2]::after { content: ""; flex-basis: 100%; height: 0; order: 4; }
[data-ffit-b1="1"] > :nth-child(n+2), [data-ffit-b1="2"] > :nth-child(n+3),
[data-ffit-b1="3"] > :nth-child(n+4), [data-ffit-b1="4"] > :nth-child(n+5) { order: 3; }
[data-ffit-b2="2"] > :nth-child(n+3), [data-ffit-b2="3"] > :nth-child(n+4),
[data-ffit-b2="4"] > :nth-child(n+5) { order: 5; }
nav[data-ffit-b1] > a { padding-top: 5px; padding-bottom: 5px; }
.jpa-social[data-ffit-b1] > *, .social[data-ffit-b1] > * { margin-top: 4px; margin-bottom: 4px; }
