.hj-footer-layout {
  position: relative;
  display: grid !important;
  width: 100%;
  min-width: 0;
  min-height: min(calc(17.562vw - 21.07px), 203.7px);
  grid-template-columns:
    minmax(0, var(--hj-footer-left-space, 1fr))
    minmax(0, var(--hj-footer-nav, 2fr))
    minmax(0, var(--hj-footer-logo, 3fr))
    minmax(0, var(--hj-footer-right-space, 1fr))
    minmax(0, var(--hj-footer-contact, 2fr));
  column-gap: 0;
  align-items: start;
  box-sizing: border-box;
}
.hj-footer-layout > .wp-block-group {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  overflow-wrap: anywhere;
}
.hj-footer-layout > .hj-footer-spacer,
.hj-footer-layout > .hj-footer-spacer-left { grid-column: 1; grid-row: 1; min-height: 1px; }
.hj-footer-layout > .hj-footer-nav { grid-column: 2; grid-row: 1; text-align: left; }
.hj-footer-layout > .hj-footer-logo { grid-column: 3; grid-row: 1; }
.hj-footer-layout > .hj-footer-spacer-right { grid-column: 4; grid-row: 1; min-height: 1px; }
.hj-footer-layout > .hj-footer-contact { grid-column: 5; grid-row: 1; text-align: left; }
.hj-footer-layout .hj-footer-logo figure {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.hj-footer-layout .hj-footer-logo img {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain;
  object-position: center;
}
.hj-footer-layout .hj-footer-nav > *,
.hj-footer-layout .hj-footer-contact > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.hj-footer-layout .hj-footer-nav p,
.hj-footer-layout .hj-footer-contact p { white-space: normal; }
.hj-footer-layout .hj-footer-contact .hj-social-links { display: flex; width: auto; flex-direction: row; }
@media (min-width: 801px) {
  .hj-footer-layout > .hj-footer-logo {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 50%;
    grid-column: 1 / -1;
    grid-row: 1;
    width: 33.3333% !important;
    transform: translateX(-50%);
  }
}
@media (max-width: 800px) {
  .hj-footer-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 24px;
    min-height: 0;
  }
  .hj-footer-layout > .hj-footer-spacer,
  .hj-footer-layout > .hj-footer-spacer-left,
  .hj-footer-layout > .hj-footer-spacer-right { display: none !important; }
  .hj-footer-layout > .hj-footer-logo {
    position: relative;
    top: auto;
    left: auto;
    grid-column: 1;
    grid-row: 1;
    width: 100% !important;
    transform: none;
  }
  .hj-footer-layout > .hj-footer-nav { grid-column: 1; grid-row: 2; }
  .hj-footer-layout > .hj-footer-contact { grid-column: 1; grid-row: 3; }
  .hj-footer-layout .hj-footer-logo figure { justify-content: center; }
  .hj-footer-layout .hj-footer-logo img { width: auto !important; max-width: min(100%, 320px) !important; }
}

/* BATC affiliation below the existing social links; leave other footer elements unchanged. */
.hj-footer-contact .hj-footer-affiliations { display:flex; align-items:center; gap:16px; width:100%; margin-top:15px; }
.hj-footer-contact .hj-footer-batc-link { display:inline-flex; width:auto!important; max-width:165px; align-items:center; }
.hj-footer-contact .hj-footer-batc-link img { display:block; width:165px; max-width:100%; height:auto; object-fit:contain; }
.hj-footer-contact .hj-footer-batc-link:focus-visible { outline:2px solid #546a4b; outline-offset:4px; }
