/* =========================================================
   header.css (Integrated Final v3)
   - common.css連携
   - PC高さ: 64px / SP高さ: 56px
   - ゴシック体ナビゲーション
   - ハンバーガー: 背景透明化 & クリック時の点滅削除済み
========================================================= */

/* =============== Base Header =============== */
.global-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px; /* PC版: 余白を持たせた64px */

  /* common.css の変数を使用 */
  background: var(--bg-header, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* 影は薄く上品に */
  z-index: var(--z-header, 999);

  transform: translateY(0);
  transition: transform 0.4s ease;
}

/* スクロールダウンで隠すクラス */
.header--unpinned {
  transform: translateY(-100%);
}

/* ドロワー展開中は動きを無効化 */
.global-header.no-transform {
  transform: none !important;
}

.g-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* common.css の .container と概念を統一 */
  width: min(92%, 1280px);
  height: 100%;
  margin-inline: auto;
}

/* =============== Logo =============== */
.g-header-logo {
  display: flex;
  align-items: center;
  height: 64px; /* ヘッダー高さに合わせる */
}
.g-header-logoImg {
  width: 210px;
  height: 50px; /* PCロゴ高さ */
  margin: auto;
}
.g-header-logoImg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.g-header-logo-link {
  display: block;
  width: 100%;
  height: 100%;
}

/* =============== Navigation (PC) =============== */
.g-navi {
  display: flex;
  align-items: center;
  position: relative;
}

.g-navi-ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0 8px;
  padding: 0;
}

.g-navi-li {
  position: relative;
  margin: 0 10px;

  /* フォント変数 (ゴシック体) */
  font-family: var(--ff-sans, sans-serif);
  font-size: 0.9rem;
  font-weight: 500; /* 細すぎないウェイト */
  letter-spacing: 0.06em; /* 洗練された字間 */
}

/* リンクスタイル */
.g-navi-li-inner a {
  position: relative;
  display: block;
  /* クリック領域の確保 */
  padding: 19px 12px;

  /* 通常色は濃いグレー */
  color: var(--text-main, #333);
  text-decoration: none;
  transition: color 0.3s ease;
}

/* アンダーライン（ホバー時） */
.g-navi-li-inner a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 12px;
  width: 100%;
  height: 2px;
  /* ブランドカラー（シアン）を使用 */
  background-color: var(--color-primary, #00a1e9);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

/* ホバー時 */
.g-navi-li-inner a:hover {
  /* 信頼感のあるネイビーに変化 */
  color: var(--color-primary-dark, #1b4b8d);
}
.g-navi-li-inner a:hover::after {
  transform: scaleX(1);
}

/* 現在ページ (Active) */
.g-navi-li-inner a[aria-current='page'] {
  color: var(--color-primary-dark, #1b4b8d);
  font-weight: 700;
}
.g-navi-li-inner a[aria-current='page']::after {
  transform: scaleX(1);
}

/* =============== Submenu (Dropdown) =============== */
.g-navi-parent {
  position: relative;
}
.g-navi-sub {
  display: none; /* 初期非表示 */
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--bg-header, #fff);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  list-style: none;
  padding: 8px 0;
  z-index: 1000;
}
.g-navi-sub li a {
  display: block;
  padding: 10px 16px;
  color: var(--text-main, #333);
  font-size: 0.85rem;
  font-family: inherit; /* ゴシック継承 */
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.g-navi-sub li a:hover {
  background-color: var(--color-gray-light, #f7f7f7);
  color: var(--color-primary-dark, #1b4b8d);
}

/* ホバーで表示 */
.g-navi-parent:hover .g-navi-sub,
.g-navi-parent:focus-within .g-navi-sub {
  display: block;
}

/* =============== Hamburger Menu =============== */
.hamburger {
  display: none; /* PCでは非表示 */
  position: relative;
  width: 48px;
  height: 48px;
  z-index: 1001; /* ナビより上 */
  background: transparent;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;

  /* ★追加：クリック時の不要な点滅・枠線を削除 */
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* フォーカス時の枠線も強制削除 */
.hamburger:focus {
  outline: none;
}

.hamburger span {
  display: inline-block;
  position: absolute;
  left: 14px;
  width: 20px; /* シャープな幅 */
  height: 2px; /* 視認性のある太さ */
  background: var(--text-main, #333);
  border-radius: 3px;
  transition: all 0.35s ease;
}
.hamburger span:nth-of-type(1) {
  top: 16px;
}
.hamburger span:nth-of-type(2) {
  top: 23px;
}
.hamburger span:nth-of-type(3) {
  top: 30px;
}

/* ハンバーガー Active時（×印） */
.hamburger.active span:nth-of-type(1) {
  transform: translateY(7px) rotate(-45deg);
  width: 24px;
  left: 12px;
}
.hamburger.active span:nth-of-type(2) {
  opacity: 0;
}
.hamburger.active span:nth-of-type(3) {
  transform: translateY(-7px) rotate(45deg);
  width: 24px;
  left: 12px;
}

/* ★修正箇所：ドロワー展開時に右上に固定 */
.is-drawer-open .hamburger {
  position: fixed;
  top: 8px; /* SPヘッダー56pxに対してバランス調整 */
  right: 10px;
  z-index: 1101; /* サイトマップより上 */

  /* 背景を透明にして、×印だけを浮かび上がらせる */
  background: transparent;
  border: none;
  box-shadow: none;

  /* サイズ維持 */
  width: 48px;
  height: 48px;
}
.is-drawer-open .hamburger span {
  left: 50%;
  width: 22px;
  margin-left: -11px;
}

/* =============== Responsive (Mobile/Tablet) =============== */
@media (max-width: 1100px) {
  .global-header {
    height: 56px; /* SP高さ */
  }
  .g-navi-ul {
    display: none; /* PCメニュー非表示 */
  }
  .hamburger {
    display: inline-flex; /* ハンバーガー表示 */
  }

  /* スマホ展開メニュー（基本はsitemap.css側を使用） */
  .g-navi.is-open .g-navi-ul {
    display: block;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    background: var(--bg-header, #fff);
    padding: 12px 18px 28px;
    z-index: 950;
  }

  .g-navi-li {
    margin: 0;
    border-bottom: 1px solid var(--color-gray-border, #e9e9e9);
  }
  .g-navi-li-inner a {
    padding: 14px 8px;
  }

  /* ロゴ調整 */
  .g-header-logo {
    height: 56px;
  }
  .g-header-logoImg {
    height: 40px;
  }
}
