:root {
  /* 固定ヘッダー */
  --header-height: 80px;

  /* 見出し
  --feature-heading-height: 220px; */
  --feature-heading-height: 80px;

  /*
    左画像エリアと右カードの共通の高さ
 
  --feature-item-height: 50vh; */
  --feature-item-height: 75vh;

  /* sticky位置 */
  --feature-sticky-top: calc(var(--header-height) + var(--feature-heading-height));
}

/* =========================
   section
========================= */

.feature-section {
  position: relative;
  width: 100%;
}

/* =========================
   見出し
========================= */

.feature-heading {
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  display: flex;
  align-items: center;
  height: var(--feature-heading-height);
  margin: 0;
  background: #fff;
}

.feature-number {
  display: grid;
  grid-template-columns: repeat(7, minmax(0px, 1fr));
  gap: 0.25rem;
  width: fit-content;
  transition: all 0.2s;
}

.feature-number span.num {
  font-weight: 700;
  text-align: center;
  color: #fff;
  transition: background-color 0.2s ease;
}

.feature-number span.num:nth-child(odd) {
  background-color: rgba(165, 180, 252, 1); /*bg-indigo-300*/
}
.feature-number span.num:nth-child(odd):hover {
  background-color: rgba(165, 180, 252, 0.5);
}

.feature-number span.num:nth-child(even) {
  background-color: rgba(147, 197, 253, 1); /*bg-blue-300*/
}
.feature-number span.num:nth-child(even):hover {
  background-color: rgba(147, 197, 253, 0.5);
}

/* =========================
   左右レイアウト
========================= */

.feature-layout {
  position: relative;
  display: grid;

  grid-template-columns: /* 画像側 : カード側 = 2 : 3 */
    minmax(0, 2fr)
    minmax(0, 3fr);

  /*gap: clamp(32px, 5vw, 80px);*/

  align-items: start;
  width: 100%;
}

/* =========================
   左側
========================= */

.feature-visual {
  position: sticky;

  top: var(--feature-sticky-top); /* sticky位置 */
  height: var(--feature-item-height); /* カードと同じ高さ */

  /*画像を領域中央へ*/
  display: flex;
  align-items: center;
  justify-content: center;

  align-self: start;
  width: 100%;
}

/* =========================
   画像コンテナ
========================= */

.feature-images {
  position: relative;
  width: 100%; /* 左カラムいっぱいの横幅 */
  aspect-ratio: 16 / 9; /* 画像自体は16:9 */
  max-width: calc(var(--feature-item-height) * 16 / 9);
  max-height: 100%; /* 万が一、高さが足りない画面でもfeature-visualからはみ出さない */
  margin-inline: auto;
  overflow: hidden;
}

/* =========================
   クロスフェード画像
========================= */

.feature-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;

  /*transform: scale(1.035);*/
  transform: scale(1);

  will-change: opacity, transform;
  pointer-events: none;
}

.feature-image:first-child {
  opacity: 1;
}

/* =========================
   右側カード
========================= */

.feature-list {
  position: relative;
  width: 100%;
  min-width: 0;
}

.feature-card {
  position: relative;
  height: var(--feature-item-height); /* 左側のvisualと完全に同じ高さ */
  display: flex;
  flex-direction: column;
  align-content: flex-start;
  justify-content: center;
}

/* =========================
   カードの内容
=========================*/

.feature-card-content {
  width: 100%;
  margin: 0;
  opacity: 0.25;
  transform: translateY(24px);
  will-change: opacity, transform;
}

.feature-card-content p.story_number {
  font-weight: 700;
  color: #fff;
  padding-left: 8px;
  padding-right: 8px;
  width: fit-content;
}

.feature-card-content:nth-child(odd) p.story_number {
  background-color: rgba(99, 102, 241, 0.5); /*bg-indigo-500/50*/
}

.feature-card-content:nth-child(even) p.story_number {
  background-color: rgba(59, 130, 246, 0.5); /*bg-blue-500/50*/
}

.feature-card-content h4 {
  font-weight: 700;
  width: fit-content;
  color: #25348e;
  display: flex;
  align-items: center;
  line-height: 1;
  filter: drop-shadow(1px 1px 0 rgba(255, 255, 255, 1));
}

.feature-card-content h4 span.ai {
  font-size: 150%;
  line-height: 1;
  transform: translateY(0.1rem);

  background: linear-gradient(180deg, #25348e 0%, #3f5bd9 40%, #a1c4fd 100%);
  -webkit-background-clip: text;
  /*safari・Chrome対応*/
  background-clip: text;
  color: transparent;
}

.feature-card-content p.copy {
  font-weight: 500;
  color: #25348e;
  filter: drop-shadow(1px 1px 0 rgba(255, 255, 255, 1));
}

/* =========================
   PC：背景・区切り線
========================= */

.feature-card {
  position: relative;
  border: 0; /* 元のborderを使用しない場合 */
  background: transparent; /* 背景自体は疑似要素で作る */
}

/* 背景レイヤーを画像側まで200%伸ばす（ただし画像より後ろに）*/

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -66.6667%;
  width: 166.6667%;
  z-index: -1;
  pointer-events: none;
}

.feature-card:nth-child(odd)::before {
  background-image: linear-gradient(120deg, #a6c0fe 0%, #dce3f9 100%);
}

.feature-card:nth-child(even)::before {
  background-image: linear-gradient(120deg, #accbee 0%, #e7f0fd 100%);
}

/*上下の罫線だけを画像より前面に表示*/
.feature-card::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100%;
  width: 200%;
  background:
    linear-gradient(#fff, #fff) top / 100% 8px no-repeat,
    linear-gradient(#fff, #fff) bottom / 100% 8px no-repeat;
  z-index: 10;
  pointer-events: none;
}

/*カードの内容*/

.feature-card-content {
  position: relative;
  z-index: 2;
}

/*画像は背景色より上へ*/
.feature-visual {
  z-index: 1;
}

.feature-image {
  z-index: 1;
}

/* =========================
   SP
========================= */

@media (max-width: 1279px) {
  :root {
    /* 固定ヘッダー */
    --header-height: 64px;

    /* 見出し
    --feature-heading-height: 210px; */
    --feature-heading-height: 72px;

    /*
      カード1枚あたりのスクロール距離
    */
    --feature-card-height: 25vh;

    /*
      見出し直下に画像を固定
    */
    --feature-sticky-top: calc(var(--header-height) + var(--feature-heading-height));

    /*
      SP変更:
      JSから実際の16:9画像高さを設定
    */
    --feature-sp-image-height: 56.25vw;
  }

  /* =========================
     見出し
  ========================= */

  .feature-heading {
    position: sticky;
    top: var(--header-height);
    z-index: 30;
    height: var(--feature-heading-height);
  }

  /* =========================
     PCの2カラムを解除
  ========================= */

  .feature-layout {
    position: relative;
    display: block;
    width: 100%;
    gap: 0;
  }

  /* =========================
     画像固定エリア
  ========================= */

  .feature-visual {
    position: sticky;
    top: var(--feature-sticky-top);
    z-index: 20;
    height: auto; /* PCの50vhを解除 */
    width: 100%;
    display: block;

    /* 
      SP変更:
      カードを画像の上に重ねるため白背景を解除 
    */
    background: transparent;
    border: 0;
  }

  /* =========================
     16:9画像
  ========================= */

  .feature-images {
    position: relative;
    width: 100%;
    max-width: none; /* SPではPC側のmax-widthを解除 */
    max-height: none; /* 高さ制限も解除 */
    aspect-ratio: 16 / 9;
    margin: 0;
    overflow: hidden;
  }

  .feature-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0;

    /*transform: scale(1.035);*/
    transform: scale(1);

    will-change: opacity, transform;
    pointer-events: none;

    /*max-width: 80vw;*/
    max-width: 560px;

    margin-left: auto;
    margin-right: 0;
    object-fit: contain;
    object-position: top;
  }

  .feature-image:first-child {
    opacity: 1;
  }

  /* =========================
     カード一覧
  ========================= */

  .feature-list {
    position: relative;

    /*
    SP変更:
    画像よりカードを前面へ
  */
    z-index: 21;

    width: 100%;

    /*
      SP変更:
      画像が通常フロー上で確保している高さを
      打ち消してカードを完全に重ねる
    */
    margin-top: calc(var(--feature-sp-image-height) * -1);
  }

  /* =========================
     カード
  ========================= */

  .feature-card {
    width: auto;
    margin-left: 0;
    padding-left: 0;

    position: relative;
    top: auto; /*stickyにはしない*/
    height: auto; /*PCのheightを解除*/

    /*
      SP変更:
      画像とカードを同じ高さにする
    */
    min-height: var(--feature-sp-image-height);

    display: flex;
    align-items: end;
    padding: 160px 0 32px 0;

    /*
      SP変更:
      背景を透過して画像と
      1枚のカードに見せる
    */
    /*background: rgba(255, 255, 255, 0.72); */
  }

  /* =========================
     カードの内容
  ========================= */

  .feature-card-content {
    position: relative;
    z-index: 1;
    margin: 0;
  }

  .feature-card::before {
    left: 0%;
    width: 100%;
  }

  .feature-card:nth-child(odd)::before {
    background: rgba(99, 102, 241, 0.1); /*indigo-500/10*/
  }

  .feature-card:nth-child(even)::before {
    background: rgba(59, 130, 246, 0.1); /*blue-500/10*/
  }

  .feature-card::after {
    left: 0%;
    width: 100%;
  }

  .feature-card-content h4 span.ai {
    line-height: 1;
    transform: translateY(0);
  }
}

/* =========================
   Reduced Motion
========================= */

@media (prefers-reduced-motion: reduce) {
  .feature-image,
  .feature-card-content {
    transform: none !important;
  }
}

/* =========================
   common parts
========================= */

.feature-card-content a.solution_bnr {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(59 130 246 / 0.5); /* blue-500 */
  /* rounded */
  border-radius: 0.25rem;
  /* h-24 */
  height: 6rem;
  /* bg-white */
  background-color: #fff;
  padding: 0 0.5rem;
}
.feature-card-content a.solution_bnr img {
  display: block;
  width: 80%;
  max-width: 320px;
  height: auto;

  transform: translateZ(0) scale(1);
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 0.2s ease;
}
.feature-card-content a.solution_bnr:hover img {
  transform: translateZ(0) scale(1.05);
}
