/* ==========================================================================
   JT Article Restyle (2026-05-04 v2) — single post body styling
   トップページと同じトンマナで記事本文を統一
   SWELL標準スタイルを完全上書きするため !important + 高特異度
   ========================================================================== */

/* ==========================================================================
   STEP 1: SWELLデフォルトを完全リセット（SWELL公式セレクタを直接ヒット）
   SWELL は :where(:not(...)) パターンと ::before で見出し装飾を作っているため、
   同じセレクタで打ち消す
   ========================================================================== */

/* H2: 紫の上下border + 背景色を消す */
.post_content h2:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title)){
  background:none !important;
  background-color:transparent !important;
  padding:0 !important;
  color:inherit !important;
  border:none !important;
}
.post_content h2:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title))::before{
  content:none !important;
  display:none !important;
  border:none !important;
  background:none !important;
  width:0 !important;
  height:0 !important;
}

/* H3: 上の2pxラインを消す */
.post_content h3:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title)){
  padding:0 !important;
  background:none !important;
  border:none !important;
}
.post_content h3:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title))::before{
  content:none !important;
  display:none !important;
  background:none !important;
  width:0 !important;
  height:0 !important;
}

/* H4: 左の2pxラインを消す */
.post_content h4:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title)){
  padding:0 !important;
  border:none !important;
  background:none !important;
}
.post_content h4:where(:not([class^="swell-block-"]):not(.faq_q):not(.p-postList__title))::before{
  content:none !important;
  display:none !important;
}

/* ==========================================================================
   STEP 2: 自前の和テイストスタイルで描き直し
   ========================================================================== */

/* ---------- カラートークン定義（変数注入） ---------- */
.single-post .post_content,
.single article .post_content,
body.single-post .post_content{
  --jta-paper:#fffdf7;
  --jta-soft:#f4efe4;
  --jta-line:#e4d9c8;
  --jta-line-soft:#efe7d6;
  --jta-ink:#182026;
  --jta-text:#2a3338;
  --jta-muted:#69716a;
  --jta-deep:#24382f;
  --jta-green:#49684e;
  --jta-gold:#a27a3d;
  --jta-gold-soft:#c9a96b;
  --jta-font-mincho:"Yu Mincho","Hiragino Mincho ProN","Noto Serif JP",serif;
  --jta-font-body:"Noto Sans JP","Hiragino Kaku Gothic ProN",sans-serif;
}

/* ---------- 本文ベース ---------- */
body.single-post .post_content,
.single-post .post_content,
.single article .post_content{
  color:var(--jta-text) !important;
  font-family:var(--jta-font-body) !important;
  font-size:16px !important;
  line-height:2 !important;
  letter-spacing:.04em !important;
  background:transparent !important;
}

/* ---------- 見出し H2 ---------- */
body.single-post .post_content h2,
.single-post .post_content h2,
.single article .post_content h2,
.single-post .post_content > h2,
.single-post .post_content .wp-block-heading.h2,
.single-post .post_content h2.wp-block-heading{
  position:relative !important;
  margin:2.6em 0 1em !important;
  padding:.4em 0 .55em 1.1em !important;
  border:none !important;
  border-left:4px solid var(--jta-gold) !important;
  background:none !important;
  background-image:none !important;
  background-color:transparent !important;
  font-family:var(--jta-font-mincho) !important;
  font-weight:500 !important;
  font-size:26px !important;
  line-height:1.55 !important;
  letter-spacing:.07em !important;
  color:var(--jta-ink) !important;
  text-shadow:none !important;
}
body.single-post .post_content h2::before{
  content:"" !important;
  display:none !important;
}
body.single-post .post_content h2::after,
.single-post .post_content h2::after{
  content:"" !important;
  position:absolute !important;
  left:0 !important;
  bottom:-1px !important;
  width:100% !important;
  height:1px !important;
  background:linear-gradient(90deg,var(--jta-line),transparent) !important;
  border:none !important;
}

/* ---------- 見出し H3 ---------- */
body.single-post .post_content h3,
.single-post .post_content h3,
.single article .post_content h3,
.single-post .post_content h3.wp-block-heading{
  margin:2.2em 0 .8em !important;
  padding:0 0 .4em !important;
  border:none !important;
  border-bottom:1px dotted var(--jta-gold-soft) !important;
  background:none !important;
  background-image:none !important;
  background-color:transparent !important;
  font-family:var(--jta-font-mincho) !important;
  font-weight:500 !important;
  font-size:21px !important;
  line-height:1.55 !important;
  letter-spacing:.06em !important;
  color:var(--jta-deep) !important;
}
body.single-post .post_content h3::before{
  content:"" !important;
  display:none !important;
}

/* ---------- 見出し H4 ---------- */
body.single-post .post_content h4,
.single-post .post_content h4,
.single article .post_content h4,
.single-post .post_content h4.wp-block-heading{
  margin:1.8em 0 .6em !important;
  padding:0 0 0 .8em !important;
  border:none !important;
  border-left:2px solid var(--jta-gold-soft) !important;
  background:none !important;
  background-image:none !important;
  background-color:transparent !important;
  font-family:var(--jta-font-mincho) !important;
  font-weight:500 !important;
  font-size:17px !important;
  line-height:1.5 !important;
  letter-spacing:.06em !important;
  color:var(--jta-deep) !important;
}

/* ---------- 本文段落 ---------- */
body.single-post .post_content p,
.single-post .post_content p,
.single article .post_content p{
  margin:0 0 1.4em !important;
  line-height:2 !important;
  color:var(--jta-text) !important;
  text-wrap:pretty;
  line-break:strict;
}

/* ---------- 強調 ---------- */
body.single-post .post_content strong,
body.single-post .post_content b,
.single-post .post_content strong,
.single-post .post_content b{
  font-weight:500 !important;
  color:var(--jta-deep) !important;
  background:linear-gradient(transparent 70%,rgba(162,122,61,.18) 70%) !important;
  padding:0 2px !important;
}

/* SWELL マーカー（黄色）はそのまま */
body.single-post .post_content .swl-marker,
.single-post .post_content .swl-marker{
  background:linear-gradient(transparent 60%,rgba(247,213,108,.55) 60%) !important;
}

/* ---------- リンク ---------- */
body.single-post .post_content a,
.single-post .post_content a,
.single article .post_content a{
  color:var(--jta-deep) !important;
  border-bottom:1px solid var(--jta-gold-soft) !important;
  text-decoration:none !important;
  transition:color .2s,border-color .2s;
}
body.single-post .post_content a:hover,
.single-post .post_content a:hover{
  color:var(--jta-gold) !important;
  border-bottom-color:var(--jta-gold) !important;
}
/* CTAボタン内のリンク・吹き出し内リンクは除外 */
body.single-post .post_content .jt-balloon a,
body.single-post .post_content a[style*="linear-gradient"],
.single-post .post_content a[style*="linear-gradient"]{
  border-bottom:none !important;
}

/* ---------- リスト UL ---------- */
body.single-post .post_content ul,
.single-post .post_content ul,
.single article .post_content ul{
  margin:1em 0 1.6em !important;
  padding:0 !important;
  list-style:none !important;
}
body.single-post .post_content ul > li,
.single-post .post_content ul > li,
.single article .post_content ul > li{
  position:relative !important;
  padding:.2em 0 .2em 1.5em !important;
  line-height:2 !important;
  list-style:none !important;
  background:none !important;
}
body.single-post .post_content ul > li::before,
.single-post .post_content ul > li::before{
  content:"" !important;
  position:absolute !important;
  left:0 !important;
  top:1.05em !important;
  width:8px !important;
  height:8px !important;
  border:1px solid var(--jta-gold) !important;
  background:var(--jta-paper) !important;
  transform:rotate(45deg) !important;
  border-radius:0 !important;
}
body.single-post .post_content ul > li::marker,
.single-post .post_content ul > li::marker{content:"" !important}

/* ---------- リスト OL ---------- */
body.single-post .post_content ol,
.single-post .post_content ol,
.single article .post_content ol{
  margin:1em 0 1.6em !important;
  padding-left:0 !important;
  counter-reset:jta-item !important;
  list-style:none !important;
}
body.single-post .post_content ol > li,
.single-post .post_content ol > li,
.single article .post_content ol > li{
  position:relative !important;
  padding:.2em 0 .2em 2.4em !important;
  line-height:2 !important;
  counter-increment:jta-item !important;
  list-style:none !important;
  background:none !important;
}
body.single-post .post_content ol > li::before,
.single-post .post_content ol > li::before{
  content:counter(jta-item) !important;
  position:absolute !important;
  left:0 !important;
  top:.55em !important;
  width:1.7em !important;
  height:1.7em !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border:1px solid var(--jta-gold) !important;
  border-radius:50% !important;
  background:var(--jta-paper) !important;
  font-family:var(--jta-font-mincho) !important;
  font-size:.85em !important;
  color:var(--jta-gold) !important;
  letter-spacing:0 !important;
}
body.single-post .post_content ol > li::marker{content:"" !important}

/* ---------- 引用 ---------- */
body.single-post .post_content blockquote,
.single-post .post_content blockquote,
.single article .post_content blockquote{
  position:relative !important;
  margin:1.5em 0 !important;
  padding:1em 1.4em 1em 1.8em !important;
  border:none !important;
  border-left:3px solid var(--jta-gold) !important;
  background:rgba(244,239,228,.45) !important;
  background-image:none !important;
  color:var(--jta-text) !important;
  font-family:var(--jta-font-mincho) !important;
  font-style:normal !important;
  border-radius:0 4px 4px 0 !important;
  box-shadow:none !important;
}
body.single-post .post_content blockquote::before,
body.single-post .post_content blockquote::after{content:none !important}
body.single-post .post_content blockquote p:last-child,
.single-post .post_content blockquote p:last-child{margin-bottom:0 !important}

/* ---------- テーブル ---------- */
body.single-post .post_content table,
body.single-post .post_content .wp-block-table table,
.single-post .post_content table,
.single article .post_content table{
  width:100% !important;
  margin:1.5em 0 !important;
  border-collapse:collapse !important;
  border:1px solid var(--jta-line) !important;
  background:var(--jta-paper) !important;
  font-size:14.5px !important;
  line-height:1.85 !important;
  box-shadow:0 8px 22px rgba(84,69,42,.06) !important;
}
body.single-post .post_content table thead th,
.single-post .post_content table thead th,
.single article .post_content table thead th{
  padding:14px 16px !important;
  background:var(--jta-deep) !important;
  background-image:none !important;
  color:#f6f1e6 !important;
  font-family:var(--jta-font-mincho) !important;
  font-weight:500 !important;
  letter-spacing:.06em !important;
  text-align:left !important;
  border:none !important;
}
body.single-post .post_content table tbody th,
.single-post .post_content table tbody th{
  padding:12px 16px !important;
  background:var(--jta-soft) !important;
  font-family:var(--jta-font-mincho) !important;
  font-weight:500 !important;
  text-align:left !important;
  border:1px solid var(--jta-line) !important;
  color:var(--jta-deep) !important;
}
body.single-post .post_content table tbody td,
.single-post .post_content table tbody td{
  padding:12px 16px !important;
  border:1px solid var(--jta-line) !important;
  vertical-align:top !important;
  background:transparent !important;
}
body.single-post .post_content table tbody tr:nth-child(even) td,
.single-post .post_content table tbody tr:nth-child(even) td{
  background:rgba(244,239,228,.32) !important;
}

/* ---------- 装飾ボックス（4色を和テイストに） ---------- */
body.single-post .post_content div[style*="border-left"][style*="#3498db"],
body.single-post .post_content div[style*="background:#f0f8ff"]{
  border-left-color:var(--jta-deep) !important;
  background:rgba(36,56,47,.04) !important;
  border-radius:4px !important;
  padding:1em 1.3em !important;
  font-family:var(--jta-font-body) !important;
}
body.single-post .post_content div[style*="border-left"][style*="#e74c3c"],
body.single-post .post_content div[style*="background:#fff5f5"]{
  border-left-color:#a64b3a !important;
  background:rgba(166,75,58,.05) !important;
  border-radius:4px !important;
  padding:1em 1.3em !important;
}
body.single-post .post_content div[style*="border-left"][style*="#27ae60"],
body.single-post .post_content div[style*="background:#f0fff4"]{
  border-left-color:var(--jta-green) !important;
  background:rgba(73,104,78,.06) !important;
  border-radius:4px !important;
  padding:1em 1.3em !important;
}
body.single-post .post_content div[style*="border-left"][style*="#f39c12"],
body.single-post .post_content div[style*="background:#fffbf0"]{
  border-left-color:var(--jta-gold) !important;
  background:rgba(162,122,61,.06) !important;
  border-radius:4px !important;
  padding:1em 1.3em !important;
}

/* ---------- 画像 ---------- */
body.single-post .post_content img,
.single-post .post_content img,
.single article .post_content img{
  max-width:100% !important;
  height:auto !important;
  border-radius:4px !important;
  box-shadow:0 10px 26px rgba(84,69,42,.1) !important;
}
body.single-post .post_content figure,
.single-post .post_content figure{margin:1.6em 0 !important}
body.single-post .post_content figcaption,
.single-post .post_content figcaption{
  margin-top:.6em !important;
  text-align:center !important;
  font-size:12px !important;
  color:var(--jta-muted) !important;
  letter-spacing:.06em !important;
}

/* ---------- HR ---------- */
body.single-post .post_content hr,
.single-post .post_content hr{
  margin:2.5em 0 !important;
  border:none !important;
  height:1px !important;
  background:linear-gradient(90deg,transparent,var(--jta-line) 20%,var(--jta-line) 80%,transparent) !important;
}

/* ---------- FAQ（SWELL） ---------- */
body.single-post .post_content .swell-block-faq,
.single-post .post_content .swell-block-faq{
  margin:1em 0 !important;
  border:1px solid var(--jta-line) !important;
  border-radius:6px !important;
  background:var(--jta-paper) !important;
  overflow:hidden !important;
  box-shadow:0 6px 16px rgba(84,69,42,.05) !important;
}
body.single-post .post_content .swell-block-faq__q,
.single-post .post_content .swell-block-faq__q{
  padding:14px 18px !important;
  background:var(--jta-soft) !important;
  border-bottom:1px solid var(--jta-line) !important;
  font-family:var(--jta-font-mincho) !important;
  font-weight:500 !important;
  font-size:16px !important;
  color:var(--jta-deep) !important;
  letter-spacing:.05em !important;
}
body.single-post .post_content .swell-block-faq__a,
.single-post .post_content .swell-block-faq__a{
  padding:14px 18px !important;
  color:var(--jta-text) !important;
  line-height:1.95 !important;
}

/* ---------- 免責事項枠 ---------- */
body.single-post .post_content div[style*="background:#f9f9f9"],
.single-post .post_content div[style*="background:#f9f9f9"]{
  background:var(--jta-soft) !important;
  border:1px solid var(--jta-line) !important;
  border-radius:4px !important;
  font-family:var(--jta-font-body) !important;
  color:var(--jta-muted) !important;
}

/* ---------- 目次 (SWELL TOC) は和テイストに ---------- */
body.single-post .p-toc,
.p-toc.post_content{
  border:1px solid var(--jta-line) !important;
  background:var(--jta-paper) !important;
  border-radius:6px !important;
  font-family:var(--jta-font-body) !important;
  box-shadow:0 6px 16px rgba(84,69,42,.05) !important;
}
body.single-post .p-toc__title,
.p-toc__title{
  font-family:var(--jta-font-mincho) !important;
  color:var(--jta-deep) !important;
  letter-spacing:.06em !important;
}

/* ==========================================================================
   STEP 3: Container Exemptions
   --------------------------------------------------------------------------
   .post_content 直下の汎用ルール (p/strong/a/li 等) が
   サブコンテナの中身まで踏み潰すのを防ぐ。最後に書いて確実に勝つ。
   ========================================================================== */

/* ---------- 吹き出し（読者・通常） ---------- */
body.single-post .post_content .jt-balloon__body,
body.single-post .post_content .jt-balloon__body p{
  color:#182026 !important;
}
body.single-post .post_content .jt-balloon__body strong{
  color:inherit !important;
  background:none !important;
  font-weight:600 !important;
  padding:0 !important;
}
body.single-post .post_content .jt-balloon__body a{
  color:#a27a3d !important;
  border-bottom:1px dotted #a27a3d !important;
}
body.single-post .post_content .jt-balloon__body p{
  margin:0 !important;
}
body.single-post .post_content .jt-balloon__body p + p{
  margin-top:.6em !important;
}

/* ---------- 吹き出し（ガイド・深緑背景） ---------- */
body.single-post .post_content .jt-balloon.is-guide .jt-balloon__body,
body.single-post .post_content .jt-balloon.is-guide .jt-balloon__body p{
  color:#f6f1e6 !important;
}
body.single-post .post_content .jt-balloon.is-guide .jt-balloon__body strong{
  color:#fff !important;
  background:none !important;
  font-weight:600 !important;
  padding:0 !important;
}
body.single-post .post_content .jt-balloon.is-guide .jt-balloon__body a{
  color:#f7d56c !important;
  border-bottom:1px dotted rgba(247,213,108,.6) !important;
}

/* ---------- 装飾ボックス: ラベル文字色を和テイストに ---------- */
body.single-post .post_content div[style*="border-left"] > p:first-child{
  color:#24382f !important;
  font-family:var(--jta-font-mincho) !important;
  letter-spacing:.06em !important;
  margin:0 0 .5em !important;
}
body.single-post .post_content div[style*="background:#fff5f5"] > p:first-child,
body.single-post .post_content div[style*="#e74c3c"] > p:first-child{
  color:#a64b3a !important;
}
body.single-post .post_content div[style*="background:#f0fff4"] > p:first-child,
body.single-post .post_content div[style*="#27ae60"] > p:first-child{
  color:#49684e !important;
}
body.single-post .post_content div[style*="background:#fffbf0"] > p:first-child,
body.single-post .post_content div[style*="#f39c12"] > p:first-child{
  color:#a27a3d !important;
}
body.single-post .post_content div[style*="border-left"] p{
  margin:0 0 .6em !important;
}
body.single-post .post_content div[style*="border-left"] p:last-child{
  margin-bottom:0 !important;
}

/* ---------- CTA 周辺の inline 色を和テイストへ吸収 ---------- */
body.single-post .post_content p[style*="color:#e67e22"]{
  color:#a27a3d !important;
  font-family:var(--jta-font-mincho) !important;
  letter-spacing:.18em !important;
}
body.single-post .post_content p[style*="color:#888"]{
  color:#69716a !important;
}

/* ---------- CTAボタン（オレンジ）: 角・字体だけ和テイストに寄せる ---------- */
body.single-post .post_content a[style*="linear-gradient"]{
  border-radius:4px !important;
  font-family:var(--jta-font-mincho) !important;
  letter-spacing:.12em !important;
  font-weight:500 !important;
  border-bottom:none !important;
}

/* ---------- テーブル内の strong/a の装飾を抑制 ---------- */
body.single-post .post_content table thead th strong,
body.single-post .post_content table thead th a{
  color:#f6f1e6 !important;
  background:none !important;
  border-bottom:1px solid rgba(246,241,230,.4) !important;
}
body.single-post .post_content table tbody strong{
  background:none !important;
  font-weight:500 !important;
}
/* テーブル内 tr の縞模様コントラスト改善 */
body.single-post .post_content table tbody tr:nth-child(even) td{
  background:rgba(228,217,200,.18) !important;
}
/* テーブル内のリスト位置調整 */
body.single-post .post_content table ul,
body.single-post .post_content table ol{
  margin:.4em 0 !important;
}
body.single-post .post_content table li{
  padding-left:1.2em !important;
}
body.single-post .post_content table li::before{
  left:.2em !important;
}

/* ---------- 免責事項枠: コントラスト改善（高齢ユーザー想定） ---------- */
body.single-post .post_content div[style*="background:#f9f9f9"]{
  color:#3c473f !important;
  padding:1.1em 1.3em !important;
}
body.single-post .post_content div[style*="background:#f9f9f9"] p{
  color:#3c473f !important;
  font-size:.92em !important;
}

/* ---------- 公的機関リンクボックス（jt-primary-sources） ---------- */
body.single-post .post_content .jt-primary-sources{
  background:rgba(244,239,228,.55) !important;
  border:1px solid var(--jta-line) !important;
  border-left:3px solid var(--jta-gold) !important;
  border-radius:4px !important;
}
body.single-post .post_content .jt-primary-sources p:first-child{
  color:var(--jta-deep) !important;
  font-family:var(--jta-font-mincho) !important;
}
body.single-post .post_content .jt-primary-sources a{
  color:var(--jta-deep) !important;
  border-bottom:1px dotted var(--jta-gold-soft) !important;
}
body.single-post .post_content .jt-primary-sources a:hover{
  color:var(--jta-gold) !important;
}

/* ---------- 目次（SWELL p-toc）リンク ---------- */
body.single-post .p-toc a,
body.single-post .p-toc__list a,
body.single-post .post_content .p-toc a{
  color:var(--jta-deep) !important;
  border-bottom:none !important;
  text-decoration:none !important;
}
body.single-post .p-toc a:hover,
body.single-post .post_content .p-toc a:hover{
  color:var(--jta-gold) !important;
}

/* ---------- 引用内 strong: 装飾無効化 ---------- */
body.single-post .post_content blockquote strong{
  background:none !important;
  color:var(--jta-deep) !important;
  font-weight:500 !important;
  padding:0 !important;
}

/* ---------- FAQ内 strong/a の装飾抑制 ---------- */
body.single-post .post_content .swell-block-faq strong{
  background:none !important;
  font-weight:500 !important;
  color:var(--jta-deep) !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width:768px){
  body.single-post .post_content,
  .single-post .post_content,
  .single article .post_content{font-size:15px !important;line-height:1.95 !important}
  body.single-post .post_content h2,
  .single-post .post_content h2{font-size:22px !important;padding-left:.9em !important}
  body.single-post .post_content h3,
  .single-post .post_content h3{font-size:18px !important}
  body.single-post .post_content h4,
  .single-post .post_content h4{font-size:15.5px !important}
  body.single-post .post_content table,
  .single-post .post_content table{font-size:13.5px !important}
  body.single-post .post_content table thead th,
  body.single-post .post_content table tbody th,
  body.single-post .post_content table tbody td,
  .single-post .post_content table thead th,
  .single-post .post_content table tbody th,
  .single-post .post_content table tbody td{padding:10px 12px !important}
}
