/* ==============================
  Header（ヘッダーまわり）
  - 位置・高さはブレークポイントで切替
  - PC: 120px / SP: 80px
============================== */
.header {
/*///追加	*/
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1030;
  background: #fff;
  isolation: isolate;box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.1);
/*///追加END	*/
  /*position: relative;*/ /* 子要素の絶対配置の基準にする */
  /*z-index: 200;*/ /* メガメニューより上（オーバーレイz=100） */
  /*background: #fff;*/
}
@media (min-width: 1001px) {
/*///追加	*/
  .wrapper{
    padding-top: 120px;
  }
/*///追加END	*/
  .header {
    height: 120px; /* PC高さ */
  }
}

@media (max-width: 1000px) {
/*///追加	*/
  .wrapper{
    padding-top: 80px;
  }
/*///追加END	*/
  .header {
    height: 80px; /* SP高さ */
  }
}
.header ol,ul {
  list-style: none;
}

.header a {
  color: inherit;
  text-decoration: none;
}

/* ロゴ：縦中央配置。左右位置・サイズはレスポンシブで調整 */
.header-logo {
  position: absolute;
  top: 50%;
  /*font-weight: 900;
  line-height: 1;*/
  transform: translateY(-50%);
}

@media (min-width: 1001px) {
  .header-logo {
    left: 50px;
    /*font-size: 40px;
    letter-spacing: 2px;*/
  }
}

@media (max-width: 1000px) {
  .header-logo {
    left: 20px;
    /*font-size: 25px;
    letter-spacing: 1px;*/
  }
}

.header-logo a {
  display: inline-block;
  /*color: #192753;*/
  text-decoration: none;
  vertical-align: top;
}


/*サブメニューのスタイル*/
.sub-nav {
	font-size: 0.85rem;
}
.sub-nav li {
	margin-left:0.5rem;
	margin-right:0.5rem;
	font-weight: 700;
}
.sub-nav ul {
	display: flex;
	justify-content: flex-end;
}
.sp-sub-nav {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #eee;
}
.sp-globalBtn {
	align-items: center;
	display: block;
	 width: 100%;
	margin-top: 2rem;;
	/*padding-top: 1rem 20px;*/
	text-align: center;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.5;
}
.sp-globalBtn a {
	padding: 1.5rem;
}
@media (min-width: 1001px) {
	.sp-sub-nav,.sp-globalBtn {
		display: none;
	}
}


/* ハンバーガー：SPのみ表示。アイコンはspanで描画しopen時に変形 */
.header-hamburger {
  position: absolute;
  right: 8.5px;
  top: 50%;
  width: 45px;
  height: 45px;
  transform: translateY(-50%);
}

@media (min-width: 1001px) {
  .header-hamburger {
    display: none;
  }
}

.header-hamburger button {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  -webkit-appearance: none;
          appearance: none;
  cursor: pointer;
}

/* 3本ライン */
.header-hamburger button > span {
  display: block;
  position: absolute;
  left: 11.5px;
  top: 22px;
  width: 22px;
  height: 1px;
  background: #4466ce;
}

/* 上・中・下のバーに変形トランジションを付与 */
.header-hamburger button > span:nth-child(1) {
  transform: translateY(-6px);
  transition: transform 350ms cubic-bezier(.215, .61, .355, 1);
}

.header-hamburger button > span:nth-child(2) {
  transition: opacity 350ms cubic-bezier(.215, .61, .355, 1);
}

.header-hamburger button > span:nth-child(3) {
  transform: translateY(6px);
  transition: transform 350ms cubic-bezier(.215, .61, .355, 1);
}

/* 開いた状態（×アイコン化） */
.header-hamburger button.is-open > span:nth-child(1) {
  transform: rotate(45deg) translateY(0px);
}

.header-hamburger button.is-open > span:nth-child(2) {
  opacity: 0;
}

.header-hamburger button.is-open > span:nth-child(3) {
  transform: rotate(-45deg) translateY(0px);
}

/* グローバルナビ：PCのみ表示。縦中央に配置 */
.header-nav {
  position: absolute;
  right: 25px;
  top: 50%;
  /*transform: translateY(-50%);*/
  transform: translateY(calc(-50% + 5px));
}

@media (max-width: 1000px) {
  .header-nav {
    display: none;
  }
}

.header-nav ul {
  list-style: none;
  display: flex;
}

/* ナビ項目：下線アニメ（:before）でアクティブを演出 */
.header-nav ul li button,
.header-nav > ul > li > a {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  box-sizing: border-box;
  padding: 18px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
          appearance: none;
  transition: color 300ms;
}

.header-nav ul li button::before,
.header-nav > ul > li > a::before {
  content: '';
  display: block;
  position: absolute;
  left: 25px;
  bottom: 8px;
  width: calc(100% - 50px);
  height: 1px;
  background: #4466ce;
  transform: scaleX(0);
  transition: transform 350ms cubic-bezier(.215, .61, .355, 1);
}

.header-nav ul li button:hover::before,
.header-nav ul li button:active::before,
.header-nav ul li button.is-active::before,
.header-nav > ul > li > a:hover::before,
.header-nav > ul > li > a:active::before {
  transform: scaleX(1);
}

/* 右端の「お問い合わせ」：PCのみ */
/*.header-contact {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 1000px) {
  .header-contact {
    display: none;
  }
}

.header-contact a {
  display: block;
  width: 150px;
  padding: 10px 0;
  border-radius: 5px;
  background: #4466ce;
  color: #fff;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition: background-color 300ms;
}


.header-contact a:hover {
  background: #192753;
}*/

/* ==============================
  Mega Menu（メガメニュー）
  - .mega.is-open でオーバーレイ／本体を表示
  - PC: ヘッダー直下に重ねる
  - SP: パディングを広めに
============================== */

/* 背景オーバーレイ（ぼかし＋半透明）。
   非表示時は visibility/opacity/pointer-events で無効化 */
.mega-overlay {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 0ms 400ms, opacity 400ms linear;
}
@media (min-width:1001px){
  .mega-overlay{
    top: 120px;
    height: calc(100vh - 120px);
  }
}

@media (max-width:1000px){
  .mega-overlay{
    top: 80px;
    height: calc(100vh - 80px);
  }
}
/* メガメニュー本体コンテナ。高さアニメはJSで付与 */
.mega-container {
  /*position: absolute;
  left: 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: visibility 0ms 400ms, opacity 400ms linear;*/
  position: fixed;
  left: 0;
  z-index: 100;
  width: 100%;
  box-sizing: border-box;
  background: #fff;

  /*overflow-y: auto;*/
  overflow-y: hidden;
  overflow-x: hidden;

  visibility: hidden;
  opacity: 0;
  pointer-events: none;

  transition: visibility 0ms 400ms, opacity 400ms linear;
}

/* PCはヘッダー高に合わせる */
@media (min-width: 1001px) {
  .mega-container {
    /*top: 120px;*/
	top: 120px;
    max-height: calc(100vh - 120px);
  }
}

@media (max-width: 1000px) {
  .mega-container {
    /*top: 80px;*/
	top: 80px;
    max-height: calc(100vh - 80px);
    padding: 0 20px 40px;
  }
}

/* セクション（各パネル）
   PCでは重ねて配置し、表示中だけ is-open で見せる */
@media (min-width: 1001px) {
  .mega-section {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0ms 400ms, opacity 400ms linear;
  }
}


/* SPではアコーディオンの見切れ線 */
@media (max-width: 1000px) {
  .mega-section {
    border-bottom: 1px solid #e1e1e1;
  }
}

/* 見出し（SPのみ表示、アコーディオンのトリガー） */
.mega-header {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

@media (min-width: 1001px) {
  .mega-header {
    display: none;
  }
}

.mega-header button,
.mega-header a {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  height: 65px;
  margin: 0;
  padding: 0 20px;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  -webkit-appearance: none;
          appearance: none;
  cursor: pointer;
}

/* 見出し右の＋（span疑似要素で線を描画） */
.mega-header button > span,
.mega-header a > span {
  display: block;
  position: absolute;
  right: 20px;
  top: 50%;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
}

.mega-header button > span::before,
.mega-header button > span::after,
.mega-header a > span::before,
.mega-header a > span::after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  top: 7px;
  width: 15px;
  height: 1px;
  background: #333;
}

.mega-header button > span::after,
.mega-header a > span::after {
  transform: rotate(90deg);
  transition: transform 350ms cubic-bezier(.215, .61, .355, 1);
}

/* 本文領域（PCは常に表示、SPは閉じておく） */
.mega-body {
  position: relative;
}

@media (min-width: 1001px) {
  .mega-body {
    display: block !important;
  }
}

@media (max-width: 1000px) {
  .mega-body {
    display: none;
    overflow: hidden;
  }
}

/* 内側余白：PCは左右パディング広め、SPは下マージンのみ */
@media (min-width: 1001px) {
  .mega-inner {
    padding: 20px 50px 40px;
  }
}

@media (max-width: 1000px) {
  .mega-inner {
    padding-bottom: 25px;
  }
}

@media (min-width: 1001px) {
  .mega-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
  }
}

.mega-thumb {
  position: relative;
  aspect-ratio: 1.4;
  border-radius: 5px;
  overflow: hidden;
}

@media (max-width: 1000px) {
  .mega-thumb {
    display: none;
  }
}

.mega-thumb > img {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms cubic-bezier(.215, .61, .355, 1);
}

@media (min-width: 1001px) {
  .mega-text {
    margin-top: 15px;
    font-size: clamp(14px, calc(14px + (18 - 14) * ((100vw - 1215px) / (1615 - 1215))), 18px);
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
  }
}

@media (max-width: 1000px) {
  .mega-text {
    font-size: 15px;
    line-height: 1.5;
  }
}

@media (min-width: 1001px) {
  .mega-text > span {
    display: inline-block;
    position: relative;
    padding-right: 15px;
    vertical-align: top;
  }
}

@media (min-width: 1001px) {
  .mega-text > span::before {
    content: '';
    display: block;
    position: absolute;
    right: 0;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -3px;
    box-sizing: border-box;
    border-top: 2px solid #4466ce;
    border-right: 2px solid #4466ce;
    transform: rotate(45deg);
  }
}

@media (min-width: 1001px) {
  .mega-list > li {
    width: calc((100% - 120px) / 5);
  }
}

.mega-list > li > a {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: color 350ms cubic-bezier(.215, .61, .355, 1);
}

@media (max-width: 1000px) {
  .mega-list > li > a {
    padding: 0 20px;
  }
}

@media (min-width: 1001px) {
  .mega-list > li > a:hover,
  .mega-list > li > a:active {
    color: #4666ce;
  }

  .mega-list > li > a:hover .mega-thumb > img,
  .mega-list > li > a:active .mega-thumb > img {
    transform: scale(1.1);
  }
}

@media (max-width: 1000px) {
  .mega-list > li:nth-child(n+2) {
    margin-top: 15px;
  }
}

/* SP: 先頭セクションの上線（見切れ調整） */
@media (max-width: 1000px) {
  .mega-section:first-child {
    border-top: 1px solid #e1e1e1;
  }
}

/* 表示中のセクション。PCで前面に出し、フェードを有効化 */
.mega-section.is-open {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  visibility: visible;
  opacity: 1;
  transition: visibility 0ms, opacity 400ms linear;
}

/* アコーディオン展開時は＋を−に変形 */
.mega-section.is-expanded .mega-header button > span::after {
  transform: rotate(0deg);
}

/* メガメニュー表示状態：オーバーレイ／本体の表示をまとめてON */
.mega.is-open .mega-overlay,
.mega.is-open .mega-container {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: visibility 0ms, opacity 400ms linear;
}
/*@media (min-width:1001px){

  .mega-container{
    max-height: calc(100vh - 120px);
  }

}

@media (max-width:1000px){

  .mega-container{
    max-height: calc(100vh - 80px);
  }

}*/

/*---------------------------------------

-- スクロール時のヘッダー変化

----------------------------------------*/
@media (min-width: 1001px) {

  /* ヘッダーを滑らかに縮める */
  .header {
    transition: height 0.35s ease;
  }

  /* ナビ位置も滑らかに移動 */
  .header-nav {
    transition: top 0.35s ease, transform 0.35s ease;
  }

  /* サブナビ */
  .sub-nav {
    max-height: 35px;
    opacity: 1;
    overflow: hidden;
    transform: translateY(0);
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      transform 0.35s ease;
  }

  /* スクロールした状態 */
  .header.is-scroll {
    height: 85px;
  }

  /* サブナビを上方向へ隠す */
  .header.is-scroll .sub-nav {
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
  }

  /* メインナビを縮んだヘッダーの中央へ */
  .header.is-scroll .header-nav {
    top: 50%;
  }
}

/* ---------------------------------------

 --  固定ヘッダー縮小 + メガメニュー位置連動

--------------------------------------- */

:root {
  --header-height: 120px;
  --header-height-scroll: 95px;
}


/* PCのみ */
@media (min-width: 1001px) {

  /* 通常時ヘッダー */
  .header {
    height: var(--header-height);
    transition: height 0.35s ease;
  }

  /* ナビ位置 */
  .header-nav {
    transition:
      top 0.35s ease,
      transform 0.35s ease;
  }

  /* サブナビ */
  .sub-nav {
    max-height: 35px;
    opacity: 1;
    overflow: hidden;
    transform: translateY(0);

    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      transform 0.35s ease;
  }


  /* -----------------------------
     スクロール時
-------------------------------- */

  .header.is-scroll {
    height: var(--header-height-scroll);
  }

  /* サブナビを上へ隠す */
  .header.is-scroll .sub-nav {
    max-height: 0;
    opacity: 0;
    transform: translateY(-20px);
  }

  /* メインナビを縮小後の中央へ */
  .header.is-scroll .header-nav {
    top: 50%;
  }


  /* -----------------------------
     メガメニュー通常時
  ----------------------------- */

  .mega-container {
    top: var(--header-height);
    max-height: calc(100vh - var(--header-height));

    transition:
      top 0.35s ease,
      max-height 0.35s ease;
  }

  .mega-overlay {
    top: var(--header-height);
    height: calc(100vh - var(--header-height));

    transition:
      top 0.35s ease,
      height 0.35s ease,
      visibility 0ms 400ms,
      opacity 400ms linear;
  }


  /* -----------------------------
     ヘッダー縮小時のメガメニュー
  ----------------------------- */

  .header.is-scroll ~ .mega .mega-container {
    top: var(--header-height-scroll);
    max-height: calc(100vh - var(--header-height-scroll));
  }

  .header.is-scroll ~ .mega .mega-overlay {
    top: var(--header-height-scroll);
    height: calc(100vh - var(--header-height-scroll));
  }

}