/* Shared footer routes and a keyboard-accessible return to the page top. */
.site-footer .footer-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  gap: 8px 24px;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(244, 234, 215, 0.2);
}

.site-footer .footer-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: fit-content;
  color: #f4ead7;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  text-underline-offset: 5px;
}

.site-footer .footer-nav a:hover,
.site-footer .footer-nav a[aria-current="page"] {
  text-decoration: underline;
}

.site-footer .footer-nav a:focus-visible,
.back-to-top:focus-visible {
  outline: 3px solid #e7a443;
  outline-offset: 5px;
}

.back-to-top {
  position: fixed;
  z-index: 90;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid #b5603d;
  border-radius: 3px;
  color: #0b2133;
  background: #f4ead7;
  box-shadow: 0 3px 16px rgba(11, 33, 51, 0.18);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.back-to-top[hidden] {
  display: none;
}

.back-to-top:hover {
  background: #fff9ed;
}

.back-to-top svg {
  flex: 0 0 auto;
}

@media (max-width: 1100px) {
  .site-footer .footer-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .site-footer .footer-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
  }
}

@media (max-width: 480px) {
  .site-footer .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .back-to-top {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    padding-inline: 12px;
    width: 48px;
    height: 48px;
    gap: 0;
  }

  .back-to-top span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media print {
  .back-to-top {
    display: none !important;
  }
}
