/**
 * 窄屏页脚（不修改 styles.css）：
 * 1) styles.css @900px 的 .site-footer__top { gap:24px } 会在 769–900 把 logo 与菜单拉开，此处用 gap:0 + margin 接管纵向间距
 * 2) styles.css @768 的 #footer…nav { margin-top:0.2rem !important } 用更高优先级 + 略紧的间距覆盖
 * 3) logo 链接内图片去行高缝隙，避免「看起来」间距偏大
 */

@media (max-width: 900px) {
  .site-footer > .site-footer__top.container {
    gap: 0 !important;
  }

  .site-footer > .site-footer__top.container > .site-footer__nav,
  #footer-top-h5-placeholder.site-footer__top > .site-footer__nav {
    margin: 0.34rem 0 0 !important;
  }

  .site-footer > .site-footer__top.container > .site-footer__contact-block {
    margin-top: 0.2rem !important;
  }

  /*
   * styles.css 中 #footer… .site-footer__menu li 使用 line-height:1 !important，且 a 为 inline-block，
   * 会在 li 内留下基线空隙，导致 li 视觉高度大于文案。改为 flex 包裹 + a 块级消除空隙。
   */
  .site-footer > .site-footer__top.container .site-footer__menu > li,
  #footer-top-h5-placeholder.site-footer__top .site-footer__menu > li {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 auto !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    height: fit-content !important;
    min-height: 0 !important;
    max-height: none !important;
    line-height: normal !important;
  }

  .site-footer > .site-footer__top.container .site-footer__menu > li > a,
  #footer-top-h5-placeholder.site-footer__top .site-footer__menu > li > a {
    display: block !important;
    line-height: 1.25 !important;
  }
}

@media (max-width: 768px) {
  body #contact.site-footer > #footer-top-h5-placeholder.site-footer__top.container > nav.site-footer__nav {
    margin: 0.34rem 0 0 !important;
  }

  .site-footer > .site-footer__top.container > .site-footer__brand {
    line-height: 0;
  }

  .site-footer > .site-footer__top.container > .site-footer__brand .site-footer__logo--mobile {
    display: block;
  }
}
