/* =========================================================
 * StellaNews LIFE — Single Article Body Styles
 * 対象: 単一記事（本文のタイポ/図表/埋め込み/広告）
 * ========================================================= */

:root{
  --ab-text: #0f172a;
  --ab-muted: #475569;
  --ab-accent: #0b66c3;
  --ab-bd: 1px solid rgba(15,23,42,.10);
  --ab-radius: 12px;
}

/* 本文タイポグラフィ */
.single .entry-content{
  color: var(--ab-text);
  font-size: 17px;
  line-height: 1.85;
  word-break: normal;
}
.single .entry-content p{ margin: 0 0 1.05em; }
.single .entry-content h2,
.single .entry-content h3,
.single .entry-content h4{
  color: var(--ab-text);
  font-weight: 800;
  line-height: 1.35;
  margin: 1.6em 0 .6em;
}
.single .entry-content h2{ font-size: clamp(20px, 2.2vw, 26px); border-bottom: 1px solid rgba(15,23,42,.10); padding-bottom: .35em; }
.single .entry-content h3{ font-size: clamp(18px, 1.9vw, 22px); }
.single .entry-content h4{ font-size: clamp(16px, 1.6vw, 19px); }

/* 画像/図表 */
.single .entry-content img{ max-width:100%; height:auto; display:block; margin: .5em auto; }
.single .entry-content figure{ margin: 1.2em auto; }
.single .entry-content figure img{ border-radius: 8px; }
.single .entry-content figcaption{
  color: var(--ab-muted); font-size: 14px; text-align: center; margin-top: .4em;
}

/* リスト */
.single .entry-content ul,
.single .entry-content ol{ padding-left: 1.2em; margin: .6em 0 1em; }
.single .entry-content li+li{ margin-top: .25em; }

/* 引用 */
.single .entry-content blockquote{
  margin: 1.2em 0; padding: .8em 1em;
  background: linear-gradient(180deg,#f8fafc,#f1f5f9);
  border-left: 4px solid #94a3b8; border-radius: 10px;
  color: #334155;
}

/* 表：横スクロール可 */
.single .entry-content .table-wrap{ overflow-x:auto; -webkit-overflow-scrolling: touch; }
.single .entry-content table{
  width:100%; border-collapse: collapse; font-size: 15px; border: var(--ab-bd);
  border-radius: 10px; overflow: hidden;
}
.single .entry-content th,
.single .entry-content td{
  padding: .6em .8em; border-bottom: 1px solid rgba(15,23,42,.08);
}
.single .entry-content thead th{
  background:#f8fafc; font-weight:700; text-align:left;
}

/* コード */
.single .entry-content pre,
.single .entry-content code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.single .entry-content pre{
  background:#0f172a; color:#e5e7eb;
  border-radius: 10px; padding: 12px 14px; overflow:auto;
}

/* 埋め込み（YouTube, Twitter など） */
.single .entry-content iframe,
.single .entry-content .wp-block-embed__wrapper iframe{ max-width:100% !important; }

/* 本文中の広告：本文の流れを乱さず中央寄せ */
.single .entry-content .adsbygoogle{
  display:block !important;
  margin: 14px auto !important;
  max-width: 100% !important;
  clear: both !important;
  border: 0 !important; background: transparent !important;
}

/* 記事下部の関連記事/ナビ等のセクションの余白調整（任意） */
.single .post-navigation,
.single .related-posts{ margin-top: 24px; }


/* =========================================================
 * Article body — Ad-safe polishing
 * 目的:
 *  - 広告が見出し/要点/リスト/引用/表/図の「中」に割り込まない
 *  - 入るとしても「節」と節の間の中立な位置にのみ
 *  - 余白・整列・最大幅を統一し、視線のリズムを保つ
 * ========================================================= */

/* 1) 広告の基本スタイル（中央寄せ・幅制限・余白統一） */
.single .entry-content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  display: block !important;
  margin: 20px auto !important;
  max-width: min(100%, 1000px) !important;
  clear: both !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  line-height: 0 !important; /* 折り返しで高さが暴れないよう */
}

/* 2) 「入ってはいけない領域」では非表示（割り込み防止） */
.single .entry-content :is(h1,h2,h3,h4,h5,h6) :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content blockquote :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content ul :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content ol :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content figure :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content pre :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content table :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content .wp-block-embed :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content nav :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content main :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content section :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content footer :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  display: none !important;
}

/* 3) 「前後の要素が重要ブロック」のときは強めに間隔を確保（見出し直下・直上を守る） */
.single .entry-content :is(h1,h2,h3,h4,h5,h6) + :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  margin-top: 14px !important;   /* 見出し直下は少し余白を持たせる */
}
.single .entry-content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed) + :is(h1,h2,h3,h4,h5,h6){
  margin-top: 18px !important;   /* 広告直後に見出しが来る場合も余白で保護 */
}

/* 4) 要点（blockquote+nav>ul）や箇条書きの「前後」にのみ置けるよう緩衝を追加 */
.single .entry-content :is(blockquote, nav, ul, ol) + :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  margin-top: 16px !important;    /* セクション終端の中立地帯に配置 */
}
.single .entry-content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed) + :is(blockquote, nav, ul, ol){
  margin-top: 16px !important;
}

/* 5) 図版/埋め込み/表の近辺はより強い緩衝（視線ジャンプ抑制） */
.single .entry-content :is(figure, .wp-block-embed, table, pre) + :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  margin-top: 18px !important;
}
.single .entry-content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed) + :is(figure, .wp-block-embed, table, pre){
  margin-top: 18px !important;
}

/* 6) AI評価（★）や参考文献ブロックの内部・直前直後には置かない */
.single .entry-content [aria-labelledby="impact"] :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content footer :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  display: none !important;
}
.single .entry-content [aria-labelledby="impact"] + :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed),
.single .entry-content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed) + footer{
  margin-top: 18px !important;
}

/* 7) 予防線: Googleの自動挿入 ins がインライン化しても崩れないように */
.single .entry-content ins.adsbygoogle{
  display: block !important;
  width: 100% !important;
  min-height: 0 !important;
}

/* 8) レイアウトの破綻防止（段組や印刷も考慮） */
.single .entry-content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  break-inside: avoid;
  page-break-inside: avoid;
}

/* 9) 連続広告の間延び対策（自動挿入が続いた場合の圧縮） */
.single .entry-content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed)
  + :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  margin-top: 10px !important;  /* 連番では控えめに */
}

/* 10) 共有ボタン(AddToAny)と広告の干渉を抑止（クリック領域の誤爆予防） */
.single .entry-content .addtoany_content :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  display: none !important;
}
.single .entry-content .addtoany_content + :is(.adsbygoogle, ins.adsbygoogle, .google-auto-placed){
  margin-top: 12px !important;
}

/* 11) 参考まで: 既存の広告スタイルを上書き（再掲・強化版） */
.single .entry-content .adsbygoogle{
  display:block !important;
  margin: 16px auto !important;
  max-width: 100% !important;
  clear: both !important;
  border: 0 !important;
  background: transparent !important;
}


/* 多言語注意書きの控えめスタイル */
.translate-note{
  font-size: 0.95em;
  color: var(--ab-muted, #475569);
  background: linear-gradient(180deg,#f8fafc,#f1f5f9);
  border-left: 3px solid var(--ab-accent, #0b66c3);
  padding: .6rem .8rem;
  border-radius: 8px;
  margin: .6rem 0 .8rem;
}