/* ヘッダー */
#header {
  position: fixed;
  left: 0;
  width: 100%;
  padding: 10px 20px;
  box-sizing: border-box;
  color: rgb(0, 0, 0);
  background-color: rgb(255, 255, 255);
  z-index: 1000;
  border-bottom: 1px solid #ccc;
  transition: top 0.3s ease-in-out, bottom 0.3s ease-in-out;
  bottom: 0;   /* 最初は画面下部に */
  top: auto;

  position: -webkit-sticky;
  position:         sticky;
  top: 0;
}
  





.menu-link.active {
  color: rgb(88, 119, 255); /* 好きな色に変更 */
  font-weight: bold;
}




.menu-icon {
  width: 40px;
  height: 30px;
  position: fixed; /* ← fixedにして常に左上固定 */
  top: 20px;
  left: 20px;
  cursor: pointer;
  z-index: 3;
  display: inline-block;
}

.menu-icon span {
  display: block;
  height: 4px;
  margin: 6px 0;
  background: #333;
  border-radius: 2px;
  transition: 0.4s;
}

/* ハンバーガーがXに変形 */
#menu-toggle:checked + .menu-icon span:nth-child(1) {
  transform: translateY(10px) rotate(45deg);
}
#menu-toggle:checked + .menu-icon span:nth-child(2) {
  opacity: 0;
}
#menu-toggle:checked + .menu-icon span:nth-child(3) {
  transform: translateY(-10px) rotate(-45deg);
}

/* オーバーレイ背景 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: 0.4s;
  z-index: 1;
}

#menu-toggle:checked ~ .overlay {
  opacity: 1;
  pointer-events: auto;
}

/* メニュー本体（左から出す） */
.menu {
  position: fixed;
  top: 0;
  left: -250px; /* ← 初期位置を左へ */
  width: 250px;
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.2);
  transition: left 0.4s ease;
  z-index: 2;
}

#menu-toggle:checked ~ .menu {
  left: 0; /* ← 開いたときは左0へ */
}

.menu ul {
  list-style: none;
  padding: 60px 20px;
}

.menu li {
  margin: 20px 0;
}

.menu a {
  text-decoration: none;
  color: #333;
  font-size: 1.2rem;
  transition: color 0.3s;
}

.menu a:hover {
  color: #007bff;
}



@media screen and (min-width: 950px) {
  /* ハンバーガーアイコン非表示 */
  .menu-icon {
    display: none;
  }

  /* メニューをヘッダー内に横並びで表示 */
  .menu {
    position: static;
    width: auto;
    height: auto;
    background: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    transition: none;
    justify-content: center; /* ← 中央寄せ */
  }

  .menu ul {
    display: flex;
    gap: 50px; /* リスト間の余白 */
    padding: 0;
    margin: 0;
  }

  .menu li {
    margin: 0 15px;
  }

  /* オーバーレイ非表示 */
  .overlay {
    display: none;
  }
}

@media (max-width: 950px) {
  #header{
    padding: 0 0px;
  }
}