/* Footer Styles */
.site-footer {
  background-color: var(--er-limestone);
  color: var(--er-ink-2);
  padding: 4rem 0 2rem;
  position: relative;
  border-top: 1px solid var(--er-rule);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--er-paper);
  color: var(--er-ink-2);
  border: 1px solid var(--er-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--er-fs-floor);
  cursor: pointer;
  box-shadow: var(--er-shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--er-ivory);
  color: var(--er-clay-deep);
  border-color: var(--er-clay-deep);
}

/* Brand Section */
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-width: 200px;
}

.footer-logo {
  display: block;
  margin-bottom: 0.85rem;
}

.footer-logo-image {
  width: clamp(180px, 14vw, 200px);
  height: auto;
  max-width: 100%;
  transition: opacity 0.3s ease;
}

.footer-logo:hover .footer-logo-image {
  opacity: 0.78;
}

/* Navigation Columns */
.footer-nav-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer-nav-title {
  color: var(--er-ink);
  font-family: var(--er-sans);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 1.2rem;
  position: relative;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--er-rule);
}

.footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav-list li {
  margin-bottom: 0.6rem;
}

.footer-nav-list a {
  color: var(--er-ink-2);
  font-family: var(--er-sans);
  text-decoration: none;
  font-size: var(--er-fs-ui, 14px);
  line-height: 1.45;
  transition: color 0.2s ease;
  display: inline-block;
  padding: 0.15rem 0;
}

.footer-nav-list a:hover {
  color: var(--er-clay-deep);
}

.footer-nav-list a:focus-visible {
  outline: 2px solid var(--er-clay-deep);
  outline-offset: 3px;
}

/* Bottom Bar */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--er-rule);
  font-size: var(--er-fs-ui-sm, 13px);
  line-height: 1.5;
}

.essential-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.essential-links a {
  color: var(--er-ink-3);
  font-family: var(--er-sans);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 0.2rem 0;
}

.essential-links a:hover {
  color: var(--er-clay-deep);
}

.essential-links a:focus-visible {
  outline: 2px solid var(--er-clay-deep);
  outline-offset: 3px;
}

.copyright {
  color: var(--er-ink-3);
  font-family: var(--er-mono);
  font-size: var(--er-fs-caption, 12px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 1100px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-brand {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
    min-width: 0;
  }

  .footer-logo {
    margin-bottom: 0;
  }

  .footer-logo-image {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .footer-brand {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.75rem;
  }

  .footer-nav-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .essential-links {
    justify-content: flex-start;
  }
}

@media (max-width: 576px) {
  .site-footer {
    padding: 2.5rem 0 1.5rem;
  }

  .footer-container {
    padding: 0 1rem;
  }

  .footer-nav-columns {
    grid-template-columns: 1fr;
  }

  .footer-logo-image {
    width: 164px;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    font-size: var(--er-fs-floor);
  }
}
