/**
 * blog-single.css
 *
 * ブログ記事(post)シングルページ専用CSS。
 * Astraテーマ標準の .entry-header / .entry-meta / .entry-content を
 * モノトーン×明朝×静謐なミニマリズムの方針で上書きする。
 *
 * 適用範囲: is_singular( 'post' ) のときのみ enqueue される。
 *
 * レイアウト構成 (上から下):
 *   1. アイキャッチ (.post-thumb-img-content)
 *   2. メタ情報 (.entry-meta) — カテゴリ + 日付(右端絶対配置)
 *   3. タイトル下 divider (タイトル::after で 40px)
 *   4. タイトル (.entry-title) Yu Mincho 32px
 *   5. 本文 (.entry-content) Yu Gothic 16px / 行高 1.9
 *   6. 末尾タグセクション (.kwrm-post-tags-section)
 *
 * 関連 PHP フック (functions.php):
 *   - kawaremake_inject_post_date_top: <div class="kwrm-meta-date"> を本文最前に挿入
 *   - kawaremake_inject_post_tags_section: <aside class="kwrm-post-tags-section"> を本文末尾に挿入
 *
 * 設計方針:
 *   - メタは Georgia オールキャップ風で視認性UP・カテゴリリンクに下線
 *   - タイトルは Yu Mincho 32px で堂々と
 *   - 日付は CSS の position: absolute でメタ行の右端に重ねる(JS不使用)
 *   - 末尾タグはピル風の細枠カードでクリッカブル
 *
 * 注意:
 *   - .entry-meta の生テキスト「/」「By」消去のため font-size: 0 トリック
 *   - .entry-meta .ast-terms-link だけサイズを復活させる
 */

/* ========================================
   1. 全体: Astra標準のpost表示にスコープを絞る
   ======================================== */

.single-post .entry-header,
.single-post .entry-content {
  font-family: var(--font-body-ja, "Yu Gothic", YuGothic, "Hiragino Sans", sans-serif);
  color: var(--color-text-primary, #2C2826);
}

/* ========================================
   2. entry-header: 並び順とコンテナ
   ======================================== */

.single-post .entry-header {
  display: flex;
  flex-direction: column;
  position: relative;
  margin-bottom: 56px;
  padding-bottom: 0;
  border-bottom: none;
}

/* 並び順:
   1. アイキャッチ (.post-thumb-img-content)
   2. メタ (.entry-meta)
   3. タイトル (.entry-title)
*/
.single-post .entry-header .post-thumb-img-content,
.single-post .entry-header .post-thumb { order: 1; }
.single-post .entry-header .entry-meta { order: 2; }
.single-post .entry-header .entry-title { order: 3; }

/* ========================================
   3. アイキャッチ: 最上部
   ======================================== */

.single-post .entry-header .post-thumb-img-content,
.single-post .entry-header .post-thumb {
  margin: 0 0 32px;
  text-align: left;
}

.single-post .entry-header .post-thumb-img-content img,
.single-post .entry-header .post-thumb img,
.single-post .entry-header .wp-post-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
}

/* ========================================
   4. メタ情報: カテゴリ表示・日付は右端絶対配置
   ======================================== */

.single-post .entry-meta {
  position: relative;
  font-family: var(--font-heading-en, Georgia, "Times New Roman", serif);
  font-size: 0; /* 生テキスト「/」「By」消去 */
  letter-spacing: 0.18em;
  color: var(--color-text-tertiary, #888780);
  margin: 0 0 14px;
  padding: 0;
  min-height: 1.4em;
}

/* font-size: 0 とせた .entry-meta 内で、表示したいタームリンク部分だけサイズを復活 */
.single-post .entry-meta .ast-terms-link {
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* カテゴリリンク(.ast-terms-link 内のa) — 下線でリンクと判別しやすく */
.single-post .entry-meta a,
.single-post .entry-meta .ast-terms-link a {
  color: var(--color-text-primary, #2C2826) !important;
  text-decoration: none;
  border-bottom: 0.5px solid var(--color-border-mid, #D4D0C7);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.single-post .entry-meta a:hover,
.single-post .entry-meta .ast-terms-link a:hover {
  border-bottom-color: var(--color-text-primary, #2C2826);
}

/* 投稿者「By 〜」を非表示 */
.single-post .entry-meta .posted-by,
.single-post .entry-meta .author.vcard,
.single-post .entry-meta a[rel="author"] {
  display: none !important;
}

/* ========================================
   5. 日付 (.kwrm-meta-date) — メタ行の右端に絶対配置
   ======================================== */

/* the_content フィルタの最前(priority 5)に出力されるため、
   .entry-content の最初の子要素として配置される。
   .entry-header を position: relative にして、
   .kwrm-meta-date を絶対配置でメタ行の右端に乗せる。 */

.single-post .entry-content > .kwrm-meta-date:first-child {
  position: absolute;
  top: 0; /* .entry-content の最上部 = メタの直下 */
  right: 0;
  margin-top: -56px; /* .entry-header の margin-bottom 分を打ち消し、メタ行に重ねる */
  font-family: var(--font-heading-en, Georgia, "Times New Roman", serif);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--color-text-tertiary, #888780);
  pointer-events: none;
}

/* .entry-content も position: relative が要る (絶対配置の親基準として) */
.single-post .entry-content {
  position: relative;
}

/* ========================================
   6. タイトル: H1 — Yu Mincho 32px 500 (詳細度を上げて Astra 既定を上書き)
   ======================================== */

.single-post header.entry-header .entry-title {
  font-family: var(--font-heading-ja, "Yu Mincho", YuMincho, "Hiragino Mincho ProN", serif);
  font-size: 32px;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: var(--color-text-primary, #2C2826);
  margin: 0;
  padding: 0;
}

/* タイトル直前の divider (40px幅) — タイトル::before で表示 */
.single-post header.entry-header .entry-title::before {
  content: "";
  display: block;
  width: 40px;
  height: 0.5px;
  background: var(--color-border-mid, #D4D0C7);
  margin: 18px 0 22px;
}

/* ========================================
   7. 本文 (.entry-content)
   ======================================== */

.single-post .entry-content {
  font-family: var(--font-body-ja, "Yu Gothic", YuGothic, "Hiragino Sans", sans-serif);
  font-size: 16px;
  line-height: 1.9;
  color: var(--color-text-primary, #2C2826);
}

.single-post .entry-content p {
  margin: 0 0 1.6em;
  font-size: 16px;
  line-height: 1.9;
  color: var(--color-text-primary, #2C2826);
}

.single-post .entry-content h2,
.single-post .entry-content .wp-block-heading {
  font-family: var(--font-heading-ja, "Yu Mincho", YuMincho, "Hiragino Mincho ProN", serif);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--color-text-primary, #2C2826);
  margin: 2.4em 0 0.8em;
  padding: 0;
  border: none;
}

.single-post .entry-content h3 {
  font-family: var(--font-heading-ja, "Yu Mincho", YuMincho, "Hiragino Mincho ProN", serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--color-text-primary, #2C2826);
  margin: 2em 0 0.6em;
  padding: 0;
  border: none;
}

.single-post .entry-content h4 {
  font-family: var(--font-heading-ja, "Yu Mincho", YuMincho, "Hiragino Mincho ProN", serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--color-text-primary, #2C2826);
  margin: 1.8em 0 0.5em;
}

.single-post .entry-content a:not(.kwrm-post-tag) {
  color: var(--color-text-primary, #2C2826);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border-mid, #D4D0C7);
  transition: text-decoration-color 0.2s ease;
}

.single-post .entry-content a:not(.kwrm-post-tag):hover {
  text-decoration-color: var(--color-text-primary, #2C2826);
}

.single-post .entry-content strong,
.single-post .entry-content b {
  font-weight: 500;
  color: var(--color-text-primary, #2C2826);
}

.single-post .entry-content hr,
.single-post .entry-content .wp-block-separator {
  border: 0;
  height: 0.5px;
  background: var(--color-border-light, #E8E5DE);
  width: 100%;
  margin: 3em auto;
  opacity: 1;
}

.single-post .entry-content ul,
.single-post .entry-content ol {
  margin: 0 0 1.6em;
  padding-left: 1.5em;
  line-height: 1.9;
}

.single-post .entry-content li {
  margin: 0 0 0.4em;
}

.single-post .entry-content blockquote {
  margin: 2em 0;
  padding: 0 0 0 1.5em;
  border-left: 0.5px solid var(--color-border-mid, #D4D0C7);
  font-family: var(--font-heading-ja, "Yu Mincho", YuMincho, "Hiragino Mincho ProN", serif);
  font-style: normal;
  color: var(--color-text-secondary, #6B6760);
}

.single-post .entry-content img,
.single-post .entry-content figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
}

.single-post .entry-content figure {
  margin: 2em 0;
}

.single-post .entry-content figcaption {
  font-size: 12px;
  color: var(--color-text-tertiary, #888780);
  text-align: center;
  margin-top: 0.6em;
  letter-spacing: 0.02em;
}

/* ========================================
   8. 末尾タグセクション (.kwrm-post-tags-section)
   ======================================== */

.single-post .entry-content .kwrm-post-tags-section {
  margin: 3em 0 1em;
  padding: 24px 0 0;
  border-top: 0.5px solid var(--color-border-light, #E8E5DE);
}

.single-post .entry-content .kwrm-post-tags-section__label {
  font-family: var(--font-heading-en, Georgia, "Times New Roman", serif);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-text-tertiary, #888780);
  margin: 0 0 14px;
}

.single-post .entry-content .kwrm-post-tags-section__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.single-post .entry-content .kwrm-post-tag {
  display: inline-block;
  padding: 6px 14px;
  border: 0.5px solid var(--color-border-mid, #D4D0C7);
  font-family: var(--font-body-ja, "Yu Gothic", YuGothic, "Hiragino Sans", sans-serif);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--color-text-primary, #2C2826) !important;
  background: var(--color-bg-primary, #FAF9F6);
  text-decoration: none !important;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.single-post .entry-content .kwrm-post-tag:hover {
  background: #FFFFFF;
  border-color: var(--color-text-primary, #2C2826);
}

/* ========================================
   9. レスポンシブ: モバイル調整
   ======================================== */


/* ========================================
   10. 投稿ナビゲーション (Astra標準の「前の投稿 / 次の投稿」) を非表示
   関連記事・関連サービス・タグセクションがより適切な回遊動線を提供するため、
   時系列順の前後ナビを除外してブランドの静謐さを保つ。
   ======================================== */

.single-post .post-navigation,
.single-post nav.navigation.post-navigation,
.single-post .nav-links {
  display: none !important;
}
@media (max-width: 768px) {
  .single-post header.entry-header .entry-title {
    font-size: 22px;
    line-height: 1.5;
  }

  .single-post header.entry-header .entry-title::before {
    margin: 14px 0 18px;
  }

  .single-post .entry-header {
    margin-bottom: 40px;
  }

  .single-post .entry-header .post-thumb-img-content,
  .single-post .entry-header .post-thumb {
    margin: 0 0 24px;
  }

  .single-post .entry-meta .ast-terms-link {
    font-size: 11px;
  }

  .single-post .entry-content > .kwrm-meta-date:first-child {
    /* モバイルでは絶対配置を解除して通常フローに戻す */
    position: static;
    margin: -28px 0 16px;
    text-align: right;
    font-size: 10px;
  }

  .single-post .entry-content {
    font-size: 15px;
    line-height: 1.85;
  }

  .single-post .entry-content p {
    font-size: 15px;
    line-height: 1.85;
  }

  .single-post .entry-content h2,
  .single-post .entry-content .wp-block-heading {
    font-size: 19px;
    margin: 2em 0 0.6em;
  }

  .single-post .entry-content h3 {
    font-size: 16px;
    margin: 1.6em 0 0.5em;
  }

  .single-post .entry-content .kwrm-post-tag {
    font-size: 11px;
    padding: 5px 12px;
  }
}
