.footer {
  background: #fbfbf8;
  padding: 68px 0 34px;
}

.footer__container {
  width: min(var(--container-max), calc(100% - var(--container-inline)));
  margin: 0 auto;
}

.footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto) minmax(0, 1fr);
  grid-template-areas: "brand links legal";
  align-items: start;
  gap: 36px clamp(28px, 4vw, 72px);
}

.footer__brand {
  grid-area: brand;
  display: grid;
  align-content: start;
  justify-items: start;
  justify-self: start;
  max-width: 260px;
  gap: 18px;
}

.footer__brand-header {
  display: inline-flex;
  align-items: center;
}

.footer__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer__logo img {
  width: 96px;
  height: auto;
  display: block;
}

.footer__socials {
  display: flex;
  align-items: center;
  gap: 0;
}

.footer__social-link {
  position: relative;
  color: rgba(0, 57, 77, 0.88);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition:
    color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.footer__social-link + .footer__social-link {
  margin-left: 18px;
  padding-left: 18px;
}

.footer__social-link + .footer__social-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 26px;
  background: rgba(0, 57, 77, 0.14);
}

.footer__social-link svg {
  display: block;
  width: 34px;
  height: 34px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer__social-link--facebook svg {
  transform: scale(1.05);
}

.footer__links,
.footer__legal {
  display: grid;
  align-content: start;
  gap: 14px;
}

.footer__links {
  grid-area: links;
  justify-self: center;
  justify-items: center;
  text-align: center;
}

.footer__legal {
  grid-area: legal;
  justify-self: end;
  width: min(100%, 340px);
}

.footer__heading {
  font-family: var(--font-heading);
  font-size: 0.94rem;
  line-height: 1.18;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}

.footer__nav {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.footer__nav-link {
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.34;
  font-weight: 500;
  color: rgba(0, 57, 77, 0.62);
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.footer__info-link {
  text-decoration: none;
  width: fit-content;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.58;
  font-weight: 500;
  color: rgba(0, 57, 77, 0.68);
  transition: color 180ms ease;
}

.footer__info-copy {
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.58;
  font-weight: 500;
  color: rgba(0, 57, 77, 0.68);
}

.footer__info-group {
  display: grid;
  gap: 10px;
}

.footer__brand-link {
  justify-self: start;
}

.footer__inline-link {
  text-decoration: none;
  font: inherit;
  color: inherit;
  transition: color 180ms ease;
}

.footer__meta-note {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.58;
  font-weight: 500;
  color: rgba(0, 57, 77, 0.58);
}

.footer__bottom {
  margin-top: 58px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 57, 77, 0.16);
}

.footer__copyright {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.36;
  font-weight: 500;
  text-align: center;
  color: rgba(0, 57, 77, 0.72);
}

@media (hover: hover) and (pointer: fine) {
  .footer__nav-link:hover {
    color: var(--primary-dark);
    transform: translateY(-1px);
  }

  .footer__info-link:hover {
    color: var(--primary-light);
  }

  .footer__inline-link:hover {
    color: var(--primary-light);
  }

  .footer__social-link:hover {
    transform: translateY(-1px);
    color: var(--primary-light);
    opacity: 0.9;
  }
}

@media (max-width: 1199px) {
  .footer {
    padding: 54px 0 30px;
  }

  .footer__top {
    grid-template-columns: minmax(0, 1fr) minmax(140px, auto) minmax(0, 1fr);
    grid-template-areas: "brand links legal";
    gap: 32px;
  }

  .footer__logo img {
    width: 82px;
  }

  .footer__brand-header {
    gap: 0;
  }

  .footer__nav-link,
  .footer__info-link,
  .footer__info-copy,
  .footer__meta-note,
  .footer__copyright {
    font-size: 0.82rem;
  }

  .footer__heading {
    font-size: 0.88rem;
  }

  .footer__social-link svg {
    width: 32px;
    height: 32px;
  }

  .footer__social-link {
    width: 38px;
    height: 38px;
  }

  .footer__social-link + .footer__social-link::before {
    height: 24px;
  }
}

@media (max-width: 979px) {
  .footer__top {
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto) minmax(0, 1fr);
    grid-template-areas: "brand links legal";
    gap: 24px;
  }

  .footer__legal {
    width: min(100%, 300px);
  }

  .footer__brand {
    max-width: 220px;
  }
}

@media (max-width: 767px) {
  .footer {
    padding: 36px 0 24px;
  }

  .footer__top {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "links"
      "legal";
    gap: 28px;
  }

  .footer__brand {
    justify-self: center;
    justify-items: center;
    width: min(100%, 340px);
    max-width: none;
    gap: 20px;
  }

  .footer__links,
  .footer__legal {
    justify-self: center;
    width: min(100%, 340px);
  }

  .footer__brand-header {
    justify-content: center;
    text-align: center;
    gap: 0;
  }

  .footer__logo img {
    width: 78px;
  }

  .footer__socials {
    justify-content: center;
  }

  .footer__social-link svg {
    width: 36px;
    height: 36px;
  }

  .footer__social-link {
    width: 38px;
    height: 38px;
  }

  .footer__social-link + .footer__social-link::before {
    height: 26px;
  }

  .footer__links,
  .footer__legal {
    justify-items: center;
    text-align: center;
    gap: 14px;
  }

  .footer__nav {
    justify-items: center;
  }

  .footer__info-group {
    justify-items: center;
  }

  .footer__info-link,
  .footer__brand-link {
    justify-self: center;
  }

  .footer__info-copy,
  .footer__meta-note,
  .footer__copyright {
    text-wrap: balance;
  }

  .footer__heading {
    font-size: 0.86rem;
  }

  .footer__bottom {
    margin-top: 34px;
    padding-top: 18px;
  }

  .footer__copyright {
    font-size: 0.8rem;
  }
}
