/* 菜单（照 Arent & Pyke）：焦糖黄面板从右边滑进来（0.4 秒），宽 = 屏宽一半 + 240px（1440 宽时 960px）。
   菜单项 32px 靠右，右边和页眉的菜单按钮对齐（屏幕再宽也一样），依次浮上来（每项晚 0.1 秒），当前页下面一道细线。
   左下角是地址和社交账号，左边和页眉 Logo 的左边对齐。面板能滚动，但不显示滚动条。
   窄屏（900px 以下）面板盖住整屏，菜单项居中，地址收起。
   点面板外面、按 Esc 或再点一次按钮都会关上。 */

.menu {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 8;
  width: calc(50% + 24rem);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  /* 右边留白和页眉一样：屏幕宽过 --header-width 时，按钮往里收，菜单项跟着收（% 按屏宽算，不含滚动条） */
  padding: var(--header-height) max(var(--margin), 50% - var(--header-width) / 2) 0 var(--margin);
  overflow-y: auto;
  scrollbar-width: none;
  background: var(--ochre);
  color: var(--ink);
  transform: translateX(100%);
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}

.menu::-webkit-scrollbar {
  display: none;
}

.menu.is-animating {
  transition: transform 0.4s;
}

.menu.is-open {
  transform: translateX(0);
}

.menu__body {
  display: flex;
  flex-direction: column;
  min-height: calc(100% + 2px); /* 比面板高 2px：在面板里滚动不会带着后面的页面一起滚 */
}

.menu__list {
  margin-top: 3.2rem;
  font-size: var(--fs-32);
  font-weight: var(--weight-light);
  line-height: 3.6rem;
  text-align: right;
}

.menu__list > li {
  padding-top: 1rem;
  opacity: 0;
  transform: translateY(2rem);
  transition: transform 0.4s, opacity 0.4s;
}

.menu__list > li:nth-child(1) { transition-delay: 0.1s; }
.menu__list > li:nth-child(2) { transition-delay: 0.2s; }
.menu__list > li:nth-child(3) { transition-delay: 0.3s; }
.menu__list > li:nth-child(4) { transition-delay: 0.4s; }
.menu__list > li:nth-child(5) { transition-delay: 0.5s; }

.menu.is-open .menu__list > li {
  opacity: 1;
  transform: translateY(0);
}

.menu__list a {
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
  transition: opacity 0.5s;
}

.menu__list a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  border-bottom: 0.8px solid currentColor;
  transform: scaleX(0);
  transition: transform 0.5s;
}

.menu__list a.is-active::after {
  transform: scaleX(1);
}

.menu__list a:hover {
  opacity: 0.6;
}

/* 左下角：地址、客服微信、社交账号（15px）。
   Logo 在屏幕正中，面板左边在正中往左 240px，所以 Logo 左边离面板左边 = 240px - Logo 宽的一半 */
.menu__contact {
  position: absolute;
  bottom: var(--margin);
  left: calc(24rem - var(--logo-width) / 2);
  font-size: var(--fs-15);
  line-height: 2.25rem;
}

.menu__location dt {
  display: block;
  margin-bottom: 1rem;
}

.menu__address {
  display: block;
  line-height: 1.8rem;
}

.menu__follows {
  margin-top: 3rem;
}

.menu__contact a {
  transition: opacity 0.5s;
}

.menu__contact a:hover {
  opacity: 0.6;
}

/* 点面板外面关闭菜单 */
.menu-shroud {
  position: fixed;
  inset: 0;
  z-index: 7;
  cursor: e-resize;
}

@media (max-width: 56.1875em) {
  .menu {
    width: 100%;
  }

  .menu__body {
    align-items: center;
    justify-content: center;
    padding-bottom: 10rem;
  }

  .menu__list {
    text-align: center;
  }

  .menu__list > li {
    padding-top: 1rem;
  }

  .menu__locations {
    display: none;
  }

  .menu__contact {
    right: var(--margin);
    left: var(--margin);
    bottom: 6rem;
    text-align: center;
  }
}
