/* =========================================
   ナビゲーション調整用
   main.css の後に読み込む
   ========================================= */

/* ヘッダー全体 */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 64px;
  line-height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
}

body {
  padding-top: 64px;
}

/* ロゴ */
#logo {
  position: static;
  margin: 0;
  height: auto;
  line-height: 1;
  letter-spacing: 0;
  z-index: 10002;
}

#logo a {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
}

/* PCナビ */
#nav {
  position: static;
  height: auto;
  line-height: normal;
}

#nav ul {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}

#nav ul li {
  display: block;
  margin: 0;
  font-size: 0.92rem;
}

#nav ul li a {
  display: block;
  height: auto;
  line-height: 1.2;
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

#nav ul li a:hover,
#nav ul li a:focus {
  background: #eef6ff;
  color: #0a80c9;
  transform: translateY(-1px);
}

/* ハンバーガーボタン */
.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
  cursor: pointer;
  z-index: 10002;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 5px auto;
  background: #333;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* 開いた時に × にする */
.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================
   タブレット以下
   ========================= */
@media screen and (max-width: 1000px) {
  #header {
    padding: 0 12px;
  }

  #nav ul {
    gap: 4px;
  }

  #nav ul li a {
    padding: 9px 10px;
    font-size: 0.84rem;
  }
}

/* =========================
   スマホ
   ========================= */
@media screen and (max-width: 736px) {
  #header {
    height: 64px;
    line-height: normal;
    padding: 0 12px;
  }

  body {
    padding-top: 64px;
  }

  #logo {
    position: static;
    text-align: left;
    height: auto;
    line-height: 1;
    max-width: calc(100% - 64px);
  }

  #logo a {
    font-size: 1rem;
    line-height: 1.2;
  }

  .menu-toggle {
    display: block;
  }

  #nav {
    display: block !important;
    position: fixed;
    top: 64px;
    right: 12px;
    left: 12px;
    height: auto;
    line-height: normal;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 10001;
  }

  #nav.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  #nav ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  #nav ul li {
    width: 100%;
  }

  #nav ul li a {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f7fafc;
    color: #333;
    font-size: 0.96rem;
    font-weight: 600;
  }

  #nav ul li a:hover,
  #nav ul li a:focus {
    background: #eef6ff;
    color: #0a80c9;
    transform: none;
  }
}