/*
 * メガメニュー for SWELL
 * ----------------------------------------------- */

/* 共通コンテナスタイル */
.megamenu-content {
  opacity: 0;
  background: #fff;
  pointer-events: none;
  height: auto;
  position: absolute;
  top: 100%;
  /* ヘッダーの真下に配置 */
  z-index: 500;
  left: 0;
  right: 0;
  width: auto;
  padding: 0px 30px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0s;
  box-shadow: 0 5px 5px 0 rgba(0, 0, 0, 0.07);
  display: none;
}

/* メガメニューを持つli要素のpositionをstaticに上書きし、重要
   position:absoluteなメガメニューがページ幅全体に広がれるようにする */
.menu-item-has-megamenu {
  position: static !important;
}

/* SWELLのメニューliにホバーした際にメガメニューを表示 */
.menu-item-has-megamenu:hover > .megamenu-content {
  display: block;
  opacity: 1;
  pointer-events: initial;
}

/* メガメニューのインナーラップ */
.megamenu-inner {
  width: 1150px;
  /* SOLARISの幅に合わせる */
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  display: flex;
  /* ヘッドラインとスライダーを横並びにする */
  padding: 40px 0;
}

/* 共通ヘッドラインエリア */
.headline_area {
  width: 220px;
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  /* 幅を維持する */
}

.headline_area .head {
  line-height: 1.5;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.headline_area .head a {
  display: block;
  padding-right: 50px;
  position: relative;
  color: #000;
}

.headline_area .head a:hover {
  text-decoration: none;
  opacity: 0.8;
}

.headline_area .head .headline {
  font-size: 28px;
  color: #006ea5;
  margin: 5px 0 0 0;
  font-weight: 600;
}

.headline_area .head .sub_headline {
  font-weight: 500;
  color: #000;
  display: block;
}

/*
 * メガメニューA: 記事グリッド
 * ----------------------------------------------- */
.megamenu-content-a .slider_area {
  width: calc(100% - 220px);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  padding: 0 42px;
  /* 矢印のスペース確保 */
}

/* スライダーコンテナ */
.megamenu-content-a .megamenu-a-slider {
  overflow: hidden;
}

.megamenu-content-a .item {
  position: relative;
  box-sizing: border-box;
}

.megamenu-content-a .item .category {
  font-size: 12px;
  text-align: center;
  color: #fff;
  border-radius: 30px;
  margin: 0 0 20px 0;
  min-width: 90px;
  height: 30px;
  line-height: 30px;
  padding: 0 20px;
  display: inline-block;
  background: #00b4a2;
  /* SWELLのキーカラーに近い色 */
  text-decoration: none;
}

.megamenu-content-a .item .link {
  display: block;
  color: #000;
  text-decoration: none;
}

.megamenu-content-a .item .image_wrap {
  display: block;
  width: 100%;
  height: 160px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-bottom: 20px;
}

.megamenu-content-a .item .image {
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.megamenu-content-a .item a:hover .image {
  transform: scale(1.1);
}

.megamenu-content-a .item .title_area {
  padding: 0;
}

.megamenu-content-a .item .title {
  line-height: 1.5;
  height: 4.5em;
  /* 3行分の高さを確保 */
  overflow: hidden;
  color: #000;
  font-weight: 600;
}

.megamenu-content-a .item .title span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  /* 3行で省略 */
  overflow: hidden;
}

/* スライダー矢印 */
.carousel_arrow {
  width: 30px;
  height: 100%;
  position: absolute;
  top: 0;
  cursor: pointer;
  z-index: 10;
}

.carousel_arrow:before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-top: 3px solid #000;
  border-right: 3px solid #000;
  position: absolute;
  top: 50%;
  left: 50%;
  transition: border-color 0.2s ease;
}

.carousel_arrow:hover:before {
  border-color: #00b4a2;
}

.carousel_arrow.prev_item {
  left: 0;
}

.carousel_arrow.next_item {
  right: 0;
}

.carousel_arrow.prev_item:before {
  transform: translate(-50%, -50%) rotate(-135deg);
}

.carousel_arrow.next_item:before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.carousel_arrow.swiper-button-disabled {
  opacity: 0.3;
  cursor: default;
}

/*
 * メガメニューB: 背景ホバー切り替え
 * ----------------------------------------------- */

.megamenu-content-b {
  padding: 0;
  /* paddingは内部で調整 */
  background: transparent;
  /* 背景は内部のimageで管理 */
}

.megamenu-content-b .megamenu-inner {
  width: 100%;
  display: flex;
  justify-content: space-between;
  height: 390px;
  /* SOLARISの高さに固定 */
}

/* 背景画像リスト */
.megamenu-b-image-list {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.megamenu-b-image-list .image {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: all 0.5s ease;
  transform: scale(1.1);
  background-size: cover;
  background-position: center;
}

.megamenu-b-image-list .image.active {
  opacity: 1;
  transform: scale(1);
}

.megamenu-b-image-list .image .overlay {
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  /* オーバーレイ */
}

/* テキストコンテンツリスト */
.megamenu-b-list-container {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  /* 画像より手前に表示 */
}

.megamenu-b-list {
  width: 100%;
  height: 100%;
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}

.megamenu-b-item {
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
  flex: 1 1 0%;
  box-sizing: border-box;
  position: relative;
}
/* 動的クラスによる幅調整 */
/* 1個表示 */
.megamenu-b-list.megamenu-b-item-count-1 .megamenu-b-item {
  flex: 1 1 100% !important;
}
/* 2個表示 */
.megamenu-b-list.megamenu-b-item-count-2 .megamenu-b-item {
  flex: 1 1 50%!important;
}
/* 3個表示 */
.megamenu-b-list.megamenu-b-item-count-3 .megamenu-b-item {
  flex: 1 1 33.333% !important;
}
/* 4個表示 */
.megamenu-b-list.megamenu-b-item-count-4 .megamenu-b-item {
  flex: 1 1 25% !important;
}
/* 5個表示 */
.megamenu-b-list.megamenu-b-item-count-5 .megamenu-b-item {
  flex: 1 1 20% !important;
}

.megamenu-b-item:last-of-type {
  border-right: none;
}

.megamenu-b-item a {
  color: #fff !important;
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  box-sizing: border-box;
}

/* ホバー時の黒いレイヤー */
.megamenu-b-item a:after {
  width: 100%;
  height: 100%;
  content: "";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.megamenu-b-item.active a:after,
.megamenu-b-item a:hover:after {
  opacity: 1;
}

.megamenu-b-item .content {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0 30px 30px;
  z-index: 4;
  /* a:afterよりも手前 */
}

.megamenu-b-item .title {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 600;
  word-break: break-all;
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  color: #fff;
}

.megamenu-b-item.active .title,
.megamenu-b-item:hover .title {
  margin-bottom: 20px;
}

.megamenu-b-item .sub_title {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 0 0;
  line-height: 1.5;
  position: relative;
  display: inline-block;
  padding-right: 20px;
  color: #fff;
}

.megamenu-b-item .sub_title:after {
  opacity: 0;
  font-family: "design_plus";
  /* アイコンフォントの指定が必要 */
  content: "\e910";
  font-size: 14px;
  display: block;
  position: absolute;
  top: 2px;
  right: 0px;
  font-weight: 500;
  transition: all 0.4s ease;
}

.megamenu-b-item.active .sub_title:after,
.megamenu-b-item:hover .sub_title:after {
  width: 100%;
  transition: width 0.4s ease 0s;
}

/* レスポンシブ対応 */
@media screen and (min-width: 960px) {
  /* PC表示時のスタイル */
  .megamenu-for-mobile {
    display: none;
    /* モバイル用リストは非表示 */
  }
}

@media screen and (max-width: 959px) {
  /* モバイル表示時（SWELLのハンバーガーメニュー内）のスタイル */
  .megamenu-content,
  .megamenu-for-pc {
    display: none !important;
    /* PC用メガメニューは完全に非表示 */
  }

  .megamenu-for-mobile {
    display: block;
    /* モバイル用リストを表示（SWELLのサブメニュースタイルが適用される） */
  }
}

/* メガメニューC (ここから下を書き換え)
---------------------------------------------------------- */
.megamenu-content-c .megamenu-inner {
  width: 1150px;
  max-width: 100%;
  display: flex;
  padding: 2em;
  margin: 0 auto;
  align-items: center;
}

.megamenu-c-grid-area {
  width: calc(100% - 220px);
  padding-left: 20px;
  box-sizing: border-box;
}

.megamenu-c-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.megamenu-c-item a {
  display: block;
  text-decoration: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  border-radius: 5px;
}

.megamenu-c-item__image {
  position: relative;
  display: block;
  width: 100%;
  height: 0;
  padding-top: 60%;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.megamenu-c-item a:hover .megamenu-c-item__image {
  transform: scale(1.1);
}

.megamenu-c-item__title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.5em 0;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.6));
  transition: background-color 0.3s;
  box-sizing: border-box;
}

.megamenu-c-item a:hover .megamenu-c-item__title {
  background-color: rgba(0, 0, 0, 0.5);
}

/* レスポンシブ (タブレット) */
@media screen and (max-width: 1024px) {
  .megamenu-c-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media screen and (max-width: 767px) {
  .megamenu-c-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .megamenu-content-c .megamenu-inner {
    padding: 1em;
  }

  .megamenu-c-list {
    gap: 10px;
  }

  .megamenu-c-item__title {
    font-size: 12px;
    padding: 0.6em;
  }
}

@media screen and (max-width: 959px) {
  .megamenu-content {
    /* display: none !important; */
    /* タイプCはSPでも表示するため個別対応 */
  }

  .megamenu-content-a,
  .megamenu-content-b {
    display: none !important;
  }

  .megamenu-content-c .megamenu-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .megamenu-content-c .headline_area {
    width: 100%;
    margin-bottom: 2em;
  }

  .megamenu-content-c .headline_area .head {
    position: static;
    transform: none;
  }

  .megamenu-content-c .headline_area .head a {
    padding-right: 0;
  }

  .megamenu-c-grid-area {
    width: 100%;
    padding-left: 0;
  }

  .megamenu-c-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 599px) {
  .megamenu-c-list {
    grid-template-columns: repeat(1, 1fr);
  }
}
