/* ヘッダー */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height-pc);
  background: var(--main-color);
  color: var(--header-font-color);
  z-index: 999;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
}

/* ロゴ左寄せ */
.logo img {
  height: calc(var(--header-height-pc) - 10px);
}

/* 右側全体を右寄せ */
.header-right {
  margin-left: auto; /* ロゴから離して右寄せ */
  display: flex;
  align-items: center;
  gap: 24px;
}

/* 右寄せの中のボタンたち３つ */
.nav-body {
  display: flex;
  gap: 30px;
}

.header-nav a {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  color: inherit;
  text-decoration: none;
  text-align: center;
}

.nav-ja {
  font-size: 16px;
}

.nav-en {
  font-size: 13px;
  opacity: 0.7;
}

/* スマホのときだけ表示 */
.menu-toggle,
.hamburger {
  display: none;
}

/* 検索ボックス＋アイコン */
.header-search {
  display: flex;
  align-items: center;
  background: var(--main-color);
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid var(--header-font-color);
}

.header-search input {
  border: none;
  background: transparent;
  color: inherit;
  padding: 2px 6px;
  min-width: 140px;
  font-size: 13px;
}

.header-search input::placeholder {
  color: inherit;
  opacity: 0.7;
}

.header-search button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;display: flex;
  align-items: center;
  font-size: 16px;
}

/* ページ番号 */
.page-indicator {
  font-size: 13px;
  padding: 4px 8px;
}

/* レスポンシブ対応 */
@media (max-width: 800px) {
  .site-header {
    height: var(--header-height-sp);
  }

  .header-inner {
    position: relative;
    padding-inline: 16px; 
  }

  .logo {
    display: block; 
    position: absolute;
    left: 50%;
    transform: translateX(-50%); /* 完全に真ん中へ */
    margin: auto 0;
    z-index: 10; /* 他の要素より上に */
  }

  .logo img {
    height: calc(var(--header-height-sp) - 20px);
  }
  
  .header-right {
    margin: 0;           /* margin-left: auto を解除 */
    width: 100%;         /* 幅をいっぱいにする */
    display: flex;
    justify-content: space-between; /* 両端（左：ハンバーガー、右：ページ番号）に配置 */
    align-items: center;
    gap: 10px;
  }
  
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 3本を均等配置 */
    width: 26px;   /* サイズを微調整 */
    height: 18px;
    cursor: pointer;
    z-index: 1001;
    padding: 10px; /* タップしやすく余白を確保 */
    position: relative;
    margin: 0;
  }
  
  .hamburger span {
    width: 100%;
    height: 1px;
    background: var(--header-font-color);
    transition: 0.3s ease;
    border-radius: 2px;
  }

  .page-indicator {
    margin: 0;
  }
  
  .header-nav {
    position: fixed;
    top: var(--header-height-sp);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height-sp));
    background: var(--main-color);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    visibility: hidden; /* 閉じている時は見えないようにする */
  }

  /* チェックが入ったら表示 */
  #menu-toggle:checked ~ .header-nav {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-body {
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    gap: 5px;
    width: 100%;
    box-sizing: border-box; /* paddingを含めた100% */
    margin: 0 auto;
  }

  .header-search {
    margin-top: 10px;
    width: 100%; 
    max-width: 300px; 
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1);
  }

  .header-nav a {
    width: 100%;
    text-align: center;
    padding-block: 18px;
  }

  .header-search input {
    flex: 1;                 /* 【重要】これで入力欄を広げ、アイコンを右端に寄せる */
    border: none;
    background: transparent;
    color: inherit;
    outline: none;
    padding: 8px;            /* 入力しやすく */
  }
  
  .header-search button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;              /* 余計な余白をリセット */
  }
  
  .nav-en {
    display: none;
  }
  
  /* 開閉時の×変形 */
  #menu-toggle:checked + .hamburger span:nth-child(1) {
    transform: translateY(9px) rotate(30deg);
  }
  #menu-toggle:checked + .hamburger span:nth-child(2) {
    opacity: 0;
  }
  #menu-toggle:checked + .hamburger span:nth-child(3) {
    transform: translateY(-9px) rotate(-30deg);
  }
}