/* blog-styles.css - ブログセクション専用スタイルシート（間隔調整版） */

/* 注目記事セクションのスタイル */
.featured-articles {
  background: #f8f9fa; /* グラデーション削除 */
  padding: 30px 0; /* 50px から 10px に削減 */
  margin: 0;
  border-bottom: none; /* 3px solid #0066cc を削除 */
}

.featured-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 5px; /* 15px から 5px に削減 */
  color: #333;
  font-weight: bold;
}

.featured-subtitle {
  text-align: center;
  color: #666;
  font-size: 16px;
  margin-bottom: 15px; /* 40px から 15px に削減 */
}

.articles-slider {
  display: flex;
  gap: 25px;
  overflow-x: auto;
  padding: 0 20px 20px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.article-slide {
  min-width: 320px;
  max-width: 350px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  scroll-snap-align: start;
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.article-slide:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.article-header {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: linear-gradient(45deg, #0066cc, #ff6600); /* フォールバック背景 */
}

.article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.article-slide:hover .article-image {
  transform: scale(1.05);
}

/* 画像が読み込まれない場合のフォールバック */
.article-header .fallback-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40px;
  color: white;
  display: none;
  z-index: 2;
}

.article-header:not(:has(img)) .fallback-icon,
.article-header .article-image[src=""] + .fallback-icon,
.article-header .article-image.error + .fallback-icon {
  display: block;
}

.article-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.article-badge.new {
  background: #ff6600;
  color: white;
}

.article-badge.popular {
  background: #dc3545;
  color: white;
}

.article-badge.recommended {
  background: #28a745;
  color: white;
}

.article-badge.trending {
  background: #17a2b8;
  color: white;
}

.article-body {
  padding: 20px;
}

.article-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.4;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-summary {
  color: #666;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #999;
  border-top: 1px solid #eee;
  padding-top: 10px;
}

.article-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

.article-cta {
  color: #0066cc;
  font-weight: bold;
  text-decoration: none;
  transition: color 0.3s;
}

.article-cta:hover {
  color: #004d99;
}

.view-all-blog {
  text-align: center;
  margin-top: 20px; /* 30px から 20px に削減 */
}

.view-all-blog .btn {
  padding: 12px 30px;
  background-color: #ff6600;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.2s;
  display: inline-block;
}

.view-all-blog .btn:hover {
  background-color: #e55c00;
  transform: translateY(-2px);
}

/* ローディングプレースホルダー */
.loading-placeholder {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  width: 100%;
  color: #666;
  font-size: 16px;
}

.loading-placeholder.hidden {
  display: none;
}

/* エラーメッセージ */
.error-message {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  width: 100%;
  color: #dc3545;
  font-size: 16px;
  text-align: center;
}

.error-message button {
  margin-left: 15px;
  padding: 8px 16px;
  background-color: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.error-message button:hover {
  background-color: #004d99;
}

/* スクロールバーのスタイル */
.articles-slider::-webkit-scrollbar {
  height: 8px;
}

.articles-slider::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.articles-slider::-webkit-scrollbar-thumb {
  background: #0066cc;
  border-radius: 4px;
}

.articles-slider::-webkit-scrollbar-thumb:hover {
  background: #004d99;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .featured-articles {
    padding: 20px 0; /* 30px から 20px に削減 */
  }
  
  .featured-title {
    font-size: 22px;
  }
  
  .article-slide {
    min-width: 280px;
    max-width: 300px;
  }
  
  .articles-slider {
    padding: 0 15px 15px;
    gap: 20px;
  }
  
  .article-header {
    height: 140px;
  }
  
  .article-body {
    padding: 15px;
  }
  
  .article-title {
    font-size: 15px;
  }
  
  .article-summary {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .article-slide {
    min-width: 260px;
    max-width: 280px;
  }
  
  .articles-slider {
    padding: 0 10px 10px;
    gap: 15px;
  }
}

/* アニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-slide {
  animation: fadeInUp 0.6s ease-out;
}

.article-slide:nth-child(1) { animation-delay: 0.1s; }
.article-slide:nth-child(2) { animation-delay: 0.2s; }
.article-slide:nth-child(3) { animation-delay: 0.3s; }
.article-slide:nth-child(4) { animation-delay: 0.4s; }
.article-slide:nth-child(5) { animation-delay: 0.5s; }

/* フォーカス時のアクセシビリティ */
.article-slide:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.article-slide:focus-visible {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}