/* =====================================================================
   NSP-Tech Magazine 記事ページ用スタイル（magazine.css）
   ---------------------------------------------------------------------
   コラム・インタビューの記事ページだけで読み込みます。
   色やフォントは共通の style.css の変数（--primary など）を使っています。
   ---------------------------------------------------------------------
   レイアウト（パソコン）：
     [シェア] [本文（白いカード）] [サイド：目次・案内]
   スマホでは本文だけの1列になり、目次は本文の中に表示されます。
   ===================================================================== */

/* 共通 style.css の body { overflow-x: hidden } があると、シェアや目次の
   「スクロールに追従」が効かないため、記事ページでは clip に置き換える */
body { overflow-x: clip; }

.mag-page {
  background: #EEF4FA;               /* 記事ページの背景（薄いブルー） */
  padding: 8px 0 72px;
}
.mag-page .breadcrumb { padding-bottom: 16px; }

.mag-layout {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

/* ---------- 左：シェアボタン（パソコンは縦並びで追従） ---------- */
.mag-share {
  align-self: start;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.mag-share-label {
  font-family: var(--font-en);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-sub);
  writing-mode: vertical-rl;
  margin-bottom: 4px;
}
.mag-share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, opacity 0.2s;
}
.mag-share-btn:hover { transform: translateY(-2px); opacity: 0.85; }
.mag-share-btn.is-x    { background: #000; }
.mag-share-btn.is-fb   { background: #0866FF; }
.mag-share-btn.is-line { background: #06C755; font-size: 22px; }
.mag-share-btn.is-copy { background: #fff; color: var(--text-main); border: 1px solid var(--border); font-size: 16px; }
.mag-share-toast {
  position: absolute;
  left: 52px;
  white-space: nowrap;
  background: var(--text-main);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.mag-share-btn.is-copied .mag-share-toast { opacity: 1; }

/* ---------- 中央：本文カード ---------- */
.mag-main {
  background: #fff;
  border-radius: 24px;
  padding: 48px;
  min-width: 0;
}

.mag-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 14px;
}
.mag-cat {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.mag-series {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--text-main);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
}
.mag-date, .mag-read { font-family: var(--font-en); letter-spacing: 0.03em; }

.mag-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: 0.01em;
  margin-bottom: 28px;
}

.mag-eyecatch {
  margin: 0 0 16px;
}
.mag-eyecatch img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-grey);
  display: block;
}

.mag-byline {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 28px;
}

/* リード文（冒頭の要約） */
.mag-lead {
  background: #EAF2FA;
  border-radius: 16px;
  padding: 26px 30px;
  margin-bottom: 32px;
  font-size: 15px;
  line-height: 2;
}
.mag-lead p { margin-bottom: 12px; }
.mag-lead p:last-child { margin-bottom: 0; }

/* 目次（JavaScriptで見出しから自動作成） */
.mag-toc {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 26px;
  margin-bottom: 40px;
}
.mag-toc-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}
.mag-toc ol {
  margin: 0;
  padding-left: 22px;
  counter-reset: none;
}
.mag-toc li {
  list-style: decimal;
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 4px;
  color: var(--text-sub);
}
.mag-toc a { color: var(--text-main); }
.mag-toc a:hover { color: var(--primary); text-decoration: underline; }
.mag-toc a.is-active { color: var(--primary); font-weight: 700; }
.mag-toc:empty, .mag-toc[hidden] { display: none; }

/* ---------- 本文 ---------- */
.mag-body {
  font-size: 16px;
  line-height: 2;
  color: #333;
}
.mag-body > * + * { margin-top: 20px; }
.mag-body p { margin: 0; }
.mag-body p + p { margin-top: 18px; }
.mag-body h2 {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
  color: var(--text-main);
  border-left: 5px solid var(--primary);
  padding: 6px 0 6px 14px;
  margin-top: 56px;
  margin-bottom: 20px;
  scroll-margin-top: 100px;
}
.mag-body h3 {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.6;
  color: var(--primary-dark);
  margin-top: 36px;
  margin-bottom: 12px;
}
.mag-body ul, .mag-body ol { padding-left: 24px; }
.mag-body ul li { list-style: disc; }
.mag-body ol li { list-style: decimal; }
.mag-body li + li { margin-top: 6px; }
.mag-body strong {
  font-weight: 700;
  background: linear-gradient(transparent 62%, #FFF0A8 62%);   /* マーカー風 */
}
.mag-body a { color: var(--primary-dark); text-decoration: underline; }

/* 画像（キャプション付き） */
.mag-figure { margin: 32px 0; }
.mag-figure img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  background: var(--bg-grey);
}
.mag-figure figcaption {
  font-size: 13px;
  color: var(--text-sub);
  text-align: center;
  margin-top: 8px;
  line-height: 1.6;
}
/* 画像を2枚横に並べる */
.mag-figure-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 32px 0;
}
.mag-figure-row .mag-figure { margin: 0; }

/* 表 */
.mag-table-wrap { overflow-x: auto; margin: 28px 0; }
.mag-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.8;
}
.mag-table th, .mag-table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.mag-table th { background: #EAF2FA; font-weight: 700; color: var(--text-main); }

/* 「この記事で分かること」などの囲み */
.mag-box {
  border: 2px solid var(--primary-light);
  border-radius: 16px;
  padding: 22px 26px;
  margin: 32px 0;
}
.mag-box-title {
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px !important;
}
.mag-box ul { margin: 0; }

/* まとめ */
.mag-summary {
  background: #EAF2FA;
  border-radius: 16px;
  padding: 24px 28px;
  margin: 40px 0 0;
}
.mag-summary-title {
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 10px !important;
}
.mag-summary ul { margin: 0; }

/* 補足・注意書き */
.mag-note {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
  margin-top: 32px !important;
}

/* インタビュー：印象的な一言（引用） */
.mag-quote {
  margin: 40px 0;
  padding: 8px 0 8px 28px;
  border-left: 3px solid var(--primary-light);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--primary-dark);
  position: relative;
}
.mag-quote::before {
  content: "“";
  position: absolute;
  left: 6px;
  top: -14px;
  font-family: Georgia, serif;
  font-size: 48px;
  color: var(--primary-light);
  line-height: 1;
}

/* インタビュー：プロフィール */
.mag-profile {
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 24px;
  margin-bottom: 32px;
}
.mag-profile-photo {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-grey);
  border: 1px solid var(--border);
}
.mag-profile-name { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.mag-profile-name small { font-size: 12px; font-weight: 500; color: var(--text-sub); margin-left: 6px; }
.mag-profile dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; font-size: 13px; line-height: 1.8; }
.mag-profile dt { color: var(--primary); font-weight: 700; }
.mag-profile dd { margin: 0; }

/* インタビュー：メッセージ */
.mag-message {
  background: var(--primary);
  color: #fff;
  border-radius: 16px;
  padding: 26px 30px;
  margin-top: 48px !important;
}
.mag-message-title { font-weight: 800; font-size: 17px; margin-bottom: 8px !important; color: #fff; }
.mag-message p { color: #fff; }

/* ---------- 本文下：案内（CTA） ---------- */
.mag-cta {
  background: var(--primary-dark);
  color: #fff;
  border-radius: 24px;
  padding: 36px 44px;
  margin-top: 56px;
}
.mag-cta-title { font-size: 20px; font-weight: 800; line-height: 1.6; margin-bottom: 10px; color: #fff; }
.mag-cta-text { font-size: 14px; line-height: 1.9; opacity: 0.92; margin-bottom: 22px; }
.mag-cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.mag-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 14px;
  transition: opacity 0.2s, transform 0.2s;
}
.mag-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.mag-btn-solid { background: #fff; color: var(--primary-dark); }
.mag-btn-outline { border: 1.5px solid #fff; color: #fff; }

/* 本文下のシェア（スマホ用・パソコンでも表示） */
.mag-share-bottom {
  margin-top: 40px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mag-share-bottom .mag-share-label { writing-mode: horizontal-tb; font-family: var(--font-jp); font-size: 13px; letter-spacing: 0; color: var(--text-main); margin: 0; }
.mag-share-bottom .mag-share-list { display: flex; gap: 10px; }
.mag-share-bottom .mag-share-toast { left: auto; right: 0; top: -30px; }

/* ---------- 右：サイド ---------- */
.mag-side { min-width: 0; align-self: stretch; }
.mag-side-sticky { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 20px; }
.mag-side .mag-toc { background: #fff; border: none; margin: 0; max-height: calc(100vh - 360px); overflow-y: auto; }
.mag-side-cta {
  background: #fff;
  border-radius: 16px;
  padding: 22px 24px;
}
.mag-side-cta-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.mag-side-cta-text { font-size: 13px; color: var(--text-sub); line-height: 1.8; margin-bottom: 14px; }
.mag-side-cta .mag-btn { background: var(--primary); color: #fff; width: 100%; justify-content: center; }

/* ---------- ページ下：関連記事 ---------- */
.mag-more {
  max-width: var(--container-max);
  margin: 40px auto 0;
  padding: 0 24px;
}
.mag-more-inner {
  background: #fff;
  border-radius: 24px;
  padding: 40px 44px;
}
.mag-more-title { font-size: 20px; font-weight: 800; margin-bottom: 24px; }
.mag-more .story-card { border-color: var(--border); }
.mag-more .mag-card-date { font-size: 12px; color: var(--text-sub); margin-top: 8px; font-family: var(--font-en); }
.mag-more-all { margin-top: 28px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 1100px) {
  .mag-layout { grid-template-columns: 52px minmax(0, 1fr); }
  .mag-side { display: none; }
}
@media (max-width: 768px) {
  .mag-page { padding-bottom: 48px; }
  .mag-layout { grid-template-columns: 1fr; padding: 0 12px; gap: 0; }
  .mag-share { display: none; }            /* スマホは本文下のシェアを使う */
  .mag-main { padding: 28px 20px; border-radius: 16px; }
  .mag-title { font-size: 21px; }
  .mag-lead { padding: 20px; }
  .mag-toc { padding: 16px 18px; }
  .mag-body { font-size: 15px; }
  .mag-body h2 { font-size: 18px; margin-top: 44px; }
  .mag-body h3 { font-size: 16px; }
  .mag-quote { font-size: 17px; padding-left: 22px; }
  .mag-figure-row { grid-template-columns: 1fr; }
  .mag-profile { flex-direction: column; align-items: flex-start; }
  .mag-cta { padding: 28px 22px; border-radius: 16px; }
  .mag-cta-title { font-size: 17px; }
  .mag-more { padding: 0 12px; }
  .mag-more-inner { padding: 28px 20px; border-radius: 16px; }
}
