:root {
  --footer-bg: var(--bg, var(--btl-bg, #f7f4ef));
  --footer-text: var(--muted, var(--btl-stone, #8f8880));
  --footer-primary: var(--text, var(--btl-text-primary, #1f1f1f));
  --footer-accent: var(--accent, var(--btl-text-secondary, #4d4a46));
  --footer-border: var(--border, var(--btl-dust, #d8d0c6));
  --footer-max: var(--max, var(--site-max, 1240px));
}

.site-footer {
  margin-top: 104px;
  padding: 0;
  border-top: 1px solid var(--footer-border);
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 0.88rem;
}

.footer-upper,
.footer-bottom {
  display: grid;
  align-items: center;
  width: min(var(--footer-max), calc(100% - 36px));
  margin: 0 auto;
}

.footer-upper {
  grid-template-columns: minmax(220px, 1fr) auto minmax(260px, 1fr);
  grid-template-areas: "social brand newsletter";
  column-gap: 36px;
  padding: 24px 0 22px;
}

.footer-bottom {
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  column-gap: 28px;
  padding: 16px 0 20px;
  border-top: 1px solid var(--footer-border);
  font-size: 0.82rem;
}

.footer-brand {
  grid-area: brand;
  justify-self: center;
}

.footer-logo {
  display: block;
  width: min(260px, 42vw);
  opacity: 0.68;
}

.footer-social {
  display: flex;
  grid-area: social;
  align-items: center;
  gap: 14px;
  justify-self: start;
  margin: 0;
  font-size: 0.82rem;
}

.social-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--footer-border);
  border-radius: 50%;
  color: var(--footer-text);
  transition: color 220ms var(--ease), border-color 220ms var(--ease);
}

.social-icon span {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
}

.social-instagram span {
  border: 1.4px solid currentColor;
  border-radius: 5px;
}

.social-instagram span::after {
  width: 4px;
  height: 4px;
  border: 1.2px solid currentColor;
  border-radius: 50%;
  content: "";
}

.social-youtube span::before {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  content: "";
}

.social-tiktok span {
  font-size: 0;
}

.social-tiktok span::before {
  content: "T";
  font-size: 0.86rem;
}

.footer-social a:hover,
.footer-social a:focus-visible {
  color: var(--footer-accent);
  border-color: var(--footer-accent);
  text-decoration: none;
}

.newsletter-box {
  display: grid;
  grid-area: newsletter;
  justify-self: end;
  width: min(360px, 100%);
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
}

.newsletter-fields {
  display: flex;
  min-height: 38px;
  border: 1px solid var(--footer-border);
}

.newsletter-fields input {
  min-width: 0;
  flex: 1;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--footer-primary);
  outline: none;
}

.newsletter-fields input::placeholder {
  color: var(--footer-text);
  opacity: 0.72;
}

.newsletter-fields button {
  padding: 8px 12px;
  border: 0;
  border-left: 1px solid var(--footer-border);
  background: transparent;
  color: var(--footer-text);
  cursor: pointer;
}

.newsletter-box p,
.newsletter-status {
  margin: 0;
  font-size: 0.72rem;
  opacity: 0.78;
}

.footer-links {
  display: flex;
  gap: 18px;
  justify-content: center;
  align-items: center;
  font-size: 0.82rem;
}

.footer-links a,
.footer-bottom a {
  color: var(--footer-text);
  transition: color 220ms var(--ease), border-color 220ms var(--ease);
}

.footer-links a:hover,
.footer-links a:focus-visible,
.footer-bottom a:hover,
.footer-bottom a:focus-visible {
  color: var(--footer-accent);
  border-bottom: 1px solid currentColor;
  text-decoration: none;
}

.footer-bottom > span:first-child {
  justify-self: start;
}

.footer-bottom > span:last-child {
  justify-self: end;
}

@media (max-width: 900px) {
  .footer-upper,
  .footer-bottom {
    grid-template-columns: 1fr;
    grid-template-areas: none;
    row-gap: 14px;
    text-align: center;
  }

  .footer-brand,
  .footer-social,
  .newsletter-box,
  .footer-links,
  .footer-bottom > span:first-child,
  .footer-bottom > span:last-child {
    grid-area: auto;
    justify-self: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-logo {
    width: min(250px, 70vw);
  }
}

@media (max-width: 560px) {
  .footer-upper,
  .footer-bottom {
    width: min(360px, calc(100% - 28px));
  }

  .site-footer {
    margin-top: 92px;
  }
}
