/* === Header Styles === */
#header {
  position: fixed; /* stickyからfixedに変更 */
  top: 0;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #ddd;
  z-index: 1000;
  width: 100%;
}

/* === Logo Area === */
#headerLogo {
  margin-left: 40px;
  height: 80px;
  display: flex;
  align-items: center;
}

#headerLogo a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  transition: all 0.25s ease;
}

#headerLogo img {
  display: block;
  max-height: 60px; /* 80px - 20px margin */
  width: auto;
  transition: all 0.25s ease;
}

/* === Global Menu Container === */
#headerGlobalMenuContainer {
  height: 80px;
  display: flex;
  align-items: center;
    position: absolute;
    top: 0;
    right: 80px;
  z-index: 2;
}

/* === Global Menu === */
#headerGlobalMenu {
  display: flex;
  font-size: 0; /* Removes spacing between inline-blocks */
}

#headerGlobalMenu li {
  display: inline-block;
  font-size: 16px;
}

#headerGlobalMenu li a {
  display: block;
  height: 80px;
  line-height: 80px;
  padding: 0 20px;
  color: #000;
  text-decoration: none;
  transition: all 0.25s ease;
}
/* === Hamburger Menu Button === */

#drawer_menu_button {
  width: 60px;
  height: 60px;
  display: none;
  position: absolute;
  right: 0;
  top: 0;
  background-color: transparent;  /* ハンバーガーメニューのボタン背景を透明に */
  z-index: 1001;  /* メニューより前に表示 */
}

#drawer_menu_button {
  position: absolute;
  left: 0;
  top: 0;
  width: 60px;
  height: 60px;
  background-color: transparent;  /* 背景を透明に */
  z-index: 1001;  /* メニューより前に表示 */
}

.bar {
  display: block;
  height: 40px;
  width: 40px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

#drawer_menu_button .bar_1 {
  width: 22px;
  height: 2px;
  background: #323232;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.3s ease;
}

#drawer_menu_button span:nth-child(1) {
  top: 20px;
}

#drawer_menu_button span:nth-child(2) {
  top: 26px;
}

#drawer_menu_button span:nth-child(3) {
  top: 32px;
}

/* モバイルメニュー */
/* モバイルメニュー */
#mobile_menu {
  display: none;              /* 初期状態では非表示 */
  opacity: 0;                 /* 完全に透明 */
  pointer-events: none;       /* クリック不可 */
  position: fixed;            /* absolute → fixed に変更 */
  top: 0;                     /* ヘッダー下 → 全画面表示なので0に */
  left: 0;
  width: 100%;                /* 全幅 */
  height: 100vh;              /* 全高 */
  background-color: rgba(0, 0, 0, 0.95); /* 背景をやや暗めに */
  color: #fff;
  padding: 60px 20px 20px;    /* 上に余白（メニューの開き始め位置） */
  z-index: 9999;              /* 最前面に表示 */
  transition: opacity 0.3s ease;
}

/* モバイルメニューが開いているとき */
  #mobile_menu.open {
    display: block;             /* メニュー表示 */
    opacity: 1;                 /* 透明度を戻す */
    pointer-events: auto;       /* クリック可能にする */
  }

/* メニュー項目 */
#mobile_menu ul {
  padding: 0;
  margin: 0;
  list-style: none;
  width: 100%; /* 幅を100%にして全体の幅を使う */
}

#mobile_menu ul li {
  width: 100%; /* 各メニュー項目が親の幅を使う */
}

#mobile_menu ul li a {
  display: block;
  margin: 0;
  padding: 0 50px 0 20px;
  height: 50px;
  line-height: 50px;
  overflow: hidden;
  text-decoration: none;
  color: #fff !important;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  visibility: visible;
  width: 100%;                  /* ブロック全体をクリック可能に */
  box-sizing: border-box;       /* padding込みでも幅が崩れないように */
  
}

/* メディアクエリ (1200px以下) */
@media screen and (max-width: 1200px) {

  /* ヘッダーのスタイルを変更 */
    #header {
      position: fixed;
      width: 100%;
      height: 60px;
      top: 0;
      left: 0;
      z-index: 1000;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }


    
  /* ロゴの配置 */
  #headerLogo {
    margin-left: 0;
    position: absolute;
    left: 20px;  /* ロゴの位置を少し左寄りに */
    top: 0;
    height: 60px;
  }

  #headerLogo img {
    max-height: calc(100% - 20px);
    width: auto;
  }

  #header.scrolled a {
    align-items: flex-start;

  }

  /* グローバルメニューを非表示 */
  #headerGlobalMenuContainer {
    display: none;
  }

  /* ハンバーガーメニュー */
  .menu_button {
    width: 60px;
    height: 60px;
    display: block;
    position: absolute;
    right: 0;
    top: 0;
  }

  #drawer_menu_button {
    width: 60px;
    height: 60px;
    display: block;
    position: absolute;
    right: 0;
    top: 0;
  }

  #drawer_menu_button .bar_1 {
    width: 22px;
    height: 2px;
    background: #323232;
    display: block;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.4s ease;
  }

  #drawer_menu_button span:nth-child(1) {
    top: 24px;
  }

  #drawer_menu_button span:nth-child(2) {
    top: 30px;
  }

  #drawer_menu_button span:nth-child(3) {
    top: 36px;
  }

  /* モバイルメニュー */
  #mobile_menu {
    display: none;
    position: fixed;         /* absolute → fixed に変更 */
    top: 0;                  /* ヘッダー下 → 全画面表示なので0に */
    left: 0;
    width: 100%;            /* 全幅 */
    height: 100vh;           /* 全高 */
    background-color: rgba(0, 0, 0, 0.95); /* 背景をやや暗めに */
    color: #fff;
    padding: 60px 20px 20px; /* 上に余白（メニューの開き始め位置） */
    z-index: 9999;           /* 最前面に表示 */
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;    /* 非表示状態ではクリック不可 */
  }

  /* モバイルメニューが開いたとき */
  #mobile_menu.open {
    display: block;
    opacity: 1;
    pointer-events: auto;   /* 表示状態ではクリック可 */
  }

  

  /* メニュー項目 */
  #mobile_menu ul li a {
    text-align: left;
    text-decoration: none;
    color: #fff;
    font-size: 16px;
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* ボーダーを全幅に */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;  /* 左寄せにするため、アイテムを左に配置 */
    justify-content: center;  /* 垂直方向にセンタリング */
  }

  /* スクロール時のハンバーガーメニューの色変更 */
  #header.scrolled #drawer_menu_button .bar_1 {
    background-color: #000;  /* スクロール時にハンバーガーメニューのバーを黒に変更 */
  }
}

/* === Main Content === */
main {
  margin: 0;
}
