/* ===================================================================
   article.css - 個別記事ページ専用スタイル
   =================================================================== */

/* =====================================================
   1. 記事本体の基本レイアウト
   ===================================================== */
.article-body {
  max-width: 45rem; /* 記事の最大幅 */
  margin: 0 auto;   /* 中央揃え */
}

/* =====================================================
   2. 記事ヘッダー (画像、タイトル、メタ情報)
   ===================================================== */

/* --- 2-1. サムネイル画像 --- */
.article-thumbnail {
  margin-bottom: 2rem;
}
.article-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* --- 2-2. ヘッダー全体 --- */
.article-header {
  margin-bottom: 1.5rem;
}

/* --- 2-3. 各見出し要素 --- */
/* h2: 記事タイトル */
.article-page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #6c757d;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
/* h1: 小説タイトル (主役) */
.article-novel-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--color-text-title);
}

/* --- 2-4. メタ情報バー --- */
.article-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e9ecef;
}
/* h3: 著者 */
.article-author-area {
  font-size: 1.1rem;
  font-weight: 600;
  color: #495057;
  margin: 0;
}
.article-author-area .author-link {
  font-size: 1.1rem; /* 親のサイズを確実に継承させる */
}
/* いいね・シェア・日付エリア */
.article-meta-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-shrink: 0; /* 幅が狭くなっても縮まないように */
  margin-left: auto; /* 左側の要素を押しやって右端に配置 */
}

/* --- 2-5. いいね & シェアボタン --- */
.article-meta-right .card-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.card-likes,
.button-share-native,
.share-icon {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 1.2rem; /* アイコンサイズを少し大きく */
  color: #6c757d;
  transition: color 0.2s, transform 0.2s;
}
.card-likes:hover,
.button-share-native:hover,
.share-icon:hover {
  color: #212529;
}
.card-likes {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.card-likes.is-liked .icon {
  color: #e54747;
}
.share-container .button-share-fallback {
  display: flex;
  gap: 1rem;
}
.button-share-native { display: none; }
.js-share-api-supported .button-share-fallback { display: none; }
.js-share-api-supported .button-share-native { display: block; }

/* =====================================================
   3. タグ & 本文
   ===================================================== */

/* --- 3-1. タグ一覧 --- */
.article-tags {
  justify-content: flex-start; /* style.cssの中央揃えを上書き */
  margin-bottom: 1.5rem;
}

/* --- 3-2. 記事本文 --- */
.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
}
/* 本文中のh2見出し */
.article-content h2 {
  font-size: 1.8rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #dee2e6;
}
.article-content p {
  margin-bottom: 1.5rem;
}

/* =====================================================
   4. 記事フッター (前後記事・関連記事)
   ===================================================== */
.article-footer-navigation {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #e9ecef;
}

/* --- 4-1. 前後記事 (Newer/Older) --- */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 4rem;
}
.nav-item {
  flex: 1; /* 幅を均等に分ける */
}
.nav-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.older .nav-section-title {
  text-align: right;
}

/* --- 4-2. 関連記事 (Pick up) --- */
.related-articles .section-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* ★2列のグリッドレイアウト */
  gap: 2rem;
}

/* --- 4-3. フッターナビゲーション用カード (共通) --- */
.nav-card {
  display: block;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nav-card-image {
  aspect-ratio: 16 / 9;
  background-color: #f1f3f5;
}
.nav-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nav-card-title {
  padding: 0.75rem 1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  color: #212529;
}


/* =====================================================
   5. スマートフォン向けの調整 (article.css)
   ===================================================== */
@media (max-width: 30rem) { /* 480px以下で適用 */

  .article-page-title { font-size: 1.2rem; }
  .article-novel-title { font-size: 2rem; }
  .article-author-area,
  .article-author-area .author-link { font-size: 1rem; }

  .article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    border-bottom: none;
  }
  .article-author-area {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    width: 100%;
  }
  .article-meta-right {
    width: 100%;
    justify-content: space-between;
  }
  
  /* .related-grid の指定はここにはもうありません */
}