.footer {
  display: flex;
  flex-direction: column;
}

/* =====================
   Upper zone
   ===================== */
.footer__upper {
  background-color: var(--surface-hero);
  padding: 40px 64px 24px;
}

.footer__upper--home {
  background-color: var(--surface-nav);
}

.footer__upper-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3xl);
}

/* Main row */
.footer__main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 240px;
}

/* ---- Brand (left) ---- */
.footer__brand {
  width: 382px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-3xl);
}

.footer__logo-link {
  display: inline-flex;
  text-decoration: none;
}

.footer__logo-link:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.footer__logo {
  display: block;
  height: 48px;
  width: auto;
}

.footer__logo-fallback {
  color: var(--text-on-dark);
}

/* Social buttons */
.footer__social {
  display: block;
}

.footer__social-list {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: var(--spacing-md);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--spacing-md);
  opacity: 0.8;
  text-decoration: none;
  transition: opacity 150ms ease;
}

.footer__social-btn:hover {
  opacity: 1;
}

.footer__social-btn:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 4px;
  opacity: 1;
}

.footer__social-icon {
  color: var(--icon-on-dark);
  flex-shrink: 0;
}

/* ---- Contact (right) ---- */
.footer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.footer__contact-item {
  width: 371px;
  display: flex;
  align-items: center;
}

.footer__contact-accent {
  display: flex;
  align-items: center;
  padding: var(--spacing-2xl) var(--spacing-2xl) var(--spacing-2xl)
    var(--spacing-3xl);
  border-left: 2px solid var(--border-accent);
  flex-shrink: 0;
}

.footer__contact-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.footer__contact-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0; /* allow long email/address to wrap instead of overflow */
}

.footer__contact-label {
  color: var(--text-on-dark);
  opacity: 0.8;
}

.footer__contact-value {
  color: var(--text-on-dark);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a.footer__contact-value:hover {
  color: var(--text-accent);
}

.footer__contact-value:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 4px;
  border-radius: 4px;
}

/* ---- Legal disclaimer ---- */
.footer__disclaimer {
  color: var(--text-on-hero);
  width: 100%;
  white-space: pre-line;
  word-wrap: break-word;
}

/* =====================
   Bottom bar
   ===================== */
.footer__bottom {
  background-color: var(--surface-nav);
  border-top: 1px solid var(--border-subtle-alpha);
  padding: var(--spacing-xl) 64px;
}

.footer__bottom-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-3xl);
}

.footer__copyright {
  color: var(--text-on-dark);
  line-height: 1.5;
  flex-shrink: 0; /* don't let the legal nav squeeze it into a narrow column */
}

.footer__legal-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-2xl) var(--spacing-3xl);
}

.footer__legal-link {
  color: var(--interactive-download-text);
  text-decoration: none;
  transition: opacity 150ms ease;
}

.footer__legal-link:hover {
  opacity: 0.75;
}

.footer__legal-link:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
  .footer__upper {
    padding: var(--spacing-3xl) var(--spacing-3xl) var(--spacing-3xl);
  }

  .footer__main-row {
    flex-direction: column;
    gap: var(--spacing-3xl);
    min-height: auto;
  }

  .footer__brand {
    width: 100%;
  }

  .footer__contact-item {
    width: 100%;
  }

  .footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xl);
  }

  .footer__legal-nav {
    flex-wrap: wrap;
    gap: var(--spacing-3xl);
  }

  .footer__bottom {
    padding: var(--spacing-xl) var(--spacing-3xl);
  }
}

@media (max-width: 768px) {
  .footer__upper {
    padding: var(--spacing-3xl) var(--spacing-xl) var(--spacing-xl);
  }

  .footer__bottom {
    padding: var(--spacing-xl);
  }

  .footer__bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xl);
  }

  .footer__legal-nav {
    flex-wrap: wrap;
    gap: var(--spacing-xl);
  }

  .footer__contact-accent {
    padding: var(--spacing-md) var(--spacing-xl) var(--spacing-md)
      var(--spacing-xl);
  }
}
