/* カスタムCSS：タイムラインの線と配置を調整します */
.timeline {
  position: relative;
  padding: 20px 0;
}

/* 各イベントアイテムのコンテナ */
.timeline-item {
  display: flex; /* デスクトップでは横並びを維持 */
  /* padding-top: 30px;
  padding-bottom: 30px; */
  position: relative;
}

/* 日付/時刻のエリア（左側） - デスクトップのデフォルト設定 */
.timeline-icon {
  width: 150px;
  flex-shrink: 0;
  text-align: center;
  position: relative;
  z-index: 2;
}

/* 丸型のアイコン（文字入り） */
.timeline-image img {
  margin: 0 auto;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  z-index: 3;
}

/* 丸の下に表示する追加のテキストのスタイル */
.timeline-icon-caption {
  display: block;
  font-size: 1em;
  margin-top: 0.5em;
  margin-bottom: 1.5em;
  font-weight: bold;
  line-height: 1.2;
  background-color: #ffffff;
}

/* コンテンツのエリア（右側） */
.timeline-content {
  flex-grow: 1;
  padding-left: 25px;
  padding-right: 15px;
  /* 横線のため、position: relative; を追加 */
  position: relative;
  margin-bottom: 60px !important;
}

/* カード（事柄のブロック） */
.timeline-card {
  background-color: #fff;
  /* color: ; */
  padding: 1em 1em 0 1em;
  border-radius: 0.375rem;
  border: #dcdddd 2px solid;
  height: -webkit-fit-content;
  height: -moz-fit-content;
  height: fit-content;
}

.timeline-card h4,
.timeline-card h3 {
  /* color: #fff; */
  margin-top: 0 !important;
  padding-top: 0 !important;
  border: none !important;
  /* margin-bottom: 10px; */
}

.timeline-card p {
  margin-bottom: 0;
  font-size: 0.9em;
  line-height: 1.5;
}

/* 線の途切れの調整 (デスクトップ) */
.timeline-item:first-child::before {
  /* 丸アイコンの上端 (padding-top: 30px + (アイコン高さ100px / 2)) を始点にする */
  top: calc(100px / 2);
}

.timeline-item:last-child::before {
  /* 最後のアイテムの線がアイコンの中心で終わるように調整 */
  bottom: calc(100px / 2);
}

/* 💡 コンテンツの枠へ向かう横線を追加 */
.timeline-content::before {
  content: "";
  position: absolute;
  /* topの位置はカードの上枠に合わせる (カードのpadding: 20px) */
  top: calc(0px + 50px);

  /* 横線の始点を縦線に合わせるため、
     縦線位置(75px)から、.timeline-contentのpadding-left(25px)の分だけ左へ移動 */
  left: calc(-60px); /* 縦線(2px)の右端から始めるため、-75px + 2px で調整 */

  /*
    幅の計算:
    縦線の中央から.timeline-contentの左端までの距離 (75px) - 縦線の太さ(2px/2) + 枠線(2px/2)
    今回はシンプルに、.timeline-contentのpadding-left(25px) + .timeline-iconの右側(150-75=75px) - 縦線の幅(2px/2) の約100pxを調整
    
    縦線の右端(75px + 1px) から .timeline-contentの左端(150px) までの距離 = 74px
    - 縦線からコンテンツのパディング開始位置までの距離は、150px - 75px = 75px。
    - 縦線と横線の接合点(縦線の右端)からコンテンツの左端までの距離が必要です。
    - 縦線の右端は75px + 2px/2 = 76px の位置。
    - コンテンツの左端は150pxの位置。
    - 横線の長さは 150px - 76px = 74px
  */
  width: 85px;

  height: 2px;
  background-color: #dcdddd;
  z-index: 1;
}

/* 縦線（::before擬似要素を使用） - デスクトップ表示時のみ有効 */
.timeline-item::before {
  content: "";
  position: absolute;
  top: 50px;
  bottom: -50px;
  left: 75px; /* 左エリア (150px) の中央に線を引く */
  transform: translateX(-50%); /* 中央配置 */
  width: 8px;
  background-color: #dcdddd;
  /* background-image: linear-gradient(0deg, #cccccc, #00a73c); */

  z-index: 1;
}

.timeline-item:nth-child(2)::before {
  background-color: #bdd5c6;
}
.timeline-item:nth-child(3)::before {
  background-color: #92c1a3;
}
.timeline-item:nth-child(4)::before {
  background-color: #9dceaf;
}
.timeline-item:nth-child(5)::before {
  background-color: #7ec698;
}
.timeline-item:nth-child(6)::before {
  background-color: #5ebe81;
}
.timeline-item:nth-child(7)::before {
  background-color: #3fb66a;
}
.timeline-item:nth-child(8)::before {
  background-color: #1faf53;
}
.timeline-item:nth-child(9)::before {
  background-color: #ffffff;
}

/* .timeline-content の padding-left: 25px; はそのままです */

/* ==================================================== */
/* レスポンシブ対応のためのメディアクエリ (モバイル表示) */
/* ==================================================== */

@media (max-width: 640px) {
  /* 1. 横並びを解除し、縦積みにする */
  .timeline-item {
    flex-direction: column;
    /* padding-top: 15px;
    padding-bottom: 15px; */
    margin-bottom: 20px; /* アイテム間にマージンを設定 */
  }

  /* 2. 縦線を完全に非表示にする */
  .timeline-item::before {
    display: none;
  }
  .timeline-item:first-child::before,
  .timeline-item:last-child::before {
    display: none;
  }

  .timeline-item:nth-child(2) .timeline-icon {
    display: none;
  }

  .timeline-content {
    margin-bottom: 30px !important;
  }

  /* 💡 モバイル表示では横線も非表示にする */
  .timeline-content::before {
    display: none;
  }

  /* 3. 丸とキャプションをコンテンツの前に表示し、幅を100%にする */
  .timeline-icon {
    width: 100%;
    margin-bottom: 10px; /* キャプションとコンテンツの間隔 */
    text-align: left; /* 左寄せに変更 */
  }

  /* 丸とキャプションを中央ではなく左に寄せる（左寄せの指定を上書き） */
  .timeline-image {
    margin: 0 10px 0 0; /* 右にスペース */
    display: inline-flex; /* キャプションと同じ行に並べるため */
  }

  .timeline-icon-caption {
    display: inline; /* 丸と横並びにするため */
    vertical-align: top;
    line-height: 100px; /* 丸の高さに合わせてキャプションのテキスト位置を調整 */
    background-color: transparent; /* モバイルでは背景色を透明に */
  }

  /* 丸とキャプションを横並びに配置するために、ラッパーを用意 (HTML側で追加) */
  .timeline-icon-wrapper {
    display: flex;
    align-items: flex-start; /* 丸とキャプションの配置を上端に揃える */
    margin-bottom: 10px;
  }

  /* 4. コンテンツ側のパディングを調整 */
  .timeline-content {
    /* padding-left: 0;
    padding-right: 0; */
  }
}

.sign__arrow {
  display: inline-block;
  width: 0;
  height: 0;
  /* PC: 右向き三角 */
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  border-left: 32px solid #d0b685; /* 三角の色はお好みで */
  vertical-align: middle;
}

@media (max-width: 640px) {
  .sign__arrow {
    /* スマホ: 下向き三角 */
    border-top: 32px solid #d0b685; /* 三角の色はお好みで */
    border-right: 20px solid transparent;
    border-left: 20px solid transparent;
    border-bottom: none; /* 下のボーダーは不要、またはtransparentでもOK */
  }
}

.kintaro.qrcode__wrapper {
  text-align: left;
  justify-content: start;
  padding-right: 0;
  /* width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content; */
}
.kintaro.qrcode__wrapper img {
  position: initial;
  transform: none;
  width: 150px !important;
}
