/*
 * leechaemin header.css ベース
 * 変更点：
 * - JOIN / LOGIN（MY PAGE）をナビ右側に追加
 * - モバイルのハンバーガーを常時表示（元はスクロール 600px 以降のみ表示で、ページ上部ではメニューが開けなかった）
 */
.header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, 0);
  background-color: rgba(255, 255, 255, 0.3);
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;

  @media (max-width: 767px) {
    justify-content: right;
    display: inline-flex;
    width: 64px;
    transform: unset;
    left: unset;
    right: 0;
    background-color: transparent;
  }

  .gnav {
    font-family: var(--font-header);
    padding: 32px 24px;
    font-size: 24px;
    letter-spacing: 0.01em;

    @media (max-width: 1023px) {
      font-size: 20px;
    }

    @media (max-width: 767px) {
      pointer-events: none;
      visibility: hidden;
      opacity: 0;
      transition: opacity 0.4s ease, visibility 0s linear 0.4s;
    }

    ul {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 30px;

      @media (max-width: 1023px) {
        gap: 20px;
      }

      @media (max-width: 767px) {
        flex-direction: column;
        /* absolute だと閉じている間も幅 64px のヘッダー基準で画面外にはみ出し横スクロールが出るため、画面基準にする */
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        gap: 30px;
      }

      li {
        opacity: 1;

        @media (max-width: 767px) {
          opacity: 0;
          transform: translateY(20px);
        }
      }

      .gnav__account--first {
        padding-left: 30px;
        border-left: 1px solid rgba(0, 0, 0, 0.4);

        @media (max-width: 1023px) {
          padding-left: 20px;
        }

        @media (max-width: 767px) {
          padding-left: 0;
          padding-top: 30px;
          border-left: 0;
          border-top: 1px solid rgba(0, 0, 0, 0.4);
        }
      }
    }
  }
}

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  z-index: 999;
  padding: 26px 12px;
  background: none;
  border: 0;
  cursor: pointer;

  @media (max-width: 767px) {
    display: flex;
    position: absolute;
    top: 0;
    right: 0;
  }

  span {
    display: block;
    width: 40px;
    height: 1px;
    background-color: #000;
    transition: all 0.3s ease;
  }
}

.header.active {
  width: 100%;
  display: flex;
  background-color: #fff;
  color: #000;
  flex-direction: column-reverse;

  .gnav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    width: 100%;
    height: 100svh;

    background-color: rgba(255, 255, 255, 1);
    transition: opacity 0.4s ease;

    ul {
      li {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.6s ease, transform 0.4s ease;
      }

      li:nth-child(1) {
        transition-delay: 0.3s;
      }
      li:nth-child(2) {
        transition-delay: 0.4s;
      }
      li:nth-child(3) {
        transition-delay: 0.5s;
      }
      li:nth-child(4) {
        transition-delay: 0.6s;
      }
      li:nth-child(5) {
        transition-delay: 0.7s;
      }
      li:nth-child(6) {
        transition-delay: 0.8s;
      }
      li:nth-child(7) {
        transition-delay: 0.9s;
      }
    }
  }

  .hamburger-menu span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .hamburger-menu span:nth-child(2) {
    opacity: 0;
  }

  .hamburger-menu span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}

.header.closing .gnav {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.header.closing .gnav ul li {
  opacity: 0;
  transform: translateY(20px);
  transition-delay: 0s;
}

/* 管理バー表示時（管理者ログイン中）は固定ヘッダーを管理バーの下へ */
.admin-bar .header {
  top: 32px;

  @media (max-width: 782px) {
    top: 46px;
  }
}
