/* 基本スタイルのリセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
  padding: 1px;  /* 20px  */
}

/* コンテナスタイル */
.timeline-container {
  max-width: 1200px;  /* 800px */
  /* margin: 40px auto; */  
  padding: 0 1px;    /*  0 20px  */
}

h2 {
  text-align: center;
  margin-bottom: 40px;
  color: #2c3e50;
}

/* タイムラインの基本スタイル */
.timeline {
  position: relative;
  list-style: none;
  padding: 0;
}

/* 縦線 */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  /* left: 20px; */
  left: 50%; /* 中央に配置 */
  transform: translateX(-50%);
  width: 4px;
  background: #e0e0e0;
  z-index: 1;
}

/* タイムライン項目 */
.timeline-item {
  padding: 1px 20px;   /* 10px 40px */
  position: relative;
  width: 50%;
  /* margin-bottom: 30px; */
  z-index:2;
}

/* 左側項目 */
.timeline-item:nth-child(odd) {
  left: 0;
}

/* 右側項目 */
.timeline-item:nth-child(even) {
  left: 50%;
}

/* 最後のアイテムの下マージンを消す */
.timeline-item:last-child {
  margin-bottom: 0;
}

/* 丸印 */
.timeline-item::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background-color: white;
  border: 4px solid #2c3e50;   /* #2c3e50  */
  border-radius: 50%;
  top: 20px;
  z-index: 1;
}

/* 左側項目の丸印 */
.timeline-item:nth-child(odd)::after {
  right: -10px;
}

/* 右側項目の丸印 */
.timeline-item:nth-child(even)::after {
  left: -10px;
}

/* 日付表示 */
.timeline-date {
  background-color: #2c3e50;
  color: white;
  display: inline-block;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 5px;
}

/* コンテンツボックス */
.timeline-content {
  position: relative;
  /* padding: 20px; */   
  background: #FFFFEE;  /* #fff */
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* 吹き出し風の矢印 */
.timeline-content::before {
  content: "";
  position: absolute;
  top: 5px;    /*  20px  */
  width: 0;
  height: 0;
  border-style: solid;
}

/* 左側項目の矢印 */
.timeline-item:nth-child(odd) .timeline-content::before {
  right: -15px;
  border-width: 10px 0 10px 15px;
  border-color: transparent transparent transparent #FFFFEE;
}

/* 右側項目の矢印 */
.timeline-item:nth-child(even) .timeline-content::before {
  left: -15px;
  border-width: 10px 15px 10px 0;
  border-color: transparent #FFFFEE transparent transparent;
}


/* コンテンツ内の見出し */
.timeline-content h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #3498db;
}

/* コンテンツ内の段落 */
.timeline-content p {
   margin-right: -20px;
   margin-bottom: 1px; 
}

/* 文字色指定 */
.font_test {
    color: royalblue;     /* 文字色指定 */
}

/* 下線を引く */
.timeline-content a {
  text-decoration: underline;
}

/* コンテンツ内の最後の要素のマージンを消す */
.timeline-content *:last-child {
  margin-bottom: 0;
}

/* コンテンツ内の画像 */
.timeline-content img {
  max-width: 100%; 
  /* border-radius: 4px; */
  /* margin-top: -10px; */
  /* margin-left: 20px; */
  /* margin: 10px 0; */
  display: block;
  margin: auto;
  padding-bottom: 7px;
}

/*
/* フェードインアニメーションの定義 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 左からスライドインのアニメーション */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 右からスライドインのアニメーション */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* タイムライン項目にアニメーションを適用 */
.timeline-item {
  /* 他のスタイル */
  opacity: 0; /* 初期状態は非表示 */
}

/* 左側項目のアニメーション */
.timeline-item:nth-child(odd) {
  animation: slideInLeft 1.2s ease forwards 0.6s;        /*   0.6s   0.3s  */
}

/* 右側項目のアニメーション */
.timeline-item:nth-child(even) {
  animation: slideInRight 1.2s ease forwards 0.6s;       /*   0.6s   0.3s  */
}

/* 中央線のアニメーション */
@keyframes growLine {
  from {
    height: 0;
  }
  to {
    height: 100%;
  }
}

.timeline::after {
  content: '';
  position: absolute;
  width: 4px;
  background-color: #3498db;
  top: 0;
  bottom: 0;
  left:  50%;     /*  20px  */
  margin-left: -2px;
  animation: growLine 10s ease-out forwards;     /*   2s  */
  transform-origin: top center;
  z-index: 1;
}

/* 項目のホバー効果 */
.timeline-item .timeline-content {
  transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
  transform: scale(1.03);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 丸印のホバー効果 */
.timeline-item::after {
  transition: background-color 0.3s ease;
}

.timeline-item:hover::after {
  background-color: #3498db;
}