.footer {
  display: flex;
  flex-direction: column;
  gap: 100px;
  padding: 50px var(--grid-margin) 20px;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  grid-template-areas:
    "n n"
    "a a"
    "b b";
  gap: 30px var(--grid-gap);
}
.footer-nav:not(:has(.newsletter)) {
  grid-template-areas:
    "a a"
    "b b";
}
.footer-nav > * {
  border-top: var(--border);
}
.footer-nav .newsletter {
  grid-area: n;
}
.footer-links:nth-of-type(1) {
  grid-area: a;
}
.footer-links:nth-of-type(2) {
  grid-area: b;
}
@media (min-width: 48em) {
  .footer-nav {
    grid-template-areas:
      ". . n n n n . ."
      ". a a a b b b .";
  }
  .footer-nav:not(:has(.newsletter)) {
    grid-template-areas:
      ". a a a b b b .";
  }
}
@media (min-width: 80em) {
  .footer-nav {
    grid-template-areas:
      ". . a a n n n n b b . .";
  }
  .footer-nav:not(:has(.newsletter)) {
    grid-template-areas:
      ". . . . a a b b . . . .";
  }
}
@media (min-width: 160em) {
  .footer-nav {
    grid-template-areas:
      ". . . . . . a a a n n n n n n b b b . . . . . .";
  }
  .footer-nav:not(:has(.newsletter)) {
    grid-template-areas:
      ". . . . . . . . . a a a b b b . . . . . . . . .";
  }
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-block-start: 5px;
}

.footer-end {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
  text-transform: uppercase;
}

.newsletter form {
  display: grid;
  grid-template-columns: 1fr max-content;
}
.newsletter .border {
  color: var(--grey-02);
}
.newsletter form, .newsletter .border + * {
  padding: 5px 3px 3px;
}
.newsletter form > :first-child {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}
.newsletter button {
  text-transform: uppercase;
}
