/* ===========================================
   af-final.css (SE100) v2025-10R-stable R2
   - 見出しブロックを薄赤の面で統一
   - 比較表：ヘッダ行＋1列目を薄赤で安定
   =========================================== */

/* ---------- 基本変数（デフォルト：薄赤） ---------- */
:root{
  --af-focus:#1a73e8;     /* フォーカス枠（固定） */
  --af-internal:#0b57d0;  /* 内部リンク/内部CTA（固定） */

  /* 可変：記事ごとに <body data-theme="..."> で切替 */
  --af-heading:#d95c5c;     /* 見出し文字色（h2） */
  --af-subheading:#e57373;  /* 見出し文字色（h3） */
  --af-accent-bg:#fff1f1;   /* 薄赤の面 */
  --af-accent-border:#f2b8b8;

  /* CTA（外部） */
  --af-cta:#ff8a00;
  --af-cta-hover:#ea7a00;
}

/* ---------- テーマ切替（任意） ---------- */
body[data-theme="rose"]{ --af-heading:#e85b81; --af-subheading:#f48fb1; --af-accent-bg:#fff0f5; --af-accent-border:#f7b0c8; }
body[data-theme="peach"]{ --af-heading:#e67e22; --af-subheading:#f39c12; --af-accent-bg:#fff4e6; --af-accent-border:#ffd3a6; }
body[data-theme="aqua"]{  --af-heading:#1e88e5; --af-subheading:#42a5f5; --af-accent-bg:#eef6ff; --af-accent-border:#bdd7ff; }

/* ---------- A11y 基礎 ---------- */
:focus-visible{outline:3px solid var(--af-focus);outline-offset:2px;box-shadow:0 0 0 3px rgba(26,115,232,.25)}
:focus:not(:focus-visible){outline:none;box-shadow:none}
img,svg,video{max-width:100%;height:auto}
h2,h3,h4,[id]{scroll-margin-top:80px}

/* =======================================================
   見出し（“文章”ではなくブロックとしての見出しを統一）
   - 余白を含む面塗り＋左線で安定
   ======================================================= */
.entry-content h2,.p-entry__content h2{
  color:var(--af-heading);
  background:var(--af-accent-bg);
  border:1px solid var(--af-accent-border);
  border-left:6px solid var(--af-heading);
  border-radius:8px;
  padding:.9rem 1rem;
  margin:1.8rem 0 1rem;
  font-weight:700; line-height:1.35;
}
.entry-content h3,.p-entry__content h3{
  color:var(--af-subheading);
  background:var(--af-accent-bg);
  border:1px dashed var(--af-accent-border);
  border-left:5px solid var(--af-subheading);
  border-radius:8px;
  padding:.7rem .9rem;
  margin:1.4rem 0 .8rem;
  font-weight:700; line-height:1.4;
}
/* 見出し内リンクは色継承（青化しない） */
.entry-content h1 a,.entry-content h2 a,.entry-content h3 a{color:currentColor;text-decoration:none}

/* ---------- 本文リンク（内部のみ固定青） ---------- */
.entry-content a[href^="/"],
.entry-content a[href*="jibunreboot.com"]{ color:var(--af-internal); }

/* 目次や見出し内は青化しない免疫 */
.af-toc a,.entry-content h2 a,.entry-content h3 a{
  color:inherit !important;background:none !important;border:none !important;box-shadow:none !important;
}

/* ---------- 一覧（カード/新着）は黒文字で固定 ---------- */
.entry-card .entry-card-title a,
.entry-cards .entry-card-title a,
.widget-entry-cards .entry-card-title a,
.index-title a,
.archive .large-thumb .entry-card-title a{ color:#222 !important; }

/* ---------- CTA（内部＝青 / 外部＝オレンジ） ---------- */
:not(a).af-btn,:not(a).btn-nav{background:initial !important;color:inherit !important;border:initial !important;box-shadow:none !important;text-decoration:none !important;}
a.btn-nav,.entry-content a.btn-nav,.wp-block-button__link.btn-nav{
  display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:10px 16px;border-radius:8px;
  background:var(--af-internal) !important;color:#fff !important;border:none !important;text-decoration:none !important;font-weight:700;line-height:1.2;
}
a.btn-nav:hover,.wp-block-button__link.btn-nav:hover{background:#0948b0 !important}
a.af-btn,.entry-content a.af-btn,.wp-block-button__link.af-btn{
  display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:10px 16px;border-radius:8px;
  background:var(--af-cta) !important;color:#fff !important;border:none !important;text-decoration:none !important;font-weight:700;line-height:1.2;
}
a.af-btn:hover,.wp-block-button__link.af-btn:hover{background:var(--af-cta-hover) !important}

/* Sticky CTA（枠・薄黒） */
.af-sticky-cta{position:sticky;bottom:0;z-index:30;background:#fff;padding:12px 12px 16px;border-top:1px solid rgba(0,0,0,.15)}
.af-sticky-cta .af-btn,.af-sticky-cta .btn-nav{width:100%}

/* セルフチェック（白・黒文字） */
.af-selfcheck,.af-selfcheck .wp-block-button__link{
  display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;border-radius:8px;
  background:#fff !important;color:#111 !important;border:1px solid rgba(0,0,0,.35) !important;font-weight:700;text-decoration:none !important;
}

/* =======================================================
   比較表（class あり/なし両対応で安定）
   - thead（ヘッダ行）と1列目（見出し列）を薄赤
   - 罫線は薄赤
   ======================================================= */

/* 「クラス付け可能な表」は .af-soft を推奨 */
.entry-content table.af-soft,
.entry-content table{ border-collapse:separate; border-spacing:0; }
.entry-content table.af-soft th,
.entry-content table.af-soft td,
.entry-content table th,
.entry-content table td{ border:1px solid var(--af-accent-border); }

/* ヘッダ行（thead） */
.entry-content table thead th{ background:var(--af-accent-bg); font-weight:700; }

/* 1列目（行見出し）— thでもtdでも対応 */
.entry-content table tbody th:first-child,
.entry-content table tbody td:first-child{ background:var(--af-accent-bg); font-weight:700; }

/* .af-soft のときは2列目以降は白に戻す（必要なら） */
.entry-content table.af-soft td:not(:first-child),
.entry-content table.af-soft th:not(:first-child){ background:#fff; }

/* ---------- 目次 ---------- */
.af-toc{border:2px solid var(--af-accent-border);background:var(--af-accent-bg);border-radius:12px;padding:16px;margin:24px 0}
.af-toc__title{color:var(--af-heading);font-weight:700}
.af-toc__panel[hidden]{display:none}
.af-toc__toggle{display:inline-flex;gap:.6rem;align-items:center;background:none;border:none;cursor:pointer;font-weight:700}

/* ---------- 一覧の余白 ---------- */
.entry-card{margin-bottom:24px}
.widget-entry-cards .entry-card{margin-bottom:16px}

/* Debug（必要時だけ）
html::before{content:"af-final.css LOADED R2";position:fixed;z-index:99999;left:8px;bottom:8px;background:#111;color:#fff;padding:.35rem .6rem;border-radius:6px;font:600 12px/1.2 ui-sans-serif,system-ui}
*/