/* ========================================
   関連記事表示スタイル（サムネイル付き）
   ======================================== */

.related-articles-wrapper {
  margin: 20px 0 10px;
  padding-bottom: 20px;
  border-bottom: 3px solid #FFDC00;  /* 下側に罫線 */
}

.related-articles-section {
  margin-bottom: 40px;
}

.related-articles-section:last-child {
  margin-bottom: 0;
}

/* 見出し */
.related-articles-title {
  font-size: 22px;
  font-weight: 700;
  color: #1d1d1d;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid #FFDC00;
  position: relative;
}

.related-articles-title::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 60px;
  height: 3px;
  background: #37BEF0;
}

/* リスト */
.related-articles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 100%;
}

/* 記事アイテム（カード） */
.related-article-item {
  margin-bottom: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  max-width: 400px;
}

.related-article-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

/* リンク */
.related-article-link {
  display: block;
  text-decoration: none;
  color: #1d1d1d;
  height: 100%;
}

.related-article-link:hover {
  text-decoration: none;
}

/* サムネイル */
.related-article-thumbnail {
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;  /* 16:9のアスペクト比 */
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}

.related-article-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.related-article-link:hover .related-article-thumbnail img {
  transform: scale(1.05);
}

/* コンテンツエリア */
.related-article-content {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 記事タイトル */
.related-article-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: #1d1d1d;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

.related-article-link:hover .related-article-text {
  color: #37BEF0;
}

/* 日付 */
.related-article-date {
  font-size: 13px;
  color: #999;
  font-weight: 400;
}

/* レスポンシブ */
@media (max-width: 767.98px) {
  .related-articles-wrapper {
    margin: 30px 0 40px;
  }

  .related-articles-title {
    font-size: 18px;
    margin-bottom: 16px;
    padding-bottom: 10px;
  }

  .related-articles-list {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .related-article-item {
    max-width: 100%;
  }

  .related-article-thumbnail {
    padding-bottom: 66.67%;  /* 3:2のアスペクト比（スマホ用） */
  }

  .related-article-content {
    padding: 14px;
  }

  .related-article-text {
    font-size: 15px;
  }
}

/* タブレット */
@media (min-width: 768px) and (max-width: 991.98px) {
  .related-articles-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .related-article-item {
    max-width: 100%;
  }
}

/* PC */
@media (min-width: 992px) {
  .related-articles-list {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .related-article-item {
    max-width: 400px;
  }
}
