/* -------------------------------- 
Primary style
-------------------------------- */
/* フォントスムージング（現代ブラウザ対応） */
body {
  font-size: 100%;
  color: #333;
  background-color: #FFF6D2;
}
.entry-title {
  color: var(--tk-accent);
  font-size: 1.4rem;
  font-weight: 700;
  margin: .5em 0;
  padding: .5em .5em .5em 1.2em; /* 左の余白は少しだけ */
  display: block;
  text-decoration: none;
  position: relative;
  text-align: center; /* 文字を中央揃え */
}

/* h1 の直前に ■ を置く（絶対配置しない） */
h1.entry-title::before {
  content: "■";
  display: inline-block;
  margin-right: 0.35em; /* ← ここで隙間を調整 */
  font-size: 1.1em;
  color: var(--tk-accent);
  position: static; /* 絶対配置を解除 */
}
/* -------------------------------- 
タイムラインスタイル（新バージョン）
-------------------------------- */

/* タイムライン全体 */
.cd-container {
  position: relative;
  padding: 2em 0;
  width: 90%;
  max-width: 1170px;
  margin: 0 auto;
}

.cd-container::after {
  /* clearfix */
  content: '';
  display: table;
  clear: both;
}

.cd-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 100%;
  transform: translateX(-50%);
  background:
    linear-gradient(to right, #e5e5e5 0%, #e5e5e5 33%, transparent 33%, transparent 66%, #e5e5e5 66%, #e5e5e5 100%);
}

#cd-timeline {
  position: relative;
  padding: 2em 0;
  margin-top: 2em;
  margin-bottom: 2em;
  background-color: #FFF6D2;
}

/* 初期状態：透明＋左右にずらす */
.cd-timeline-block {
  position: relative;
  display: flex;
  margin: 2em 0;
  opacity: 0;
  transition: all 0.8s cubic-bezier(.25,.8,.25,1);
}

.cd-timeline-block:after {
  content: "";
  display: table;
  clear: both;
}

.cd-timeline-block:nth-child(odd) {
  transform: translateX(-60px);
}

.cd-timeline-block:nth-child(even) {
  transform: translateX(60px);
}

/* 表示状態 */
.cd-timeline-block.visible {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.1s;
}

/* 丸（スマホ） */
.cd-timeline-img {
  position: absolute;
  top: 0;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px; /* 中央揃え */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 0 0 4px #fff,
    0 2px 6px rgba(0, 0, 0, 0.15);
}

/* アイコン（SVG） */
.cd-timeline-img img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  /* ★ ここが最重要：旧 Codrops の位置指定を完全に無効化 */
  position: static !important;
  left: auto !important;
  top: auto !important;
  margin: 0 !important;
}

/* タイムラインアイコンの色分け */
.cd-timeline-img.cd-construction,
.cd-timeline-img.cd-battleship,
.cd-timeline-img.cd-aircraft-carrier,
.cd-timeline-img.cd-heavy-cruiser,
.cd-timeline-img.cd-light-cruiser,
.cd-timeline-img.cd-destroyer,
.cd-timeline-img.cd-auxiliray-ship,
.cd-timeline-img.cd-deutschland-ship,
.cd-timeline-img.cd-auxiliary-ship,
.cd-timeline-img.cd-submarine {
  background-color: #32cd32;
}

.cd-timeline-img.cd-attack {
  background: #f2a0a1;
}

.cd-timeline-img.cd-battle {
  background: #db3d2a;
}

.cd-timeline-img.cd-sinking {
  background: #884898;
}

.cd-timeline-img.cd-history {
  background: #f0e68c;
}

.cd-timeline-img.cd-conference {
  background: #888a86;
}

.cd-timeline-img.cd-refit {
  background: #00a3db;
}

.cd-timeline-img.cd-end {
  background: #ffffff;
}

/* 内容 */
.cd-timeline-content {
  position: relative;
  background: #FFFFDF;
  padding: 1em;
  border-radius: 0.25em;
  width: 45%;
  box-shadow: 0 3px 0 #c4c472;
  margin-left: 60px;
}

.cd-timeline-content:after {
  content: "";
  display: table;
  clear: both;
}

.cd-timeline-content h2 {
  color: #303e49;
}

.cd-timeline-content p,
.cd-timeline-content .cd-read-more,
.cd-timeline-content .cd-date {
  font-size: 13px;
  font-size: 0.8125rem;
}

.cd-timeline-content .cd-read-more,
.cd-timeline-content .cd-date {
  display: inline-block;
}

.cd-timeline-content p,
#box p {
  margin: 1em 0;
  line-height: 1.6;
  text-indent: 1em;
}

.cd-timeline-content .cd-read-more {
  float: right;
  padding: 0.8em 1em;
  background: #acb7c0;
  border-radius: 0.25em;
}

.no-touch .cd-timeline-content .cd-read-more:hover {
  background-color: #bac4cb;
}

.cd-timeline-content .cd-date {
  float: left;
  padding: 0.8em 0;
  opacity: 0.7;
}

.cd-timeline-content::before {
  content: '';
  position: absolute;
  top: 16px;
  right: 100%;
  height: 0;
  width: 0;
  border: 7px solid transparent;
  border-right: 7px solid #FFFFDF;
}

/* 左右交互 */
.cd-timeline-block:nth-child(odd) {
  flex-direction: row;
}

.cd-timeline-block:nth-child(even) {
  flex-direction: row-reverse;
}

/* モバイルは1カラム */
@media (max-width: 767px) {
  .cd-container::before {
    left: 20px;
  }
  
  .cd-timeline-img {
    left: 0;
    margin-left: 0;
  }
  
  .cd-timeline-block {
    flex-direction: row;
  }
  
  .cd-timeline-content {
    width: calc(100% - 80px);
    margin-left: 60px;
  }
}
.cd-timeline-block:nth-child(odd) .cd-date {
  text-align: left !important;
}

.cd-timeline-block:nth-child(even) .cd-date {
  text-align: right !important;
}

/* タブレット以上 */
@media only screen and (min-width: 768px) {
  .cd-timeline-content h2 {
    font-size: 20px;
    font-size: 1.25rem;
  }
  
  .cd-timeline-content p {
    font-size: 16px;
    font-size: 1rem;
    text-indent: 1em;
  }
  
  .cd-timeline-content .cd-read-more,
  .cd-timeline-content .cd-date {
    font-size: 14px;
    font-size: 0.875rem;
  }
}

/* PC 版（大きい丸） */
@media only screen and (min-width: 1170px) {
  #cd-timeline {
    margin-top: 3em;
    margin-bottom: 3em;
  }
  
  .cd-timeline-block {
    margin: 4em 0;
  }
  
  .cd-timeline-img {
    width: 60px;
    height: 60px;
    margin-left: -30px;
  }
  
  .cd-timeline-content {
    margin-left: 0;
    padding: 1.6em;
    width: 45%;
  }
  
  .cd-timeline-content::before {
    top: 24px;
    left: 100%;
    border-color: transparent;
    border-left-color: #FFFFDF;
  }
  
  .cd-timeline-content .cd-read-more {
    float: left;
  }
  
  .cd-timeline-content .cd-date {
    position: absolute;
    width: 100%;
    left: 122%;
    top: 6px;
    font-size: 16px;
    font-size: 1rem;
  }
  
  .cd-timeline-block:nth-child(even) .cd-timeline-content {
    float: right;
  }
  
  .cd-timeline-block:nth-child(even) .cd-timeline-content::before {
    top: 24px;
    left: auto;
    right: 100%;
    border-color: transparent;
    border-right-color: #FFFFDF;
  }
  
  .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more {
    float: right;
  }
  
  .cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date {
    left: auto;
    right: 122%;
    text-align: right;
  }
}

/* -------------------------------- 
その他のスタイル
-------------------------------- */
#main {
  background-color: #FFF6D2;
}

.cd-timeline ul {
  padding-left: 0;
}

.cd-timeline ul li {
  padding-left: 0;
}

@media screen and (min-width: 980px) {
  #head {
    margin: 0 35% 1em 35%;
    text-align: center;
  }
  
  #box {
    width: 1092px;
    margin: 0 auto 1em auto;
    padding: 1em 3em 1em 3em;
    border: 1px #B22B25 solid;
    background-color: #FFFFDF;
  }
  
  .pagetop {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 55px;
  }
  
  .pagetop a {
    display: block;
    width: 50px;
    height: 40px;
    background-color: #333;
    text-align: center;
    color: #fff;
    font-size: 24px;
    text-decoration: none;
    line-height: 40px;
  }
}