/* ================================================================
   記事（投稿）ページ専用CSS
   gw-custom-css/article.css
   is_singular('post') のときのみ読み込まれる
   + 全セレクターに body.single-post を前置してスコープを完全に閉じる
   ================================================================ */


/* ---- toc-box・summary-box 内の <p> デフォルトマージンをリセット ---- */
body.single-post .toc-box p,
body.single-post .summary-box p {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0;
}


/* ---- 💡 ざっくり言うとボックス ---- */
body.single-post .summary-box {
  background: #fffdf0;
  border: 1.5px dashed #e2c96e;
  border-radius: 8px;
  padding: 0.5em 1.1em !important;
  margin-top: 1.2em !important;
  margin-bottom: 2.4em !important;
  font-size: 0.82em;
  line-height: 1.65;
  color: #666;
}

body.single-post .summary-box__title {
  font-weight: 700;
  color: #c89608;
  display: block;
  margin-bottom: 0.4em;
}


/* ---- TOC（目次）ボックス ---- */
body.single-post .toc-box {
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.8em 1.4em 0.9em 1.2em;
  margin-top: 1.8em !important;
  margin-bottom: 1.8em !important;
  /* PC: コンテンツ列の左端に合わせる（750px = entry-content の実測コンテンツ幅） */
  margin-left: max(0px, calc((100% - 750px) / 2)) !important;
  margin-right: auto !important;
  display: block;
  width: fit-content;
  min-width: 200px;
  max-width: 480px;
}

/* スマホ: 左右に余白を確保 */
@media (max-width: 781px) {
  body.single-post .toc-box {
    margin-left: 1em !important;
    margin-right: 1em !important;
    width: auto;
    max-width: none;
    box-sizing: border-box;
  }
}

body.single-post .toc-title {
  font-size: 0.78em;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.08em;
  margin: 0 0 0.5em 0 !important;
}

body.single-post .toc-list {
  margin: 0;
  padding-left: 1.4em;
  list-style: decimal;
}

body.single-post .toc-list li {
  margin: 0.25em 0;
  font-size: 0.88em;
  line-height: 1.5;
  color: #333;
}

body.single-post .toc-list a {
  color: #333;
  text-decoration: none;
}

body.single-post .toc-list a:hover {
  text-decoration: underline;
}


/* ---- h2 に id が付いても装飾を変えない（TOC用アンカー対策） ---- */
body.single-post .entry-content h2[id],
body.single-post .wp-block-post-content h2[id] {
  text-decoration: none;
  border-bottom: none;
}

body.single-post .entry-content h2 a,
body.single-post .entry-content h3 a,
body.single-post .wp-block-post-content h2 a,
body.single-post .wp-block-post-content h3 a {
  text-decoration: none;
  color: inherit;
  border-bottom: none;
}


/* ---- アイキャッチ画像（本文先頭の figure 要素） ---- */
body.single-post .eyecatch-top {
  margin-bottom: 2em !important;
}

body.single-post .eyecatch-top img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}


/* ================================================================
   note風タイポグラフィ
   ================================================================ */

/* ---- 本文全体 ---- */
body.single-post .entry-content,
body.single-post .wp-block-post-content {
  font-size: 17px;
  line-height: 1.95;
  color: #08131a;
  letter-spacing: 0.01em;
}

/* ---- 段落 ---- */
body.single-post .entry-content p,
body.single-post .wp-block-post-content p {
  margin-top: 1.8em;
  margin-bottom: 0;
  line-height: 1.95;
}

/* ---- h2 ---- */
body.single-post .entry-content h2,
body.single-post .wp-block-post-content h2 {
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.4;
  color: #08131a;
  letter-spacing: 0.04em;
  margin-top: 2.8em;
  margin-bottom: 0.6em;
  padding: 0;
  border: none;
  background: none;
}

/* h2 直後に短い黒バー（noteっぽいアクセント） */
body.single-post .entry-content h2::after,
body.single-post .wp-block-post-content h2::after {
  content: '';
  display: block;
  width: 2em;
  height: 3px;
  background: #08131a;
  margin-top: 0.4em;
  border-radius: 2px;
}

/* ---- h3 ---- */
body.single-post .entry-content h3,
body.single-post .wp-block-post-content h3 {
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.5;
  color: #08131a;
  letter-spacing: 0.03em;
  margin-top: 2.2em;
  margin-bottom: 0.5em;
  padding: 0;
  border: none;
  background: none;
}
