/* Site footer: deep brand blue in both themes. On phones it stacks, with the short items centred. */

.site-footer {
  --focus-ring: #ffffff;
  background-color: var(--brand-deep);
  color: var(--on-brand-soft);
  font-size: .875rem;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
  padding: 40px 0 32px;
}

.site-footer__brand {
  text-align: center;
}

.site-footer__logo {
  display: inline-block;
}

.site-footer__logo img {
  display: block;
  width: 184px;
  height: auto;
}

.site-footer__newsletter {
  margin: 22px 0 0;
  text-align: left;
}

.site-footer__newsletter-title {
  display: block;
  margin-bottom: 10px;
  color: var(--on-brand);
  font-size: .9375rem;
  font-weight: 500;
  text-align: center;
}

.site-footer__newsletter-row {
  display: flex;
  gap: 8px;
}

.site-footer__newsletter input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--brand-input-border);
  border-radius: var(--radius);
  background-color: var(--brand-input);
  color: var(--on-brand);
  font: inherit;
  font-size: .9375rem;
}

.site-footer__newsletter input::placeholder {
  color: var(--brand-label);
  opacity: 1;
}

.site-footer__subscribe {
  flex-shrink: 0;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background-color: var(--brand-button);
  color: var(--brand-deep);
  font: inherit;
  font-size: .9375rem;
  font-weight: 500;
  cursor: pointer;
}

.site-footer__subscribe:hover {
  background-color: var(--brand-button-hover);
}

.site-footer__subscribe:disabled {
  cursor: wait;
}

.site-footer__newsletter .recaptcha-note {
  color: var(--on-brand-soft);
}

/* After Subscribe: a framed line with a check in place of the address row (newsletter.js), or a red line on an error */
.site-footer__alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .08);
  color: var(--on-brand);
  font-weight: 600;
  line-height: 1.45;
}

.site-footer__alert[hidden] {
  display: none;
}

.site-footer__alert .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: #8fd19e;
}

.site-footer__alert.is-error {
  border-color: rgba(244, 180, 173, .45);
  color: #f4b4ad;
}

.site-footer__alert.is-error .icon {
  display: none;
}

.site-footer__newsletter.is-subscribed .site-footer__newsletter-row,
.site-footer__newsletter.is-subscribed .recaptcha-note {
  display: none;
}

.site-footer__social {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.site-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  color: var(--on-brand-soft);
}

.site-footer__social a:hover {
  background-color: rgba(255, 255, 255, .08);
  color: var(--on-brand);
}

.site-footer__social .icon {
  width: 20px;
  height: 20px;
}

/* Google's "preferred source" link under the social icons; follows the column's alignment. */
.site-footer__preferred {
  margin: 12px 0 0;
}

.site-footer__preferred a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--on-brand-soft);
  font-size: .875rem;
  text-decoration: none;
}

.site-footer__preferred a:hover {
  color: var(--on-brand);
  text-decoration: underline;
}

.site-footer__preferred .icon {
  width: 16px;
  height: 16px;
}

.site-footer__links {
  display: grid;
  grid-template-areas:
    "catalog new"
    "explore contribute"
    "about .";
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 16px;
  padding-top: 24px;
  border-top: 1px solid var(--brand-line);
}

.site-footer__group--catalog {
  grid-area: catalog;
}

.site-footer__group--new {
  grid-area: new;
}

.site-footer__group--explore {
  grid-area: explore;
}

.site-footer__group--contribute {
  grid-area: contribute;
}

.site-footer__group--about {
  grid-area: about;
}

.site-footer__heading {
  margin: 0 0 10px;
  color: var(--brand-label);
  font-size: .6875rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

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

.site-footer__link {
  display: inline-block;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--on-brand-soft);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.site-footer__link:hover {
  color: var(--on-brand);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer__bottom {
  border-top: 1px solid var(--brand-line);
}

.site-footer__bottom-inner {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
  padding: 16px 0 24px;
  color: var(--brand-label);
  font-size: .8125rem;
  text-align: center;
}

.site-footer__copyright {
  margin: 0;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .site-footer__brand {
    text-align: left;
  }

  .site-footer__newsletter {
    max-width: 380px;
  }

  .site-footer__newsletter-title {
    text-align: left;
  }

  .site-footer__social {
    justify-content: flex-start;
    margin-left: -12px;
  }

  .site-footer__links {
    grid-template-areas:
      "catalog new explore about"
      "catalog new contribute about";
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-top: 0;
    border-top: 0;
  }

  .site-footer__link {
    padding: 5px 0;
  }

  .site-footer__bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    padding: 18px 0 22px;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .site-footer__inner {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 48px;
  }
}

/* The cookie choice: a raised card in the page's own colour (white in light, dark grey in dark) with a firm shadow, so
   it stands out on the page and on the slate footer alike. Decline and Accept are two equal blue pills: refusing looks
   as easy as accepting, as the consent rules ask. Side by side across the width on mobile. */
.cookie-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 18px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-size: .9375rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .12);
}

.cookie-banner[hidden] {
  display: none;
}

/* Where Google's US opt-out bar shows at the bottom of the page (cookie-banner.js), the banner sits above it. */
.cookie-banner.cookie-banner--above-optout {
  bottom: 72px;
}

.cookie-banner-text {
  flex: 1 1 280px;
  margin: 0;
  line-height: 1.5;
}

.cookie-banner-text a {
  color: var(--link);
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
}

.cookie-banner-actions .pill-link {
  min-height: 40px;
  padding: 0 22px;
  border-color: var(--accent);
  background-color: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cookie-banner-actions .pill-link:hover {
  border-color: var(--accent-hover);
  background-color: var(--accent-hover);
  color: #fff;
}

.cookie-banner-actions .pill-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .cookie-banner {
    right: 8px;
    bottom: 8px;
    left: 8px;
  }

  .cookie-banner-actions {
    width: 100%;
  }

  .cookie-banner-actions > * {
    flex: 1 1 0;
  }
}
