/* =========================
   JA FMS ヘッダー（完全一致版・px固定）
   ========================= */

/* 固定ヘッダー帯（下に点線背景） */
#header {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  position: fixed;
}

#header .navigation_privacypolicy,
#header .navigation_list a {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
}

.l-header {
  flex: 0 0 auto;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 80;
  width: 100%;
  height: 86px;
  padding: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #8A8785;
  background-image: url('../img/2x/header_bg1@2x.png'), url('../img/bg_white.png');
  background-position: top center, bottom left;
  background-size: 100% 80px, 6px 6px;
  background-repeat: no-repeat, repeat-x;
}

/* 右端の雲（SPは非表示、PCで出す） */
.l-header:before {
  content: "";
  display: none;
  position: absolute;
  right: 0;
  bottom: -36px;
  z-index: 10;
  width: 112px;
  height: 90px;
  background: url('../img/header_cloud.png') no-repeat;
  background-size: 112px;
}

/* ロゴ位置（SPベース） */
.logo {
  position: absolute;
  top: 0;
  left: 0;
}

/* ====== メッセージ ====== */
.navigation_message {
  display: none;
  color: #0092D8;
}

/* ===== プライバシー ===== */
.navigation_privacypolicy {
  font-size: 14px;
  margin-top: -3px;
}

#header .navigation_caption p {
  margin: 0;
}

#header .navigation_privacypolicy {
  font-size: 14px;
  margin-top: -3px;
}

#header .navigation_privacypolicy a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

/* === 固定ヘッダー分の押し下げ（SP基準） === */
body {
  padding-top: 86px !important;
}

.page-header {
  margin-top: 0 !important;
}

body.admin-bar {
  padding-top: calc(86px + 32px) !important;
}

/* ====== SP（～1099px）まとめ ====== */
@media screen and (max-width:1099px) {
  #header .navigation {
    display: none !important;
  }

  .vk-mobile-nav-btn,
  .vk-mobile-nav,
  .vk-mobile-nav-cover {
    display: block !important;
  }

  #header .mask {
    position: absolute;
    top: 84px;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(22, 34, 42, .4);
    opacity: 1;
    display: none;
    z-index: 1;
  }

  .logo {
    width: 73px;
    height: 80px;
    padding: 28px 0 0 16px;
    background: url('../img/2x/logo_bg@2x.png') top left / contain no-repeat;
    z-index: 99;
  }

  .logo img {
    width: 56%;
  }

  .logotype {
    width: 200px;
    position: absolute;
    z-index: 100;
    top: 24px;
    left: 80px;
  }

  body {
    padding-top: 86px !important;
  }

  body.admin-bar {
    padding-top: calc(86px + 32px) !important;
  }
}

/* ====== PC（1100px～）まとめ（1100–1279px 含む） ====== */
@media print,
screen and (min-width:1100px) {

  .l-header {
    position: relative;
    height: 117px;
    padding: 45px 0 0 102px;
    margin-bottom: 10px;
    background-size: 960px 112px, 5px 5px;
    background-repeat: repeat-x, repeat-x;
  }

  .l-header:before {
    display: block;
  }

  .logo {
    width: 102px;
    height: 112px;
    padding: 27px 27px 0 7px;
    background: url('../img/2x/logo_bg@2x.png') top left / 102px no-repeat;
  }

  .logotype {
    width: 214px;
  }

  /* ナビ背景帯 */
  #header .navigation {
    position: absolute;
    top: 0;
    right: 0;
    width: 800px;
    height: 104px;
    padding: 20px 0 0 35px;
    background: url(../img/2x/header_bg2@2x.png) top left / 800px no-repeat;
  }

  .navigation_caption {
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    margin-bottom: 13px;
  }

  /* メッセージ */
  .navigation_message {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-left: 0;
    margin-bottom: 7px !important;
    -webkit-transform: skewX(0deg);
    transform: skewX(0deg);
    -webkit-transform-origin: top;
    transform-origin: top;
  }

  #gNav .navigation_privacypolicy {
    font-size: 14px;
    line-height: 21px;
    margin-top: -4px !important;
  }

  /* 点線帯（横ライン） */
  #header .navigation .navigation_list {
    position: relative;
    padding-left: 10px;
    height: 38px;
    line-height: 38px;
    margin-left: 0;
    background: url('../img/2x/nav_bg@2x.png') top left / 844px no-repeat;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0;
  }

  /* ▼ これが無いと縦棒の基準が li にならず、左端に1本しか出ません */
  #header .navigation .navigation_list>li {
    position: relative;
  }

  /* 縦の仕切り線（1100–1279px） */
  #header .navigation .navigation_list>li+li::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 7px;
    width: 2px;
    height: 23px;
    background: #8A8785;
    pointer-events: none;
  }

  /* 第1階層リンク（1100+） */
  #header .navigation .navigation_list>li>a {
    display: inline-block;
    width: 112px;
    text-align: center;
    letter-spacing: .1em;
    font-weight: 700;
    font-size: 14px;
    color: #5D5857;
    text-decoration: none;
  }

  /* ドロップダウン */
  #gNav .sub-menu {
    position: absolute;
    left: 50%;
    top: 40px;
    width: 235px;
    transform: translateX(-50%);
    margin-left: 0;
    border: 2px solid #8A8785;
    background: #fff;
    display: block;
    visibility: hidden;
    opacity: 0;
    z-index: 1;
    transition: all .2s ease;
  }

  #gNav .sub-menu:before {
    content: '';
    position: absolute;
    right: 0;
    left: 0;
    top: -8px;
    margin: auto;
    border-style: solid;
    border-color: transparent transparent #8A8785 transparent;
    border-width: 0 8px 8px 8px;
    width: 0;
    height: 0;
  }

  #gNav .sub-menu li {
    position: relative;
    display: block;
  }

  #gNav .sub-menu li a {
    position: relative;
    display: block;
    width: 100%;
    padding: 16px 10px;
    line-height: 1.2em;
    color: #222;
    text-decoration: none;
  }

  #gNav .sub-menu li:before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 84%;
    height: 1px;
    background: #8A8785;
    z-index: 5;
  }

  #gNav .sub-menu li:last-child:before {
    content: none;
  }

  /* hover 状態 */
  #gNav ul>li:hover>a,
  #gNav .current-menu-item>a,
  #gNav .current-menu-parent>a {
    color: #0092D8;
  }

  #gNav li:hover ul.sub-menu {
    top: 50px;
    visibility: visible;
    opacity: 1;
    z-index: 9999;
    background: url('../img/2x/nav_bg@2x.png') top right / 844px no-repeat, #fff;
  }

  /* 固定ヘッダー分の押し下げ（1100+） */
  body {
    padding-top: 117px !important;
  }

  body.admin-bar {
    padding-top: calc(117px + 32px) !important;
  }
}

/* ====== 1280px～まとめ（ご提示どおり・変更なし） ====== */
@media screen and (min-width:1280px) {
  .l-header {
    height: 156px;
    padding: 61px 0 0 137px;
    margin-bottom: 10px;
    background-size: 1280px 150px, 6px 6px;
  }

  .l-header:before {
    width: 150px;
    height: 120px;
    background-size: 150px;
  }

  .logo {
    width: 137px;
    height: 150px;
    padding: 36px 36px 36px 10px;
    background: url('../img/2x/logo_bg@2x.png') top left / 137px no-repeat;
  }

  .logotype {
    width: 286px;
  }

  #header .navigation {
    width: 877px;
    height: 130px;
    padding: 29px 0 0 34px;
    background: url('../img/2x/header_bg2@2x.png') top left / 877px no-repeat;
  }

  #header .navigation .navigation_list {
    padding-left: 54px;
    height: 50px;
    line-height: 50px;
  }

  .navigation_item+.navigation_item:before {
    top: 9px;
    height: 31px;
    width: 2px;
  }

  #header .navigation .navigation_list>li>a {
    width: 133px;
    font-size: 16px;
    font-weight: 700;
    line-height: 50px;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    color: #5D5857;
    text-decoration: none;
  }

  #header .navigation .navigation_list {
    display: flex;
    align-items: center;
    gap: 0;
    height: 50px;
    line-height: 50px;
    list-style: none;
    padding-left: 54px;
  }

  #header .navigation .navigation_list>li {
    position: relative;
  }

  /* 縦の区切り線（1280+） */
  #header .navigation .navigation_list>li+li::before {
    content: "";
    position: absolute;
    left: -4px;
    top: 9px;
    width: 2px;
    height: 31px;
    background: #8A8785;
    pointer-events: none;
  }

  .navigation_message {
    display: block;
    margin: 0 !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: 0;
    color: #0092D8;
  }

  .navigation_privacypolicy {
    font-weight: 700;
    font-size: 14px;
    margin-top: -30px !important;
    line-height: 18px;
  }

  #header .navigation_caption p {
    margin: 0;
    padding: 0 !important;
  }

  .navigation_caption {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 13px;
  }

  /* 固定ヘッダー分の押し下げ（1280+） */
  body {
    padding-top: 156px !important;
  }

  body.admin-bar {
    padding-top: calc(156px + 32px) !important;
  }

  /* プライバシーポリシー行（元サイト準拠） */
  #gNav .navigation_privacypolicy {
    font-size: 14px;
    line-height: 21px;
    margin-top: -4px !important;
  }
}

/* ここからサイドメニュー */
/* ============================================
   サイドメニュー：全行に背景パターン＋hover透過＋色統一
   （1100px 以上。既存を崩さない上書きだけ）
   ============================================ */
@media print,
screen and (min-width:1100px) {

  /* ▼ サブメニューUL自体に“縦リピート”で背景を敷く（1段目だけにならない） */
  #header #gNav li:hover>ul.sub-menu,
  #header #gNav li:focus-within>ul.sub-menu {
    background-image: url('../img/2x/nav_bg@2x.png');
    background-position: top right;
    background-size: 844px auto;
    /* 高さは画像の素のまま。pxでの縦調整はしない */
    background-repeat: repeat-y;
    /* ← これで2段目以降もずっと出る */
    background-color: #fff;
  }

  /* ▼ 各行は透明（ULの背景を隠さない） */
  #header #gNav ul.sub-menu {
    padding-left: 0;
    margin: 0;
  }

  #header #gNav ul.sub-menu li {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  #header #gNav ul.sub-menu li>a {
    display: block;
    width: 100%;
    text-align: center;
    /* 中央揃え */
    padding: 16px 0;
    /* 左右の余白をゼロに固定 */
    margin: 0;

    font-size: 14px;
    /* ご指定どおり */
    font-weight: 700;
    /* ご指定どおり */
    letter-spacing: 0;
    color: #5D5857;
    /* ご指定どおり */
    text-decoration: none;
    background: transparent;
    /* ← hover色が被って背景が消える問題を防ぐ */
  }

  /* ▼ hoverでも色は固定。背景も透明のまま（被せない） */
  #header #gNav ul.sub-menu li>a:hover,
  #header #gNav ul.sub-menu li>a:focus {
    color: #5D5857;
    background: transparent;
    text-decoration: none;
  }

  /* ▼ 現在地表示も同トーン（必要なら残す） */
  #header #gNav ul.sub-menu li.current-menu-item>a,
  #header #gNav ul.sub-menu li.current_page_item>a {
    color: #5D5857;
    background: transparent;
  }
}

/* 1280px 以上も同仕様。背景サイズはそのまま（元サイトと同じ幅感） */
@media screen and (min-width:1280px) {

  #header #gNav li:hover>ul.sub-menu,
  #header #gNav li:focus-within>ul.sub-menu {
    background-image: url('../img/2x/nav_bg@2x.png');
    background-position: top right;
    background-size: 844px auto;
    background-repeat: repeat-y;
    background-color: #fff;
  }
}

/* ===== サイドメニュー（サブメニュー）hoverの見た目だけ追加 ===== */
@media print,
screen and (min-width:1100px) {

  /* hover/focus時：背景画像はそのまま、うっすらオーバーレイだけ */
  #header #gNav ul.sub-menu li>a {
    transition: box-shadow .15s ease, color .15s ease;
  }

  #header #gNav ul.sub-menu li>a:hover,
  #header #gNav ul.sub-menu li>a:focus {
    color: #5D5857;
    /* 文字色は固定のまま */
    background: transparent;
    /* 背景パターンを消さない */
    box-shadow: inset 0 0 0 9999px rgba(0, 146, 216, .08);
    /* ほんのりブルーの透明オーバーレイ */
    text-decoration: none;
  }

  /* タップ端末での active も同じテイストに */
  #header #gNav ul.sub-menu li>a:active {
    box-shadow: inset 0 0 0 9999px rgba(0, 146, 216, .12);
  }
}

/* ===== サブメニューのチラつき抑制（位置固定＋opacityのみ遷移） ===== */
/* ===== ドロップダウンの位置ずれ修正 + チラつき抑制（opacityのみ遷移） ===== */

/* 1100–1279px */
@media print,
screen and (min-width:1100px) and (max-width:1279px) {
  #gNav .navigation_list>li {
    position: relative !important;
  }

  #gNav .sub-menu {
    left: 50%;
    top: 50px !important;
    /* ← 表示時の正しい基準位置に固定 */
    transform: translateX(-50%) translateZ(0);
    margin-top: 0 !important;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease !important;
    /* レイアウトは動かさない */
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    z-index: 9999;
  }

  #gNav li:hover>.sub-menu,
  #gNav li:focus-within>.sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* 1280px 以上 */
@media screen and (min-width:1280px) {
  #gNav .navigation_list>li {
    position: relative !important;
  }

  #gNav .sub-menu {
    left: 50%;
    top: 50px !important;
    /* ← こちらも 50px に統一 */
    transform: translateX(-50%) translateZ(0);
    margin-top: 0 !important;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .12s ease !important;
    will-change: opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    z-index: 9999;
  }

  #gNav li:hover>.sub-menu,
  #gNav li:focus-within>.sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* ===== 1100–1279px：ホバーが切れないように橋をかける ===== */
@media print,
screen and (min-width:1100px) and (max-width:1279px) {

  /* li 内をはみ出して使えるようにする */
  #gNav .navigation_list>li {
    position: relative !important;
    overflow: visible;
  }

  /* メイン項目とサブメニューの間(38px→50pxの12px)に透明の“橋” */
  #gNav .navigation_list>li::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 38px;
    /* メイン項目の下端 */
    height: 12px;
    /* サブメニュー top(50) - 38 = 12 */
    background: transparent;
    /* クリックを邪魔しない・でも :hover 判定は維持 */
    z-index: 1;
  }
}

/* 992–1099px ではハンバーガーを出す・デスクトップナビを消す */
/* === 1100px以下は“必ず”モバイルナビ、デスクトップナビは消す === */
/* 992–1100px：デスクトップナビを消し、ハンバーガーを“必ず”表示 */
@media screen and (min-width:992px) and (max-width:1100px) {

  /* デスクトップナビを消す */
  #gNav,
  #header .navigation,
  .l-header .navigation {
    display: none !important;
  }

  /* ハンバーガー関連を強制表示（G3 で使われる別名も拾う） */
  .vk-mobile-nav-btn,
  .vk-mobile-nav-menu-btn,
  .vk-mobile-nav,
  .vk-mobile-nav-cover {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* ボタンが重なり負け/画面外になるケースの保険 */
  .vk-mobile-nav-btn,
  .vk-mobile-nav-menu-btn {
    position: absolute;
    /* テーマの配置に依存するなら不要 */
    right: 16px;
    top: 22px;
    z-index: 100000 !important;
    pointer-events: auto !important;
  }
}

/* 念押し：1101px 以上はデスクトップ、1100px 以下はモバイル */
@media screen and (max-width:1100px) {

  #gNav,
  #header .navigation,
  .l-header .navigation {
    display: none !important;
  }

  .vk-mobile-nav-btn,
  .vk-mobile-nav-menu-btn,
  .vk-mobile-nav,
  .vk-mobile-nav-cover {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

@media screen and (min-width:1101px) {

  .vk-mobile-nav-btn,
  .vk-mobile-nav-menu-btn,
  .vk-mobile-nav,
  .vk-mobile-nav-cover {
    display: none !important;
  }

  #gNav,
  #header .navigation,
  .l-header .navigation {
    display: block !important;
  }
}