/* ブラウザ差分をなくす最強の初期化 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

/* normalize.css 推奨 */


/* 右側に固定されたメニューコンテナ */
.menu-container {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 60px;
  background-color: rgba(0,0,0,0.3);
  transition: width 0.4s ease;
  z-index: 1000 ;
  overflow: hidden;
}

/* ホバーで展開 */
.menu-container:hover {
  width: 250px;
  background-color: rgba(0,0,0,0.7);
}

/* ハンバーガーアイコン（3本線） */
.hamburger {
  position: absolute;
  top: 20px;
  right: 15px;
  width: 30px;
  cursor: pointer;
}

.hamburger div {
  width: 100%;
  height: 4px;
  background-color: #fff;
  margin: 6px 0;
  border-radius: 2px;
  transition: all 0.3s;
}

/* ▼ メニュー本体（←ここ重要） */
.menu {
  position: absolute;
  top: 80px;
  right: 0;
  width: 250px;
  padding: 0;
  margin: 0;
  list-style: none;
  background: transparent;
  /* ← これを追加！ */
  box-sizing: border-box;  
   white-space: nowrap;   /* ← これで改行禁止 */
  overflow: hidden;      /* はみ出した場合に隠す（必要なら） */
  text-overflow: ellipsis; /* はみ出した場合に「…」を表示（任意） */


}

/* 各項目を相対位置化（サブメニューの基準にする） */
.menu li {
  position: relative;
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.3s ease;
}

/* ホバーで表示 */
.menu-container:hover li {
  opacity: 1;
  transform: translateX(0);
}

/* 各メニューリンク */
.menu a {
  display: block;
  padding: 15px 25px;
  text-decoration: none;
  color: #fff;
  font-size: 1.1em;
  transition: 0.3s;
  position: relative; /* ← 必須 */

}

.menu a:hover {
  background: rgba(255,255,255,0.2);
}

/* サブメニュー初期状態は非表示 */
.submenu {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
  background: rgba(0,0,0,0.6);
}

/* サブメニュー内のリンク */
.submenu li a {
  padding: 12px 35px; /* 少し右に寄せる */
  font-size: 0.95em;
  background: rgba(0,0,0,0.6);
  color: #fff;
}

.submenu li a:hover {
  background: rgba(255,255,255,0.2);
}

/* 親にホバーしたら展開 */
.has-submenu:hover .submenu {
  display: block;
}

/* ------------------------------- */
/* ▼ スマホ対応（768px以下） */
/* スマホ用：右側スライドメニュー */
/* -------------------------------
   スマホ用：右側スライドメニュー
-------------------------------- */
@media (max-width: 768px) {

  .menu-container {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 60px; 
    background-color: transparent !important; /* 完全に透明 */
    z-index: 1000;
  }

  .hamburger {
    position: absolute;
    top: 20px;
    right: 15px;
    width: 30px;
    cursor: pointer;
    z-index: 2000;
  }

  .menu {
    position: fixed;
    top: 0;
    right: -250px; /* 初期は右側に隠す */
    width: 250px;
    height: 100%;
    background-color: #636161; /* メニューの黒背景のみ */
    display: flex;
    flex-direction: column;
    padding-top: 80px;
    transition: right 0.4s ease;
    z-index: 1500;
  }

  .menu.open {
    right: 0;
  }

  .menu a {
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
}




