/* ============================================================
   #bcw.mg-edition — 新世代マガジン記事デザイン
   スコープ: #bcw.mg-edition 配下のみ（既存 bcw / nx-* と非干渉）
   作成: 2026-04-19 / 設計: mobile-first・読みやすさ最優先

   ▼ 適用方法
   新記事の本文を <div id="bcw" class="mg-edition"> ... </div> で囲む。
   既存378記事（mg-edition クラスなし）には一切影響しない。

   ▼ コンポーネント
   .mg-lead          リード文
   .mg-toc           目次
   .mg-sec           セクション本体
   .mg-sec__num      "SECTION 01" ナンバー
   .mg-sec__title    H2 見出し
   .mg-h3            H3 サブ見出し
   .mg-callout       吹き出し（tip / .mg-callout--warn / .mg-callout--ok）
   .mg-highlight     核心フレーズ
   .mg-checklist     番号つきチェックリスト
   .mg-figure        画像 + キャプション
   .mg-table-wrap    テーブル（モバイル横スクロール）
   .mg-faq           FAQ（details/summary）
   .mg-related       関連記事カード
   .mg-cta           CTA ブロック

   ▼ 注意
   - タイトル(h1.stitle)、監修者(.author-box)は theme 側固定。mg-edition は触らない
   - フォント: Noto Sans JP, DM Sans（テーマで既ロード済前提）
   ============================================================ */

#bcw.mg-edition {
  /* ---- カラートークン ---- */
  --ink:        #1a1814;
  --ink-2:      #3a3630;
  --ink-3:      #6b655c;
  --ink-4:      #9e978d;
  --paper:      #fbfaf6;
  --paper-2:    #ffffff;
  --rule:       #e7e1d6;
  --rule-soft:  #f0ebe2;
  --accent:     #9D643E;
  --accent-dp:  #704324;
  --accent-sf:  #f4ecde;
  --accent-tk:  #fbf5ea;
  --highlight:  #fff3c7;
  --ok:         #4a7a40;
  --warn:       #b46a1f;

  /* ---- タイポトークン ---- */
  --font-ja:    'Noto Sans JP', -apple-system, 'Hiragino Sans', sans-serif;
  --font-en:    'DM Sans', 'Noto Sans JP', sans-serif;

  /* ---- 動き ---- */
  --dur-quick:  180ms;
  --ease:       cubic-bezier(.22,.61,.36,1);

  /* ---- ベース ---- */
  font-family: var(--font-ja);
  font-feature-settings: "palt" 1;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.015em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;

  /* 親（テーマカラム）幅にぴったり追従。自身に max-width を持たない
     親テーマが左右 5% padding を持つので mg-edition 側は左右 0 で二重パディングを避ける */
  width: 100%;
  max-width: 100%;
  padding: 32px 0 56px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  #bcw.mg-edition { font-size: 17px; padding: 48px 0 80px; }
}

#bcw.mg-edition * { box-sizing: border-box; }
#bcw.mg-edition img { max-width: 100%; height: auto; display: block; }
#bcw.mg-edition a {
  color: var(--accent-dp);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-sf);
  transition: border-color var(--dur-quick) var(--ease);
}
#bcw.mg-edition a:hover { border-bottom-color: var(--accent); }
#bcw.mg-edition strong { font-weight: 700; color: var(--ink); }
#bcw.mg-edition em {
  font-style: normal;
  background: linear-gradient(transparent 65%, var(--highlight) 65%);
  padding: 0 2px;
}

/* ============================================================
   本文基本
   ============================================================ */
#bcw.mg-edition p {
  margin: 0 0 1.5em;
  line-height: 1.95;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
  line-break: strict;
}
#bcw.mg-edition p:last-child { margin-bottom: 0; }
#bcw.mg-edition ul, #bcw.mg-edition ol { margin: 0 0 1.5em; padding-left: 1.5em; }
#bcw.mg-edition li { margin: 0 0 0.5em; line-height: 1.9; word-break: auto-phrase; }

/* ============================================================
   ① LEAD
   ============================================================ */
#bcw.mg-edition .mg-lead {
  margin: 0 0 48px;
  padding-left: 18px;
  position: relative;
}
#bcw.mg-edition .mg-lead::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--accent);
}
#bcw.mg-edition .mg-lead p {
  font-size: 16px;
  line-height: 2;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  margin: 0 0 1em;
}
#bcw.mg-edition .mg-lead p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  #bcw.mg-edition .mg-lead { padding-left: 24px; margin-bottom: 64px; }
  #bcw.mg-edition .mg-lead p { font-size: 17.5px; }
}

/* ============================================================
   ② TOC
   ============================================================ */
#bcw.mg-edition .mg-toc {
  background: var(--accent-tk);
  border-radius: 4px;
  padding: 22px 20px;
  margin: 0 0 56px;
  border: 1px solid var(--rule-soft);
}
#bcw.mg-edition .mg-toc__head {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
#bcw.mg-edition .mg-toc__head svg {
  width: 14px; height: 14px;
  stroke: var(--accent); stroke-width: 1.5; fill: none;
}
#bcw.mg-edition .mg-toc__list {
  list-style: none; padding: 0; margin: 0; counter-reset: toc;
}
#bcw.mg-edition .mg-toc__list li {
  counter-increment: toc;
  border-top: 1px solid var(--rule-soft);
  margin: 0; padding: 0;
}
#bcw.mg-edition .mg-toc__list li:first-child { border-top: 0; }
#bcw.mg-edition .mg-toc__list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  color: var(--ink);
  border-bottom: 0;
  font-size: 13.5px;
  line-height: 1.6;
  transition: color var(--dur-quick) var(--ease);
}
#bcw.mg-edition .mg-toc__list a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.08em;
  flex-shrink: 0;
  min-width: 22px;
}
#bcw.mg-edition .mg-toc__list a:hover { color: var(--accent-dp); }
@media (min-width: 768px) {
  #bcw.mg-edition .mg-toc { padding: 26px 26px; margin-bottom: 80px; }
  #bcw.mg-edition .mg-toc__list a { font-size: 14.5px; padding: 13px 0; }
}

/* ============================================================
   ③ セクション
   ============================================================ */
#bcw.mg-edition .mg-sec { margin: 0 0 64px; scroll-margin-top: 24px; }
@media (min-width: 768px) { #bcw.mg-edition .mg-sec { margin-bottom: 96px; } }

#bcw.mg-edition .mg-sec__num {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 8px;
}
#bcw.mg-edition .mg-sec__title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  word-break: auto-phrase;
}
@media (min-width: 768px) {
  #bcw.mg-edition .mg-sec__title {
    font-size: 26px; margin-bottom: 32px; padding-bottom: 20px;
  }
}

#bcw.mg-edition .mg-h3 {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  margin: 40px 0 14px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
  word-break: auto-phrase;
}
@media (min-width: 768px) {
  #bcw.mg-edition .mg-h3 { font-size: 19px; margin-top: 48px; }
}

/* ============================================================
   ④ Callout
   ============================================================ */
#bcw.mg-edition .mg-callout {
  display: flex;
  gap: 12px;
  padding: 18px 18px;
  margin: 28px 0;
  border-radius: 4px;
  background: var(--accent-tk);
  border-left: 3px solid var(--accent);
  align-items: flex-start;
}
#bcw.mg-edition .mg-callout__icon {
  width: 20px; height: 20px;
  stroke: var(--accent); stroke-width: 1.5; fill: none;
  flex-shrink: 0;
  margin-top: 3px;
}
#bcw.mg-edition .mg-callout__body { flex: 1; min-width: 0; }
#bcw.mg-edition .mg-callout__title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-dp);
  margin: 0 0 6px;
}
#bcw.mg-edition .mg-callout__body p {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 0 0 0.7em;
}
#bcw.mg-edition .mg-callout__body p:last-child { margin-bottom: 0; }
@media (min-width: 768px) {
  #bcw.mg-edition .mg-callout { padding: 22px 24px; gap: 16px; }
  #bcw.mg-edition .mg-callout__body p { font-size: 14.5px; }
}

#bcw.mg-edition .mg-callout--warn {
  background: #fdf4e8;
  border-left-color: var(--warn);
}
#bcw.mg-edition .mg-callout--warn .mg-callout__icon { stroke: var(--warn); }
#bcw.mg-edition .mg-callout--warn .mg-callout__title { color: var(--warn); }

#bcw.mg-edition .mg-callout--ok {
  background: #eef5eb;
  border-left-color: var(--ok);
}
#bcw.mg-edition .mg-callout--ok .mg-callout__icon { stroke: var(--ok); }
#bcw.mg-edition .mg-callout--ok .mg-callout__title { color: var(--ok); }

/* ============================================================
   ⑤ ハイライト文
   ============================================================ */
#bcw.mg-edition .mg-highlight {
  display: block;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.85;
  color: var(--ink);
  margin: 36px 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--ink);
  letter-spacing: 0.01em;
  word-break: auto-phrase;
}
@media (min-width: 768px) {
  #bcw.mg-edition .mg-highlight {
    font-size: 18.5px; padding-left: 24px; margin: 48px 0;
  }
}

/* ============================================================
   ⑥ チェックリスト
   ============================================================ */
#bcw.mg-edition .mg-checklist {
  list-style: none; padding: 0; margin: 28px 0; counter-reset: chk;
}
#bcw.mg-edition .mg-checklist > li {
  counter-increment: chk;
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
#bcw.mg-edition .mg-checklist > li:last-child {
  border-bottom: 1px solid var(--rule);
}
#bcw.mg-edition .mg-checklist__num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-en);
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
#bcw.mg-edition .mg-checklist > li > div { flex: 1; min-width: 0; }
#bcw.mg-edition .mg-checklist__title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.5;
  word-break: auto-phrase;
}
#bcw.mg-edition .mg-checklist__desc {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
  margin: 0;
}
@media (min-width: 768px) {
  #bcw.mg-edition .mg-checklist > li { gap: 20px; padding: 22px 0; }
  #bcw.mg-edition .mg-checklist__title { font-size: 16.5px; }
  #bcw.mg-edition .mg-checklist__desc { font-size: 14.5px; }
}

/* ============================================================
   ⑦ 図版（カラム内）
   ============================================================ */
#bcw.mg-edition .mg-figure { margin: 36px 0; }
#bcw.mg-edition .mg-figure img { width: 100%; border-radius: 2px; }
#bcw.mg-edition .mg-figure figcaption {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  margin: 10px 0 0;
  letter-spacing: 0.02em;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
}
@media (min-width: 768px) {
  #bcw.mg-edition .mg-figure { margin: 48px 0; }
  #bcw.mg-edition .mg-figure figcaption { font-size: 12.5px; }
}

/* ============================================================
   ⑧ テーブル（横スクロール）
   ============================================================ */
#bcw.mg-edition .mg-table-wrap {
  margin: 28px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
#bcw.mg-edition .mg-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--paper-2);
}
#bcw.mg-edition .mg-table thead th {
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--ink);
  background: transparent;
}
#bcw.mg-edition .mg-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  line-height: 1.7;
  color: var(--ink-2);
  vertical-align: top;
}
#bcw.mg-edition .mg-table tbody td:first-child {
  font-weight: 700; color: var(--ink);
}
#bcw.mg-edition .mg-table tbody tr:last-child td { border-bottom: 0; }
@media (min-width: 768px) {
  #bcw.mg-edition .mg-table-wrap { margin: 40px 0; }
  #bcw.mg-edition .mg-table { font-size: 14.5px; }
  #bcw.mg-edition .mg-table thead th { padding: 14px 18px; }
  #bcw.mg-edition .mg-table tbody td { padding: 16px 18px; }
}

/* ============================================================
   ⑨ FAQ
   ============================================================ */
#bcw.mg-edition .mg-faq { margin: 22px 0; }
#bcw.mg-edition .mg-faq__item {
  border-top: 1px solid var(--rule); padding: 0;
}
#bcw.mg-edition .mg-faq__item:last-child {
  border-bottom: 1px solid var(--rule);
}
#bcw.mg-edition .mg-faq__item > summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 40px 20px 0;
  position: relative;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.6;
  word-break: auto-phrase;
  transition: color var(--dur-quick) var(--ease);
}
#bcw.mg-edition .mg-faq__item > summary::-webkit-details-marker { display: none; }
#bcw.mg-edition .mg-faq__item > summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 9px; height: 9px;
  border-right: 1.5px solid var(--accent);
  border-bottom: 1.5px solid var(--accent);
  transform: translateY(-75%) rotate(45deg);
  transition: transform var(--dur-quick) var(--ease);
}
#bcw.mg-edition .mg-faq__item[open] > summary::after {
  transform: translateY(-25%) rotate(-135deg);
}
#bcw.mg-edition .mg-faq__item > summary:hover { color: var(--accent-dp); }
#bcw.mg-edition .mg-faq__q {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin-right: 8px;
  letter-spacing: 0.08em;
  vertical-align: 1px;
}
#bcw.mg-edition .mg-faq__a-wrap {
  padding: 0 0 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
#bcw.mg-edition .mg-faq__a-wrap .mg-faq__q {
  color: var(--ink-3); margin-top: 4px;
}
#bcw.mg-edition .mg-faq__a-wrap p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.9;
  margin: 0;
}
@media (min-width: 768px) {
  #bcw.mg-edition .mg-faq__item > summary {
    font-size: 15.5px; padding: 22px 44px 22px 0;
  }
  #bcw.mg-edition .mg-faq__a-wrap p { font-size: 14.5px; }
}

/* ============================================================
   ⑩ Related Reads（内部リンク導線）
   ============================================================ */
#bcw.mg-edition .mg-related {
  margin: 64px 0 0;
  padding: 32px 0 0;
  border-top: 1px solid var(--rule);
}
#bcw.mg-edition .mg-related__head {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
#bcw.mg-edition .mg-related__head::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
  display: inline-block;
}
#bcw.mg-edition .mg-related__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 600px) {
  #bcw.mg-edition .mg-related__grid {
    grid-template-columns: 1fr 1fr; gap: 18px;
  }
}

#bcw.mg-edition .mg-card {
  display: block;
  padding: 18px 18px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color var(--dur-quick) var(--ease),
              transform var(--dur-quick) var(--ease),
              box-shadow var(--dur-quick) var(--ease);
  position: relative;
  overflow: hidden;
}
#bcw.mg-edition .mg-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--dur-quick) var(--ease);
}
#bcw.mg-edition .mg-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(157, 100, 62, 0.10);
}
#bcw.mg-edition .mg-card:hover::before { transform: scaleY(1); }
#bcw.mg-edition .mg-card__tag {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin: 0 0 8px;
}
#bcw.mg-edition .mg-card__title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 8px;
  word-break: auto-phrase;
}
#bcw.mg-edition .mg-card__desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-3);
  margin: 0 0 12px;
  word-break: auto-phrase;
}
#bcw.mg-edition .mg-card__meta {
  font-family: var(--font-en);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-4);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#bcw.mg-edition .mg-card__meta svg {
  width: 12px; height: 12px;
  stroke: var(--ink-4);
  stroke-width: 1.5;
  fill: none;
}
@media (min-width: 768px) {
  #bcw.mg-edition .mg-related { margin-top: 88px; padding-top: 40px; }
  #bcw.mg-edition .mg-card { padding: 22px 22px; }
  #bcw.mg-edition .mg-card__title { font-size: 15.5px; }
  #bcw.mg-edition .mg-card__desc { font-size: 13px; }
}

/* ============================================================
   ⑪ CTA
   ============================================================ */
#bcw.mg-edition .mg-cta {
  margin: 64px 0 0;
  padding: 32px 22px;
  background: var(--ink);
  border-radius: 4px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
#bcw.mg-edition .mg-cta::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 2px;
  background: var(--accent);
}
#bcw.mg-edition .mg-cta__eyebrow {
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}
#bcw.mg-edition .mg-cta__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: #fbfaf6;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
  word-break: auto-phrase;
}
#bcw.mg-edition .mg-cta__desc {
  font-size: 13.5px;
  line-height: 1.85;
  color: #c9c2b6;
  margin: 0 auto 22px;
  max-width: 420px;
}
#bcw.mg-edition .mg-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-bottom: 0;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: 2px;
  transition: background var(--dur-quick) var(--ease),
              transform var(--dur-quick) var(--ease);
}
#bcw.mg-edition .mg-cta__btn:hover {
  background: var(--accent-dp);
  transform: translateY(-1px);
  border-bottom: 0;
}
#bcw.mg-edition .mg-cta__btn svg {
  width: 16px; height: 16px;
  stroke: #fff; stroke-width: 1.8; fill: none;
  transition: transform var(--dur-quick) var(--ease);
}
#bcw.mg-edition .mg-cta__btn:hover svg { transform: translateX(3px); }
@media (min-width: 768px) {
  #bcw.mg-edition .mg-cta { padding: 44px 28px; margin-top: 96px; }
  #bcw.mg-edition .mg-cta__title { font-size: 22px; margin-bottom: 16px; }
  #bcw.mg-edition .mg-cta__desc { font-size: 14.5px; margin-bottom: 28px; }
  #bcw.mg-edition .mg-cta__btn { padding: 15px 32px; font-size: 14px; }
}

/* ============================================================
   入場アニメーション（軽め・reduce-motion 配慮）
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  #bcw.mg-edition .mg-lead,
  #bcw.mg-edition .mg-toc,
  #bcw.mg-edition .mg-sec,
  #bcw.mg-edition .mg-related,
  #bcw.mg-edition .mg-cta {
    opacity: 0;
    transform: translateY(10px);
    animation: mg-fadeup 0.55s var(--ease) forwards;
  }
  #bcw.mg-edition .mg-toc { animation-delay: 0.05s; }
  #bcw.mg-edition .mg-sec:nth-of-type(1) { animation-delay: 0.10s; }
}
@keyframes mg-fadeup {
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   /mg-edition end
   ============================================================ */
