/**
 * blog.css
 * ブログ一覧およびブログ詳細ページ専用スタイル
 */

/* ==========================================
 * 0. 共通見出し（H1）の強化
 * ========================================== */
.subpage-content h1 {
  font-size: 64px !important; /* 標準の53pxから拡大 */
  letter-spacing: 0.05em !important;
  margin-bottom: 40px !important;
}

@media (max-width: 768px) {
  .subpage-content h1 {
    font-size: 36px !important; /* スマホ時も32pxから拡大 */
  }
}

/* ==========================================
 * 1. ブログ一覧：カードレイアウト & 余白
 * ========================================== */
#blog-hero { padding-bottom: 100px !important; }
#blog-filter { padding-bottom: 100px !important; }

/* カテゴリーフィルターのコンテナ：ボタン間の余白を設定 */
#blog-filter .container > div {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  width: 100%;
}

/* 記事一覧グリッド：カード同士の余白（PC版） */
#blog-list .tw\:grid-cols-3 {
  display: grid !important;
  gap: 80px 40px !important; /* 縦に80px、横に40pxの余白を確保 */
}

/* カテゴリーフィルタータグ */
.blog-category-tag {
  display: inline-block;
  padding: 8px 24px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 100px;
  font-size: 14px;
  color: #6b7280 !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.blog-category-tag:hover, .blog-category-tag.active {
  background: #ec4899;
  border-color: #ec4899;
  color: white !important;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2);
}

/* 記事カード構造 */
.blog-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f4f6;
  margin-bottom: 14px;
}

.blog-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.blog-card:hover .blog-card-thumb img { transform: scale(1.05); }

/* メタ情報共通：カテゴリーラベルの装飾 */
.blog-card-category-label {
  font-size: 12px;
  font-weight: 700;
  color: #ec4899 !important;
  background-color: #fdf2f8 !important;
  padding: 2px 10px !important;
  border-radius: 4px !important;
  display: inline-block;
}

.blog-card-date {
  font-size: 13px;
  color: #9ca3af;
  font-weight: 500;
}

/* 一覧カード：カテゴリーを右寄せにする */
.blog-card-meta {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.blog-card .blog-card-category-label {
  margin-left: auto !important;
}

.blog-card-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.6 !important;
  color: #111827 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  display: block !important;
  white-space: normal !important;
  transition: color 0.3s;
}

/* ==========================================
 * 2. ページネーション
 * ========================================== */
.pagination-wrapper {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap !important;
  flex-direction: row !important;
  gap: 12px !important;
  margin-top: 150px !important; /* PC版での大きな余白 */
  width: 100%;
}

.pagination-item {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  color: #6b7280 !important;
  text-decoration: none !important;
  transition: all 0.3s ease;
}

.pagination-item:hover, .pagination-item.active {
  background: #ec4899;
  color: white !important;
  border-color: #ec4899;
}

/* ==========================================
 * 3. ブログ詳細ページ専用
 * ========================================== */
.blog-detail-body {
  font-size: 16px;
  line-height: 2.0;
  color: #374151;
}

.blog-detail-body h2 {
  font-size: 24px !important;
  margin-top: 60px !important;
  margin-bottom: 25px !important;
  border-left: 6px solid #ec4899 !important;
  padding-left: 15px !important;
  line-height: 1.4 !important;
  color: #111827 !important;
}

/* 本文内の画像（image_path_1以外） */
.blog-detail-body img {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  margin-top: 50px !important;
}

/* 記事詳細のメタ情報：左右振り分け */
.blog-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.blog-detail-meta .blog-card-category-label {
  margin-left: 0 !important;
}

/* 前後ナビゲーションボタン */
.blog-nav-btn {
  display: flex !important;
  align-items: center;
  padding: 18px 24px !important;
  background: white !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 12px !important;
  color: #111827 !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  width: 100%;
}

.blog-nav-btn span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-nav-btn.prev::before { content: '←'; margin-right: 12px; flex-shrink: 0; }
.blog-nav-btn.next { justify-content: flex-end; }
.blog-nav-btn.next::after { content: '→'; margin-left: 12px; flex-shrink: 0; }

.blog-nav-btn:hover {
  background: #fdf2f8 !important;
  border-color: #ec4899 !important;
  color: #ec4899 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.1);
}

/* ==========================================
 * 4. レスポンシブ調整
 * ========================================== */

@media (min-width: 769px) {
  /* PC：記事タイトルの上マージン */
  .subpage-content h1:has(+ .blog-detail-meta),
  .subpage-content h1:has(+ div + .blog-detail-meta) {
    margin-top: 60px !important;
  }

  /* PC：記事本文の最大幅を600pxに制限 */
  .subpage-content .container:has(.blog-detail-body) {
    max-width: 600px !important;
  }

  /* PC：ナビゲーションコンテナは広めに確保（1000px） */
  .subpage-content .container:has(.blog-nav-btn) {
    max-width: 1000px !important;
    margin-top: 150px !important;
  }
}

@media (max-width: 768px) {
  #blog-hero, #blog-filter { padding-bottom: 60px !important; }

  .pagination-wrapper {
    margin-top: 60px !important;
    gap: 10px !important;
  }

  .subpage-content .container:has(.blog-nav-btn) {
    margin-top: 100px !important;
  }

  /* スマホ：ボタン間の余白 */
  .subpage-content .tw\:max-md\:flex-col > .tw\:flex-1 + .tw\:flex-1 {
    margin-top: 16px !important;
  }

  .blog-detail-body h2 {
    font-size: 20px !important;
    margin-top: 40px !important;
  }

  /* スマホ一覧：記事カードの区切り線を表示するためグリッドの隙間をリセット */
  #blog-list .tw\:grid-cols-3 {
    gap: 0 !important; 
  }

  /* スマホ一覧：記事カードの区切り線と上下余白 */
  .blog-card {
    border-bottom: 1px solid #d1d5db !important;
    padding-top: 50px !important;
    padding-bottom: 50px !important;
    margin-bottom: 0 !important;
    display: block !important;
  }

  .blog-card:first-child { padding-top: 0 !important; }
  .blog-card:last-child { border-bottom: none !important; padding-bottom: 0 !important; }
}
