/**
 * @info The footer — every year's question, what the World Child Forum is, the address, the legal pages
 * @path assets/css/snippets/footer.css
 * @snippet site/snippets/footer.php
 *
 * Black on white, behind a full-width rule, the page's last block. On the
 * page's grid, in the wide column: what this site is, then behind a rule
 * "Was wäre, wenn …" and the years under it; then the text about the forum;
 * then address, contact and the legal pages side by side.
 */

body > footer {
  row-gap: 1.35em;
  margin-block-start: var(--space-air);
  padding-block-end: var(--space-gutter);

  /* the rule, as wide as the grid (inside the gutters, as the sections' rules) */
  &::before {
    content: "";
    grid-column: 1 / -1;
    margin-block-end: calc(clamp(2rem, 5vw, 4rem) - 1.35em);
    border-block-start: var(--rule);
  }

  & > * { grid-column: 1 / -1; }

  & [data-about] p + p { margin-block-start: .5em; }
  & address { display: grid; row-gap: 1.35em; }
  & address p { unicode-bidi: plaintext; }   /* a German address reads left to right, on an Arabic page too */
  & [aria-current] { text-decoration: none; }

  @media (width >= 52rem) {
    & [data-about] { grid-column: 4 / 11; max-inline-size: 40em; margin-block-end: 1.35em; }

    & address {
      grid-column: 1 / 8;
      grid-template-columns: subgrid;

      & p:first-child { grid-column: 1 / 4; }
      & p:last-child  { grid-column: 4 / 8; }
    }

    & nav:not([data-years]) { grid-column: 8 / 13; }
  }
}

/*----------  The years: "Was wäre, wenn …" / 2026 … / 2025 …  ----------*/

[data-years] {
  display: grid;
  grid-template-columns: subgrid;
  row-gap: var(--space-rule);
  margin-block-end: clamp(2rem, 5vw, 4rem);   /* as much as above it */

  & > * { grid-column: 1 / -1; }

  /* "Was wäre, wenn …" under the text, behind a rule: the list goes on from it */
  & > p {
    margin-block-start: var(--space-rule);
    padding-block-start: .75rem;
    border-block-start: var(--rule);
    font-size: var(--size-text);
    font-weight: 700;
    line-height: 1.25;
  }

  & > p + ol li:first-child { border-block-start: 0; }

  & li { border-block-start: var(--rule); }
  & li:last-child { border-block-end: var(--rule); }

  & a {
    display: grid;
    grid-template-columns: 3.5em minmax(0, 1fr);
    gap: var(--space-gap);
    padding-block: .75rem;
    font-size: var(--size-text);
    line-height: 1.25;
    text-decoration: none;
  }

  & b { font-weight: 400; }

  /* what this site is: at the letter's size, above the years */
  & [data-whatif] {
    max-inline-size: 30em;
    margin-block-end: var(--space-rule);
    font-size: var(--size-text);
    line-height: 1.25;

    & p + p { margin-block-start: .75em; }
  }

  & a:hover span,
  & a[aria-current] span {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .15em;
  }

  @media (width >= 52rem) {
    & > * { grid-column: 4 / 13; }
  }
}
