/* Site footer — Figma "WIBN — Components" › Footer › _Base/Footer.
   Phones: brand, the two menus side by side, newsletter. Tablet: brand +
   newsletter, then the menus. Desktop: one row on a 12-column grid — brand 3
   columns (+ 1 empty), first menu 2, second menu 3, newsletter 3. */

.site-footer {
  /* The logo's size (the header's shrunk logo); the column headings line up
     with its bottom edge. The ratio is wibn-logo.svg's viewBox — update it if
     the file changes. */
  --footer-logo-width: var(--logo-size-shrunk);
  --footer-logo-height: calc(var(--footer-logo-width) * 79.77 / 125);
  /* The newsletter field's height (the submit disc sets it), also the social
     row's height from tablet. */
  --footer-submit-size: 1.5rem;
  --footer-field-pad: 0.5rem;
  --footer-field-height: calc(var(--footer-submit-size) + 2 * var(--footer-field-pad) + 2 * var(--border-width));
  padding: var(--space-lg) 0;
  background-color: var(--secondary-color);
  color: var(--white);
}

/* Pink on the purple is weak contrast — use white. */
.site-footer :focus-visible {
  outline-color: var(--white);
}

.site-footer__columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "brand brand"
    "first second"
    "news news";
  gap: var(--space-lg) var(--space-md);
}

.site-footer__brand { grid-area: brand; }
.site-footer__menu--first { grid-area: first; }
.site-footer__menu--second { grid-area: second; }
.site-footer__newsletter { grid-area: news; }

/* Brand + newsletter: copy block, then the social links / email field. */
.site-footer__brand,
.site-footer__newsletter {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.site-footer__copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.site-footer__newsletter .site-footer__copy {
  gap: var(--space-sm);
}

.site-footer__menu {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* Column heading — a .card-label (size, weight, case, tracking) in white.
   Two classes: cards.css, which sets .card-label's colour, loads later. */
.site-footer .site-footer__heading {
  margin: 0;
  font-family: var(--body-font);
  line-height: 1.6;
  color: var(--white);
}

.site-footer__text {
  margin: 0;
  font-size: var(--font-sm);
}

.site-footer__logo {
  display: block;
  width: var(--footer-logo-width);
  color: var(--white);
}

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

/* Social links */

.site-footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__socials li {
  margin: 0;
}

.site-footer__social {
  display: block;
  color: var(--white);
}

.site-footer__social svg {
  display: block;
  width: 2rem;
  height: 2rem;
}

/* Menu links */

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

.site-footer__links a {
  font-size: var(--font-sm);
  color: var(--white);
}

/* Newsletter field — a pill holding a borderless input and the arrow submit.
   Focus on the input rings the whole pill, drawn over its border. No fill: a
   white tint drops the white text to 3.75:1; on the bare purple it's 4.53:1. */

.site-footer__field {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--footer-field-pad) var(--footer-field-pad) var(--footer-field-pad) var(--space-md);
  border: var(--border-width) solid var(--white);
  border-radius: var(--br-rounded);
}

.site-footer__field:has(input:focus-visible) {
  outline: 2px solid var(--white);
  outline-offset: -2px;
}

/* Same specificity as forms.css's base input rule, which loads earlier. */
.site-footer .site-footer__field input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: var(--font-sm);
  color: var(--white);
}

.site-footer .site-footer__field input[type="email"]:focus-visible {
  outline: none;
}

.site-footer__field input::placeholder {
  color: var(--white);
}

.site-footer__submit {
  display: flex;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.site-footer__submit .cta-button__arrow {
  width: var(--footer-submit-size);
  height: var(--footer-submit-size);
  background-color: var(--white);
}

/* Rejected address: the pill takes the error alert's look (a red border alone
   is 1.2:1 on the purple) — tint fill, red border read as 2px like forms.css's
   .is-invalid, red text and arrow disc (4.65:1). The class sits on the pill,
   not the input, so forms.css's input rule doesn't paint a box inside it.
   The focus ring moves outside the pill, white on the purple. */
.site-footer__field.is-invalid {
  border-color: var(--error-color);
  background-color: var(--error-10);
  box-shadow: inset 0 0 0 1px var(--error-color);
}

.site-footer__field.is-invalid:has(input:focus-visible) {
  outline-offset: 2px;
}

.site-footer .site-footer__field.is-invalid input[type="email"],
.site-footer__field.is-invalid input::placeholder {
  color: var(--error-color);
}

.site-footer__field.is-invalid .site-footer__submit .cta-button__arrow {
  background-color: var(--error-color);
}

/* The sign-up form: the result message (inc/api/newsletter.php), the pill,
   then the consent wording — the form's only purpose is the newsletter, so
   sending it is the agreement. Same size steps as the bottom bar. */
.site-footer__signup {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.site-footer__signup .alert {
  margin: 0;
}

.site-footer__consent {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.4;
}

/* Bottom bar — a light rule, then the copyright and registration details. */

.site-footer__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: var(--border-width-sm) solid var(--white-50);
  /* --font-sm on phones (the registration line wraps to several lines there),
     --font-xs from tablet up. */
  font-size: var(--font-sm);
}

.site-footer__bottom p {
  margin: 0;
}

/* "Cookie settings" — reopens the cookie banner (cookie-consent.js shows it).
   A button, styled as the line's underlined link. */
.site-footer__cookie-settings {
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

@media (min-width: 48rem) {
  .site-footer {
    padding: var(--space-xl) 0 var(--space-xxl);
  }

  .site-footer__columns {
    grid-template-areas:
      "brand news"
      "first second";
    gap: var(--space-xl) var(--space-md);
  }

  .site-footer__brand {
    gap: var(--space-lg);
  }

  /* The sign-up form follows the intro like the next paragraph (the
     typography.css `* + p` gap), at the top of the column. */
  .site-footer__newsletter {
    gap: var(--space-md);
  }

  .site-footer__newsletter .site-footer__copy,
  .site-footer__menu {
    gap: var(--space-md);
  }

  /* The social row sits at the foot of the brand column, its icons centred on
     a field-height line. */
  .site-footer__socials {
    margin-top: auto;
    align-items: center;
    min-height: var(--footer-field-height);
  }

  /* Beside the logo, the heading sits on the logo's bottom line. */
  .site-footer__newsletter .site-footer__heading {
    display: flex;
    align-items: flex-end;
    min-height: var(--footer-logo-height);
  }

  .site-footer__consent {
    font-size: var(--font-xs);
  }

  .site-footer__bottom {
    margin-top: var(--space-xl);
    font-size: var(--font-xs);
  }
}

@media (min-width: 62rem) {
  .site-footer__columns {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-areas: none;
  }

  .site-footer__columns > * {
    grid-row: 1;
  }

  .site-footer__brand { grid-column: 1 / span 3; }
  .site-footer__menu--first { grid-column: 5 / span 2; }
  .site-footer__menu--second { grid-column: 7 / span 3; }
  .site-footer__newsletter { grid-column: 10 / span 3; }

  .site-footer__heading {
    display: flex;
    align-items: flex-end;
    min-height: var(--footer-logo-height);
  }

  .site-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
  }
}
