/* Footer (T37, library part). Mid Blue ground from T02's .surface-mid: white text, white links,
   white focus ring (A2, B6). Mobile first: columns stack and every link is a row at least
   44 px tall on phones; 3 columns from 700 px; one row of columns from 1024 px. Tokens only. */

.footer {
  background: var(--theme-bg);
  color: var(--color-text);
}

.footer__inner {
  max-width: calc(var(--container-wide) + 2 * var(--page-gutter));
  margin: 0 auto;
  padding: var(--section-space) var(--page-gutter) var(--space-8);
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-10), 4.4vw, var(--space-16));
}

/* ── Heading and buttons ─────────────────────────────────────────────── */
.footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6) var(--space-8);
}

.footer__heading {
  margin: 0;
  max-width: 100%;
  color: var(--color-heading);
  font-size: clamp(36px, 4.4vw, 64px);
  font-weight: var(--fw-light);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-hero);
  text-wrap: balance;
}

.footer__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  max-width: 100%;
}

/* ── Link columns and contact ────────────────────────────────────────── */
.footer__columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8) var(--gutter);
  padding-top: var(--space-10);
  border-top: var(--border-width) solid var(--color-hairline);
}

.footer__col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.footer__title {
  margin: 0 0 var(--space-1);
  color: var(--color-heading);
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: 0;
}

.footer__links,
.footer__inline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__links li,
.footer__inline li {
  margin: 0;
}

/* A social or legal link and its trailing separator stay on one line. */
.footer__inline li {
  display: flex;
  align-items: center;
}

/* T37a: decorative "·" between socials, legal links and note (aria-hidden in the markup). */
.footer__sep {
  margin-left: var(--space-5);
  opacity: .5;
}

/* The starter's footer slot can hold several links (Cookie settings, Accessibility; move 2): one row, the legal row's gap. */
.footer__slot { flex-wrap: wrap; gap: 0 var(--space-5); }

.footer a.footer__link,
.footer__slot a {
  display: flex;
  align-items: center;
  min-height: var(--tap-min);   /* B6: 44 px rows on phones */
  color: var(--color-link);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer a.footer__link:hover,
.footer__slot a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.footer__office {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-3);
  font-size: 14px;              /* T37a: prototype's office lines are 14 px / 1.5 (no 14 px type token) */
  font-style: normal;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.footer__office-name {
  color: var(--color-heading);
  font-weight: var(--fw-semibold);
}

/* ── Logo, strapline, socials, legal links, note ─────────────────────── */
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
  padding-top: var(--space-6);
  border-top: var(--border-width) solid var(--color-hairline);
}

.footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  min-width: 0;
}

/* One logo field serves header and footer: shown reversed (white) on the blue ground. */
.footer__logo {
  width: auto;
  height: 32px;
  filter: brightness(0) invert(1);
}

.footer__strapline {
  margin: 0;
  font-family: var(--font-fit);
  font-size: var(--fs-body-sm);
  line-height: var(--lh-label);
}

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-5);
  font-size: var(--fs-body-sm);
}

.footer__inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
}

.footer__inline a.footer__link,
.footer__slot a {
  min-width: var(--tap-min);
}

/* The starter's footer slot (e.g. "Cookie settings", move 1) shown as the last legal link: its wrapper adds no space. */
.footer__slot p {
  display: flex;
  align-items: center;
  margin: 0;
}

.footer__note {
  margin: 0;
  padding: var(--space-3) 0;
}

/* Tablet: 3 columns. */
@media (min-width: 700px) {
  .footer__columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-10) var(--gutter);
  }
}

/* Desktop: every column on one row (up to 4 link columns plus contact); compact rows as designed. */
@media (min-width: 1024px) {
  .footer__columns {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }

  .footer a.footer__link,
  .footer__slot a {
    min-height: 0;
    padding: 5px 0;
    line-height: 1.45;
  }

  .footer__inline a.footer__link,
  .footer__slot a {
    min-width: 0;
  }

  .footer__title {
    margin-bottom: var(--space-2);
    font-size: 14px;
  }
}
