/* Site footer on the dark navy background: large logo with the contact
   call, then three columns on the 12-column grid (1, 5, 9) and the
   legal row. */

.site-footer {
  padding-block: clamp(1.5rem, 2.5vw, 2.5rem) clamp(1.25rem, 2.36vw, 2.25rem);
  background: var(--theme-color-inverse);
  color: var(--theme-color-text-inverse);

  /* Design v1: 19/29 at 1440. */
  font-size: clamp(1rem, 1.319vw, 1.1875rem);
  line-height: 1.526;
}

.site-footer a {
  transition: opacity var(--theme-duration) var(--theme-ease-signature);
}

.site-footer a:hover {
  opacity: 0.6;
}

.site-footer__top {
  align-items: center;
  padding-block-end: clamp(6rem, 23.65vw, 21.5rem);
}

.site-footer__brand {
  position: relative;
  grid-column: 1 / span 4;
  width: clamp(11rem, 23vw, 21rem);
}

.site-footer__logo {
  display: block;
  width: 100%;
}

/* Shapes in the footer's own colour that keep the back building of the logo from
   showing through the front one while it builds. They are drawn over the logo
   but outside the link, so the hover filter on the link leaves them alone. */

.site-footer__covers {
  display: none;
}

.js-reveal .site-footer__covers {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.site-footer__covers .logo {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.site-footer a.site-footer__logo {
  transition:
    opacity var(--theme-duration) var(--theme-ease-signature),
    filter 0.6s var(--theme-ease-signature);
}

.site-footer__logo .logo {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Hover: no dimming like the other footer links; whatever the logo is showing
   (also half way through its build animation) fades to white (grayscale, then flat grey, then twice as bright: solid white,
   edges keep their anti-aliasing). The transition is set with the specificity of
   the footer's own link rule, which would otherwise replace it. */

.site-footer a.site-footer__logo,
.site-footer a.site-footer__logo:hover {
  opacity: 1;
}

@media (hover: hover) {
  .site-footer__logo:is(:hover, :focus-visible) {
    filter: grayscale(1) contrast(0) brightness(2);
  }
}

/* The logo builds itself when it scrolls into view (reveal.js, same animation as
   the front page intro, see reveal.css). Without that (reduced motion, no
   script) the plain logo stays. */

.site-footer__build {
  display: none;
}

.js-reveal .site-footer__static {
  display: none;
}

.js-reveal .site-footer__build {
  position: relative;
  display: block;
}

.site-footer__build .logo {
  display: block;
  width: 100%;
  height: auto;
}

.site-footer__question {
  grid-column: 9 / span 2;
}

.site-footer__actions {
  display: flex;
  grid-column: 11 / -1;
  align-items: baseline;
  justify-content: flex-end;
  gap: clamp(1rem, 1.7vw, 1.5rem);
}

.site-footer__language {
  display: flex;
  font-size: var(--theme-fs-xs);
}

.site-footer__language li + li::before {
  content: '|';
  margin-inline: 0.4em;
}

.site-footer__language [aria-current] {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.site-footer__language .is-muted {
  opacity: 0.4;
}

.site-footer__main {
  position: relative;
  row-gap: var(--theme-space-md);
  padding-block: clamp(1.5rem, 2.5vw, 2.25rem) clamp(4rem, 10.2vw, 9.5rem);
}

.site-footer__main::before {
  content: '';
  position: absolute;
  inset: 0 var(--theme-margin) auto;
  border-block-start: 1px solid var(--theme-color-border-inverse);
}

.site-footer__label {
  margin-block-end: clamp(1.5rem, 3.26vw, 3rem);
  font-size: clamp(0.9375rem, 1.18vw, 1.0625rem);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: 0;
}

.site-footer__text {
  font-style: normal;
  list-style: none;
}

.site-footer__column--visit {
  grid-column: 1 / span 4;
}

.site-footer__column--nav {
  grid-column: 5 / span 4;
}

.site-footer__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--theme-gutter);
}

.site-footer__column--contact {
  grid-column: 9 / -1;
}

.site-footer__bottom {
  align-items: baseline;
  row-gap: 0.5rem;
}

.site-footer__copyright {
  grid-column: 1 / span 4;
}

.site-footer__legal {
  display: flex;
  grid-column: 5 / span 4;
  list-style: none;
}

.site-footer__legal li + li::before {
  content: '|';
  margin-inline: 0.4em 0.25em;
}

.site-footer__top-link {
  grid-column: 9 / -1;
}

@media (width <= 768px) {
  .site-footer__brand,
  .site-footer__question,
  .site-footer__column--visit,
  .site-footer__column--nav,
  .site-footer__column--contact,
  .site-footer__copyright,
  .site-footer__legal,
  .site-footer__top-link {
    grid-column: 1 / -1;
  }

  .site-footer__question {
    margin-block-start: var(--theme-space-md);
    grid-column: 1 / span 6;
  }

  .site-footer__actions {
    margin-block-start: var(--theme-space-md);
    grid-column: 7 / -1;
  }

  .site-footer__top {
    padding-block-end: var(--theme-space-lg);
  }
}

/* Drawer: reveal.js adds has-footer-drawer when the footer fits on a screen. The
   footer then sticks to the bottom of the screen behind the page (the main
   content has the page background and sits above it), so it is uncovered as the
   last section scrolls up. It is not fixed anywhere else: it only stays put
   until its own place in the page is reached. */

@media (prefers-reduced-motion: no-preference) {
  .has-footer-drawer main {
    position: relative;
    z-index: 1;
    background: var(--theme-color-background);
  }

  .has-footer-drawer .site-footer {
    position: sticky;
    inset-block-end: 0;
    z-index: 0;
  }
}
