/* ===============================
   Header & Global Navigation
================================= */

/* ヘッダー全体 */
.header-inner {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 80px;
  padding: 0 36px;
  position: relative;
}
h1 img {
  width: 175px;
  height: auto;
}
.site-header {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
}

/* グローバルナビ */
.global-nav {
  position: relative;
  z-index: 1001;
}
.global-nav .nav-list {
  margin: 0;
  display: flex;
  gap: 2rem;
  list-style: none;
}
.global-nav .nav-list li { position: relative; }
.global-nav .nav-list li a {
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: #fff; 
  padding: 8px;
  border-bottom: 2px solid transparent;
  transition: all .3s;
}

/* サブメニュー */
.global-nav .nav-list li.menu-item-has-children:hover > .sub-menu {
  display: block;
}
.global-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  padding: 10px 0;
  z-index: 1100;
  transition: all .3s;
}
.global-nav .sub-menu li { 
  padding: 4px; 
  list-style: none;
}
.global-nav .sub-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  color: #fff;
  white-space: nowrap;
}
.global-nav .nav-list .sub-menu li a::after {
  content: ">";
  right: 8px;
  color: #fff;
  font-size: 1em;
  line-height: 1;
  transition: all .3s;
  margin-left: 16px;
}

/* PC時：カレントページ & ホバー下線 */
@media (min-width: 769px) {
  .global-nav .nav-list li > a {
    position: relative;
    padding-bottom: 4px;
  }
  .global-nav .nav-list .nav-top-item.current-menu-item > a,
  .global-nav .nav-list .nav-top-item.current-menu-parent > a,
  .global-nav .nav-list .nav-top-item.current-menu-ancestor > a,
  .global-nav .nav-list li.nav-top-item > a:hover {
    border-bottom: 2px solid #fff;
  }
  .global-nav .sub-menu li a:hover::after{
    transform: translateX(4px);
  }
}

/* ===============================
   ハンバーガーメニュー
================================= */
.nav-toggle {
  position: relative;
  width: 30px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 3000;
  display: none; /* PCでは非表示 */
}
.nav-toggle span {
  display: block;
  position: absolute;
  width: 100%;
  height: 3px;
  background: #fff;
  left: 0;
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 10px; }
.nav-toggle span:nth-child(3) { bottom: 0; }

/* 開いた時 */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 10px;
}
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 10px;
  bottom: auto;
}

/* 閉じるボタン */
.menu-close { display: none; }

/* ===============================
   スマホ用（max-width:768px）
================================= */
@media (max-width: 768px) {
  .header-inner {
    height: 60px;
    padding: 0 18px;
  }
  h1 img {
    width: 136px;
    height: auto;
  }

  .nav-toggle { display: block; }

  .global-nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    transition: max-height 0.4s ease;
    box-shadow: 0 4px 5px rgb(0, 0, 0, .15);
  }
  .global-nav.active { max-height: 80vh; }

  .global-nav ul { 
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
  }
  .global-nav .nav-list{
    gap: 0;
  }
  .global-nav .nav-list li.nav-top-item {
    border-bottom: 1px solid var(--line1)
  }

  .global-nav .nav-list li a {
    color: var(--black);
  }

  /* サブメニューは展開済みに */
  .global-nav ul.sub-menu {
    display: block !important;
    position: static !important;
    transform: none;
    padding: 0 0 0 1rem;
    background: transparent;
  }
  .global-nav .sub-menu li a{
    justify-content: flex-start;
  }
  .global-nav .sub-menu a::before {
    content: "— ";
    color: #555;
    margin-right: 4px;
  }

  /* 閉じるボタン */
  .menu-close {
    display: block;
    margin: 0 auto 30px;
    padding: 0.8rem 2rem;
    border: 1px solid #000;
    border-radius: 9999px;
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
    width: fit-content;
  }
  .menu-close::after { content: " ✕"; }
}
