/* ====== 共通スタイル ====== */
nav {
  background: #e6e7e0;
  padding: 15px 10px;
  text-align: center;
  gap: 30px;
  z-index: 2;
  position: sticky;
  top: 0px;
  left: 0;
  width: calc(100%);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  justify-content: center;
  user-select: none;
}

nav a {
  margin: 0 15px;
  text-decoration: none;
  color: #33327e;
  font-weight: bold;
  padding: 10px 5px 5px 5px;
  border-bottom: 2px solid transparent;
  transition: border-bottom-color 0.3s;
}

nav a:hover {
  border-bottom-color: #33327e;
}

nav a.active {
  border-bottom: 2px solid #33327e;
}

/* ハンバーガーボタン */
.nav-toggle {
  display: none;
  width: 60px;
  /* ボタンの大きさに応じて調整 */
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  height: 40px;
  margin: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  background-image: url("../images/navibtn.png");
  background-size: cover;
  /* 画像がぴったりはまるように */
  background-position: center;
  background-repeat: no-repeat;
  z-index: 9995;
}

.nav-toggle span {
  height: 3px;
  background-color: #333;
  width: 100%;
  transition: 0.3s;
}

/* ====== モバイルスタイル ====== */
@media (max-width: 768px) {
  .nav {
    position: absolute;
    top: 0;
    left: -100%;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background-color: #f1f2ec;
    padding: 60px 20px;
    gap: 20px;
    transition: left 0.3s ease;
    z-index: 9998;
  }

  .nav.show {
    position: fixed;
    display: flex;
    left: 0;
  }

  /* 初期状態のボタン（閉じているとき） */
  .nav-toggle {
    display: block;
    width: 60px;
    height: 40px;
    background-image: url("../images/navibtn.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    background-color: transparent;
    z-index: 9999;
    cursor: pointer;
    position: absolute; /* ヘッダー直下・bodyの左上基準 */
    top: 185px;          /* ヘッダーの高さ分だけ下に */
    left: 0;
    margin: 0;           /* デフォルトmarginは消す */
    transition: all 0.3s;
    user-select: none;
  }

  /* 開いたときの固定＆×ボタン */
  .nav-toggle.active {
    position: fixed;     /* 画面左上に固定 */
    top: 10px;
    left: 0;
    background-image: url("../images/xbtn.png"); /* ×アイコンに切替 */
  }
}

/* ====== PCスタイル ====== */
@media (min-width: 769px) {
  .nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .nav-toggle {
    display: none;
  }
}
