/* ============================================================
   Smart（オウンドメディア）記事詳細テンプレート
   PC重視：UX/UI + 導線（CV誘導）+ 動線（回遊・読み進め）
   blog.css の上に重ねて使用（ブランド変数・ヘッダー・post-card を継承）
   ============================================================ */

/* 読了プログレスバー（動線：いまどこまで読んだか） */
.sg-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1200;
  background: var(--accent); transition: width .12s linear; }

/* パンくず（動線：現在地と戻り先） */
.sg-bc { width: 1180px; max-width: 90%; margin: 22px auto 0; font-size: 12.5px; color: var(--ink-faint); }
.sg-bc a { color: var(--ink-soft); text-decoration: none; }
.sg-bc a:hover { color: var(--accent-to); }
.sg-bc span.sep { margin: 0 7px; opacity: .55; }

/* 記事ヘッダー */
.sg-head { width: 820px; max-width: 90%; margin: 26px auto 0; }
.sg-cat { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #fff;
  background: var(--accent); border-radius: 999px; padding: 6px 15px; text-decoration: none; }
.sg-title { font-size: clamp(26px, 3.5vw, 40px); font-weight: 800; line-height: 1.5; letter-spacing: .01em;
  margin: 16px 0 20px; color: var(--ink); }
.sg-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sg-author { display: flex; align-items: center; gap: 10px; }
.sg-author__av { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.sg-author__name { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.sg-author__role { font-size: 11.5px; color: var(--ink-faint); }
.sg-date, .sg-read { font-size: 13px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.sg-read svg, .sg-date svg { width: 15px; height: 15px; opacity: .6; }

/* アイキャッチ（記事ヘッダー幅に合わせて控えめに） */
.sg-thumb { width: 820px; max-width: 90%; margin: 28px auto 0; aspect-ratio: 16/9; border-radius: 20px; overflow: hidden;
  display: grid; place-items: center; position: relative; }
.sg-thumb .ph { color: rgba(255,255,255,.85); font-weight: 800; letter-spacing: .16em; font-size: 13px; }

/* ===== 横並びSNSシェア（サムネ下・記事末尾で共用） ===== */
.sg-share { display: flex; align-items: center; gap: 14px; }
.sg-share__label { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--ink-faint); }
.sg-share__icons { display: flex; gap: 12px; }
.sg-share a { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; color: var(--ink-soft); background: #fff; transition: .2s; }
.sg-share a:hover { border-color: transparent; background: var(--accent); color: #fff; transform: translateY(-2px); }
.sg-share svg { width: 18px; height: 18px; }

/* サムネ直下のシェアバー（アイキャッチ幅に合わせて右寄せ） */
.sg-sharebar { width: 820px; max-width: 90%; margin: 18px auto 0; display: flex; justify-content: flex-end; }

/* 記事末尾のシェア（中央・見出し付き） */
.sg-share--end { flex-direction: column; align-items: center; gap: 16px; margin: 50px 0 0; padding-top: 32px; border-top: 1px solid var(--line); }

/* ===== 2カラム：本文 / 右サイド ===== */
.sg-grid { width: 1180px; max-width: 92%; margin: 40px auto 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 72px; align-items: start; }

/* 中央：本文 */
.sg-main { min-width: 0; }

/* モバイル用：本文上に置く折りたたみ目次（PCでは非表示） */
.sg-toc-m { display: none; }

/* 本文プローズ */
.sg-body { font-size: 16.5px; line-height: 2.05; color: #2c2c36; }
.sg-body .lead { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.9; margin: 0 0 30px;
  padding: 0 0 0 18px; border-left: 4px solid var(--accent-to); }
.sg-body h2 { font-size: clamp(21px, 2.4vw, 27px); font-weight: 800; color: var(--ink); margin: 56px 0 18px;
  padding-bottom: 12px; border-bottom: 2px solid var(--line); scroll-margin-top: 158px; line-height: 1.5; }
.sg-body h2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--accent); margin-right: 12px; transform: rotate(45deg) translateY(-2px); }
.sg-body h3 { font-size: 19px; font-weight: 800; color: var(--ink); margin: 38px 0 12px; scroll-margin-top: 158px; }
.sg-body p { margin: 0 0 22px; }
.sg-body ul, .sg-body ol { margin: 0 0 24px; padding-left: 1.3em; }
.sg-body li { margin: 9px 0; }
.sg-body li::marker { color: var(--accent-to); }
.sg-body strong { color: var(--ink); font-weight: 800; background: linear-gradient(transparent 65%, rgba(155,107,255,.18) 0); }
.sg-body blockquote { margin: 30px 0; padding: 20px 26px; background: #f6f7fb; border-left: 4px solid var(--accent-to);
  border-radius: 0 14px 14px 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.9; }
.sg-body figure { margin: 32px 0; }
.sg-body figure .ph { aspect-ratio: 16/9; border-radius: 16px; display: grid; place-items: center;
  color: rgba(255,255,255,.8); font-weight: 800; font-size: 12px; letter-spacing: .12em; }
.sg-body figcaption { font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: 10px; }

/* 本文中インラインCTA（導線：読んでいる流れの中で誘導） */
.sg-inline-cta { margin: 46px 0; border: 1px solid #e2ddf7; border-radius: 20px; padding: 30px 32px;
  background: linear-gradient(135deg, rgba(91,140,255,.08), rgba(155,107,255,.12)); display: flex; gap: 22px; align-items: center; }
.sg-inline-cta__ico { width: 54px; height: 54px; border-radius: 14px; background: var(--accent); flex-shrink: 0;
  display: grid; place-items: center; color: #fff; }
.sg-inline-cta__ico svg { width: 26px; height: 26px; }
.sg-inline-cta h4 { font-size: 17px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.sg-inline-cta p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.7; }
.sg-inline-cta .sg-btn { margin-left: auto; flex-shrink: 0; }

/* 共通ボタン */
.sg-btn { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 26px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 800; text-decoration: none;
  transition: .2s; white-space: nowrap; }
.sg-btn:hover { opacity: .92; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(91,140,255,.32); }
.sg-btn--ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.sg-btn--ghost:hover { border-color: var(--accent-to); color: var(--accent-to); box-shadow: none; }

/* タグ */
.sg-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 44px 0 0; }
.sg-tags a { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); background: #f3f4f8; border-radius: 999px;
  padding: 8px 16px; text-decoration: none; transition: .2s; }
.sg-tags a:hover { color: #fff; background: var(--accent); }

/* 著者ボックス */
.sg-authorbox { display: flex; gap: 18px; align-items: center; background: #f6f7fb; border-radius: 20px; padding: 26px; margin: 30px 0 0; }
.sg-authorbox__av { width: 66px; height: 66px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.sg-authorbox__name { font-size: 15px; font-weight: 800; margin: 0 0 5px; color: var(--ink); }
.sg-authorbox__bio { font-size: 13px; color: var(--ink-soft); line-height: 1.8; margin: 0; }

/* 記事末尾の長方形CTA（プロフィールと同じ幅・横並び） */
.sg-endbox { display: flex; align-items: center; gap: 24px; margin: 22px 0 0; padding: 28px 32px; border-radius: 20px;
  border: 1px solid #e2ddf7; background: linear-gradient(135deg, rgba(91,140,255,.10), rgba(155,107,255,.14)); }
.sg-endbox__eye { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--accent-to); }
.sg-endbox h3 { font-size: 19px; font-weight: 800; color: var(--ink); margin: 6px 0 6px; line-height: 1.5; }
.sg-endbox p { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.7; }
.sg-endbox .sg-btn { margin-left: auto; flex-shrink: 0; }

/* ===== 右サイド（画面に追従＝sticky。目次と人気記事を常に同時表示） =====
   top はスティッキーヘッダー（約143px）の下に出るよう余裕を持たせる */
.sg-side { position: sticky; top: 160px; display: flex; flex-direction: column; gap: 22px; }

/* 目次（動線：スクロールスパイ） */
.sg-toc { border: 1px solid var(--line); border-radius: 18px; padding: 22px 22px 18px; background: #fff; }
.sg-toc__h { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--ink-faint); margin: 0 0 14px; }
.sg-toc a { display: block; padding: 7px 0 7px 14px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
  border-left: 2px solid var(--line); text-decoration: none; transition: .2s; line-height: 1.55; }
.sg-toc a:hover { color: var(--ink); }
.sg-toc a.is-active { color: var(--accent-to); border-left-color: var(--accent-to); transform: translateX(2px); }
.sg-toc a.lv3 { padding-left: 26px; font-size: 12.5px; font-weight: 600; }

/* サイドCTA（導線） */
.sg-sidecta { border: 1px solid #e2ddf7; border-radius: 18px; padding: 24px; text-align: center;
  background: linear-gradient(150deg, rgba(91,140,255,.10), rgba(155,107,255,.14)); }
.sg-sidecta__eye { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--accent-to); }
.sg-sidecta h4 { font-size: 16px; font-weight: 800; color: var(--ink); margin: 8px 0 8px; line-height: 1.5; }
.sg-sidecta p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.75; margin: 0 0 16px; }
.sg-sidecta .sg-btn { width: 100%; justify-content: center; height: 46px; }

/* ランキング（動線：他記事への回遊） */
.sg-rank { border: 1px solid var(--line); border-radius: 18px; padding: 20px 20px 8px; background: #fff; }
.sg-rank__h { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--ink-faint); margin: 0 0 8px; }
.sg-rank a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line);
  text-decoration: none; color: var(--ink); }
.sg-rank a:first-of-type { border-top: 0; }
.sg-rank__n { font-size: 15px; font-weight: 800; font-style: italic; color: var(--accent-to); flex-shrink: 0; width: 18px; }
.sg-rank a:nth-of-type(1) .sg-rank__n,
.sg-rank a:nth-of-type(2) .sg-rank__n,
.sg-rank a:nth-of-type(3) .sg-rank__n { color: #fff; background: var(--accent); border-radius: 7px;
  width: 22px; height: 22px; display: grid; place-items: center; font-style: normal; font-size: 12px; }
.sg-rank__t { font-size: 12.5px; font-weight: 700; line-height: 1.55; }
.sg-rank a:hover .sg-rank__t { color: var(--accent-to); }

/* ===== 次に読む（動線：回遊の主動線） ===== */
.sg-next { width: 1180px; max-width: 92%; margin: 76px auto 0; }
.sg-sec-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 22px; }
.sg-sec-head h2 { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0; }
.sg-sec-head h2 .chev { color: var(--accent-to); margin-right: 6px; }
.sg-sec-head .more { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-decoration: none; }
.sg-sec-head .more:hover { color: var(--accent-to); }

/* 前後記事（動線） */
.sg-pn { width: 1180px; max-width: 92%; margin: 40px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sg-pn a { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border: 1px solid var(--line);
  border-radius: 16px; text-decoration: none; color: var(--ink); transition: .2s; background: #fff; }
.sg-pn a:hover { border-color: var(--accent-to); box-shadow: 0 12px 28px rgba(30,40,80,.08); }
.sg-pn .dir { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--ink-faint); }
.sg-pn .t { font-size: 14.5px; font-weight: 700; line-height: 1.55; }
.sg-pn a.next { text-align: right; align-items: flex-end; }
.sg-backrow { text-align: center; margin: 44px 0 0; }

/* ===== 末尾の大型CTA（導線：最終CV） ===== */
.sg-endcta { margin: 80px 0 0; background: linear-gradient(135deg, #5b8cff, #9b6bff); color: #fff; }
.sg-endcta__in { width: 980px; max-width: 90%; margin: 0 auto; padding: 64px 0; text-align: center; }
.sg-endcta h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 800; margin: 0 0 12px; }
.sg-endcta p { font-size: 15px; opacity: .92; margin: 0 0 28px; line-height: 1.8; }
.sg-endcta .sg-btn { background: #fff; color: var(--accent-to); height: 54px; padding: 0 36px; font-size: 15px; }
.sg-endcta .sg-btn:hover { box-shadow: 0 14px 30px rgba(0,0,0,.22); }

/* ===== PC固定の追従CTAバー（導線：読了途中で離脱前にCV） ===== */
.sg-stickybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100; background: #fff;
  border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(20,20,40,.10);
  transform: translateY(110%); transition: transform .35s cubic-bezier(.2,.7,.3,1); }
.sg-stickybar.show { transform: translateY(0); }
.sg-stickybar__in { width: 1180px; max-width: 92%; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 14px 0; }
.sg-stickybar__ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); flex-shrink: 0;
  display: grid; place-items: center; color: #fff; }
.sg-stickybar__ico svg { width: 22px; height: 22px; }
.sg-stickybar__txt strong { display: block; font-size: 14px; font-weight: 800; color: var(--ink); }
.sg-stickybar__txt span { font-size: 12px; color: var(--ink-soft); }
.sg-stickybar .sg-btn { margin-left: auto; }
.sg-stickybar__close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #fff;
  color: var(--ink-faint); cursor: pointer; flex-shrink: 0; font-size: 16px; line-height: 1; }
.sg-stickybar__close:hover { border-color: var(--ink-soft); color: var(--ink); }

/* SMART簡易フッター */
.sg-foot { margin-top: 0; border-top: 1px solid var(--line); background: #fafafe; }
.sg-foot__in { width: 1180px; max-width: 90%; margin: 0 auto; padding: 30px 0 40px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.sg-foot__logo img { height: 26px; display: block; }
.sg-foot__links { display: flex; gap: 22px; flex-wrap: wrap; }
.sg-foot__links a { font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.sg-foot__links a:hover { color: var(--accent-to); }
.sg-foot__copy { width: 100%; font-size: 11.5px; color: var(--ink-faint); border-top: 1px solid var(--line); padding-top: 16px; }

/* ===== レスポンシブ ===== */
@media (max-width: 1080px) {
  .sg-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; }
}
@media (max-width: 860px) {
  .sg-grid { grid-template-columns: 1fr; gap: 0; }
  .sg-side { position: static; flex-direction: column; margin-top: 44px; } /* スマホでは固定しない */
  .sg-toc { display: none; } /* PCサイド目次は隠し、本文冒頭の折りたたみ目次を使う */
  .sg-toc-m { display: block; border: 1px solid var(--line); border-radius: 16px; margin: 0 0 30px; overflow: hidden; }
  .sg-toc-m summary { list-style: none; cursor: pointer; padding: 16px 20px; font-size: 13px; font-weight: 800;
    color: var(--ink); display: flex; align-items: center; gap: 8px; }
  .sg-toc-m summary::-webkit-details-marker { display: none; }
  .sg-toc-m summary::after { content: "＋"; margin-left: auto; color: var(--accent-to); font-weight: 800; }
  .sg-toc-m[open] summary::after { content: "−"; }
  .sg-toc-m nav { padding: 0 20px 16px; }
  .sg-toc-m a { display: block; padding: 8px 0 8px 14px; font-size: 13px; font-weight: 700; color: var(--ink-soft);
    border-left: 2px solid var(--line); text-decoration: none; }
  .sg-toc-m a.lv3 { padding-left: 26px; font-weight: 600; }
  .sg-inline-cta { flex-direction: column; text-align: center; align-items: stretch; }
  .sg-inline-cta__ico { margin: 0 auto; }
  .sg-inline-cta .sg-btn { margin: 4px auto 0; }
  .sg-endbox { flex-direction: column; align-items: stretch; text-align: center; }
  .sg-endbox .sg-btn { margin: 4px auto 0; }
  .sg-stickybar { display: none; } /* スマホでは追従バーを出さない（誤タップ・領域圧迫回避） */
  .sg-pn { grid-template-columns: 1fr; }
}
