/* ===========================
   site-header.css（統合版 / 879ブレイク専用）
   PC/SP対応ヘッダー
   ※SP時のみ .site-header__inner に box-shadow と左右20pxパディングを付与
=========================== */

/* 可変値（SPナビの見かけライン合わせ） */
:root{
  --spnav-top: 56px;       /* spnav開始（ヘッダー直下） */
  --spnav-offset: 12px;    /* 中身の上余白（見かけ開始=56+12=68px） */
  --spnav-overlap: 2px;    /* 上にかぶせる微調整（端末の1〜2px対策） */
}

/* ===========================
   共通：ヘッダー基本レイアウト
=========================== */
.site-header {
  position: relative;
  background: #fff;
  color: #333;
  width: 100%;
  transition: box-shadow 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1460px;
  padding: 8px 20px;
  margin: 0 auto;
  min-width: 0;
}
.site-header__logo { flex-shrink: 0; }
.site-header__logo img {
  width: 236px;
  height: 52px;
  margin-right: 20px;
  max-width: none;
}
.site-header__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
}

/* ===========================
   共通：メニューと検索フォーム
=========================== */
.site-header__nav {
  display: flex;
  align-items: center;
  gap: 25px;
}
.site-header__menu { display: flex; }
.site-header__menu-item { margin-right: 25px; }
.site-header__menu-item:last-child { margin-right: 0; }
.site-header__menu-item a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  color: #000;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.site-header__menu-item img { width: 18px; height: 18px; }
.site-header__menu-item span { display: inline; }

/* 検索フォーム（PC） */
.site-header__search--pc {
  display: flex;
  align-items: center;
  background: #f4f4f4;
  height: 50px;
  border-radius: 4px;
  padding: 0 12px;
  margin-right: 25px;
  max-width: 434px;
  min-width: 330px;
  width: 100%;
  box-sizing: border-box;
}
.site-header__search-inputwrap { flex: 1; }
.site-header__search-inputwrap input {
  border: none;
  font-size: 16px;
  width: 100%;
  padding: 8px;
  background: transparent;
  outline: none;
  color: #333;
  caret-color: #333;
}
.site-header__search-inputwrap input::placeholder { color: #9aa0a6; opacity: 1; }
.site-header__search-inputwrap input:focus { -webkit-text-fill-color: #333; }
.site-header__search-inputwrap input:-webkit-autofill {
  -webkit-text-fill-color: #333;
  transition: background-color 5000s ease-in-out 0s;
}
.btn--search-icon { background: none; border: none; cursor: pointer; }
.btn--search-icon img { width: 21px; height: 20px; }

/* ===========================
   ハンバーガー：トグルボタン
=========================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  background: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
  position: relative;
}
.menu-toggle span {
  display: block;
  position: absolute;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: all 0.3s ease;
  left: 6px;
}
.menu-toggle span:nth-child(1) { top: 8px; }
.menu-toggle span:nth-child(2) { top: 15px; }
.menu-toggle span:nth-child(3) { top: 22px; }
.menu-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===========================
   SP：検索フォーム（2段目）
=========================== */
.site-header__search--sp {
  display: flex;
  align-items: center;
  background: #f4f4f4;
  height: 40px;
  border-radius: 4px;
  padding: 0 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 20px 20px;
}
.site-header__search--sp .site-header__search-inputwrap input { color: #333; caret-color: #333; }
.site-header__search--sp .site-header__search-inputwrap input::placeholder { color: #9aa0a6; opacity: 1; }
.site-header__search--sp .site-header__search-inputwrap input:focus { -webkit-text-fill-color: #333; }
.site-header__search--sp .site-header__search-inputwrap input:-webkit-autofill {
  -webkit-text-fill-color: #333;
  transition: background-color 5000s ease-in-out 0s;
}

/* ===========================
   SPナビ（右スライド本体）
   見かけ開始=56+12=68px。上に2pxだけかぶせて細線を隠す
=========================== */
.spnav {
  position: fixed;
  top: calc(var(--spnav-top) - var(--spnav-overlap));
  right: 0;
  width: 100vw;
  height: calc(100vh - (var(--spnav-top) - var(--spnav-overlap)));
  background: transparent;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 998; /* ヘッダー(1000)より下：ヘッダー影を上に出す */
  overflow-y: auto;
  box-sizing: border-box;
}
.spnav.is-open { transform: translateX(0); }

/* 中身（白）。見かけ開始は 56+12=68 を維持するため、オーバーラップ分だけ足す */
.spnav-scroll-wrapper {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  background: #fff;
  padding-top: calc(var(--spnav-offset) + var(--spnav-overlap));
  box-sizing: border-box;
}

/* ===========================
   メディアクエリ（SP ≤ 879px）
=========================== */
@media (max-width: 879px) {
  .site-header__search--pc { display: none; }
  .site-header__menu-item { margin-right: 20px; }
  .site-header__menu-item img { height: 24px !important; width: auto !important; max-width: none; }
  .site-header__menu-item span { display: none; }
  .site-header__logo img { height: 32px; width: auto; max-width: none; }
  .menu-toggle { display: flex; margin-left: 25px; }
  .site-header { position: fixed; top: 0; left: 0; background: #fff; box-shadow: none; }
  .subnav { display: none; }
  #gHeader { display: none; }
  body { padding-top: 0px; }
  .site-header__search--sp { margin: 3px 20px 20px; width: auto; max-width: 100%; }

  #js-site-header .site-header__inner {
    padding: 0 20px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
    background: #fff;
  }

  .site-header__search--sp input[type="text"] {
    font-size: 16px !important;
    line-height: 1.4;
  }
  .site-header__search--sp ::placeholder {
    font-size: 16px;
    opacity: .7;
  }

  /* メニュー開時は sticky 検索群を完全非表示（見残り対策） */
  body.menu-open .site-header__sp-search-container,
  body.menu-open .js-search-main,
  body.menu-open .js-search-main-wrapper {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

/* ===========================
   メディアクエリ（PC ≥ 880px）
=========================== */
@media (min-width: 880px) {
  .spnav { display: none !important; }
  .site-header.fixed { position: fixed; top: 0; z-index: 998; }
  body.has-fixed-header { padding-top: 60px; }
  .site-header__search--sp { display: none !important; }

  #js-site-header .site-header__menu-item a,
  #js-site-header .site-header__search-inputwrap input {
    font-size: clamp(16px, calc(18px * 100vw / 1460), 18px) !important;
    line-height: 1.3;
  }
  #js-site-header .site-header__logo img {
    height: clamp(32px, calc(52px * 100vw / 1460), 52px) !important;
    width: auto !important;
    margin-right: clamp(8px, calc(20px * 100vw / 1460), 20px) !important;
  }
  #js-site-header .site-header__search--pc {
    height: clamp(40px, calc(50px * 100vw / 1460), 50px) !important;
  }
  #js-site-header .site-header__inner {
    box-sizing: border-box !important;
    max-width: 1460px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 8px 20px !important;
    display: flex !important;
  }
}

/* ===========================
   ハンバーガーメニュー（開閉UI）
=========================== */
.spnav__menu { padding: 0; }
.spnav__list { list-style: none; padding: 0; margin: 0; }
.spnav__item { background-color: #0075c2; border-bottom: 1px solid #eee; }
.spnav__item > a,
.spnav__item > button.spnav__toggle {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 12px 16px; font-size: 16px; font-weight: 500;
  color: #fff; background: none; border: none; cursor: pointer;
}
.spnav__toggle {
  position: relative;
  padding-right: 24px;
  font-size: 16px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.spnav__item.is-open > .spnav__toggle::after { transform: translateY(-50%) rotate(180deg); }
.spnav__icon { width: 16px; height: 16px; transition: transform 0.3s ease; }
.spnav__item.is-open > .spnav__toggle .spnav__icon { transform: rotate(180deg); }

/* 子リスト（アコーディオン） */
.spnav__children {
  max-height: 0; overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease;
  padding-left: 16px; background: #f9f9f9; display: none; margin-top: 8px; margin-bottom: 12px; list-style: none;
}
.spnav__item.is-open > .spnav__children {
  max-height: 500px; opacity: 1; display: block; transition: max-height 0.5s ease, opacity 0.5s ease;
}
.spnav__children li a {
  display: block; padding: 10px 0; color: #333; font-size: 14px; text-decoration: none; border-bottom: 1px solid #eee;
}
.spnav__children li:last-child a { border-bottom: none; }
.spnav__arrow { width: 8px; height: 14px; }

/* ========================
   ハンバーガー内：フッター部（リンク + SNS）
======================== */
.spnav__footer { padding: 24px 16px 32px; background: #f2f8ff; font-size: 13px; color: #80b5de; }
.spnav__footer-cols { display: flex; border-left: 2px solid #80b5de; }
.spnav__footer-links {
  flex: 1; list-style: none; padding: 0 16px; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.spnav__footer-links--right { border-left: 2px solid #80b5de; }
.spnav__footer-links li a { color: #80b5de; font-weight: 500; text-decoration: none; font-size: 13px; white-space: nowrap; }
.spnav__footer-sns-area { margin-top: 24px; display: flex; justify-content: space-between; gap: 16px; }
.spnav__footer-sns-wrapper { display: flex; justify-content: flex-start; margin-top: 20px; }
.spnav__footer-sns {
  list-style: none; padding: 0; margin: 0; width: 50%;
  display: flex; flex-direction: column; gap: 12px;
}
.spnav__footer-sns li { width: 50%; margin-bottom: 12px; display: flex; align-items: center; }
.spnav__footer-sns li:nth-child(3) { justify-content: flex-end; }
.spnav__footer-sns li a {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: #80b5de; font-weight: 500; text-decoration: none; white-space: nowrap;
}

/* =====================
   ハンバーガー内SNSアイコン（スコープ済み）
===================== */
.spnav .sns-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.spnav .sns-item--x img,
.spnav .sns-item--instagram img {
  padding: 6px !important;
}
.spnav .sns-item--youtube { text-align: right; }
.spnav .sns-item img {
  width: 32px !important;
  height: 32px !important;
  background-color: #fff;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  padding: 4px;
  box-sizing: border-box;
  object-fit: contain;
}

/* =====================
   Sticky補助（既存）
===================== */
.js-search-main { margin-top: 71px; position: sticky; z-index: 998; }
.js-search-main.is-hidden { display: none !important; }
.site-header__sp-search-container { position: sticky; background: #fff; z-index: 999; }
.js-search-main-wrapper.is-hidden { display: none !important; }
/* =========================================================
   ▼ hamburger menu adjustments (append-only)
   - ブランド色/罫線/リンク色の統一
   - 下部ツール/セーフエリア被り対策（背景と余白）
   - 100dvh 対応で正しい高さを確保
   - ホバー時の色変化を抑止（白/既定のまま）
========================================================= */
:root { --brand: #0072BA; }

/* もし変な帯を作る ::after があれば無効化（保険） */
.spnav-scroll-wrapper::after { content: none !important; }

/* フッターの配色とリンク色・罫線（指定どおり） */
.spnav__footer{
  background: #F1F8FF !important;
  color: var(--brand) !important;
  /* 下端UIやセーフエリアに被らないよう余白を足す */
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px) + var(--sp-bottom-ui, 0px)) !important;
}
.spnav__footer-cols{
  display: flex;
  border-left: 1px solid var(--brand) !important; /* 1px いつもの青 */
}
.spnav__footer-links--right{ border-left: 1px solid var(--brand) !important; }
.spnav__footer-links li a{
  color: var(--brand) !important;
  font-weight: 400 !important;
  text-decoration: none !important;
}

/* 下部に固定ツール等がある画面だけ余白を増やす用（必要なら <body class="has-bottom-ui">） */
body.has-bottom-ui{ --sp-bottom-ui: 64px; }

/* dvh が使える端末では正しい高さを確保（下部UIで欠けない） */
@supports (height: 100dvh){
  .spnav{
    height: calc(100dvh - (var(--spnav-top) - var(--spnav-overlap))) !important;
  }
}
/* セーフエリア分の余白を中身にも確保（スクロール末端の切れ対策） */
.spnav-scroll-wrapper{
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--sp-bottom-ui, 0px)) !important;
}

/* トップレベル行：ホバー時に色が変わらないよう固定（白のまま） */
.spnav__item > a,
.spnav__item > .spnav__toggle{
  color: #fff !important;
}
.spnav__item > a:hover,
.spnav__item > a:focus,
.spnav__item > a:active,
.spnav__item > .spnav__toggle:hover,
.spnav__item > .spnav__toggle:focus,
.spnav__item > .spnav__toggle:active{
  color: #fff !important;
  text-decoration: none !important;
  filter: none !important;
}

/* 子メニュー（灰テキスト）は色変化なしで固定 */
.spnav__children li a{
  color: #333 !important;
}
.spnav__children li a:hover,
.spnav__children li a:focus{
  color: #333 !important;
  text-decoration: none !important;
  filter: none !important;
}
/* SNSリンクも「いつもの青」に */
.spnav__footer-sns li a{
  color: var(--brand, #0072BA) !important;
}
.spnav__footer-sns li a:hover,
.spnav__footer-sns li a:focus{
  color: var(--brand, #0072BA) !important;
}
/* === Hamburger: SNSリンクの文字ウェイト修正 === */
.spnav__footer-sns li a{
  font-weight: 400 !important;
  color: #0072BA !important; /* いつもの青（念のため再指定） */
}
