/* ============================================================
   D.D CREST 記事デザインシステム v1
   SWELL実測値ベース × D.Dゴールド × 白背景
   適用範囲: コラム個別ページのみ（body.single-column）
   ============================================================ */
:root {
  --dd-gold:        #b08d4f;   /* 基準ゴールド（白背景でコントラスト確保） */
  --dd-gold-deep:   #96743a;
  --dd-gold-light:  #f7efe0;
  --dd-text:        #333333;   /* SWELL流: 真っ黒でなく#333 */
  --dd-text-thin:   #777777;
  --dd-border:      rgba(0,0,0,.12);
  --dd-marker:      linear-gradient(transparent 64%, #f5e0b0 0%);
  --dd-line-green:  #06c755;
  --dd-radius:      4px;
  --dd-shadow:      0 2px 4px rgba(0,0,0,.05), 0 4px 4px -4px rgba(0,0,0,.1);
}

/* ===== 白背景ゾーン（本文コンテナ限定＝タイトル帯や関連記事は黒のまま） ===== */
body.single-column .dd-article-page .dd-article-main {
  background: #fff;
  border-radius: 8px;
  padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 48px);
}

/* ===== 本文タイポグラフィ（SWELL実測: 16px/1.8/500） ===== */
body.single-column .dd-article-body {
  font-family: "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.8;
  color: var(--dd-text);
}
body.single-column .dd-article-body :where(p, ul, ol, figure, table, blockquote) {
  margin: 2em 0; /* SWELL --swl-block-margin */
}
body.single-column .dd-article-body a {
  color: var(--dd-gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===== 見出し（SWELL適用実測の移植） ===== */
/* H2: 塗りつぶし型 */
body.single-column .dd-article-body h2 {
  background: var(--dd-gold);
  color: #fff;
  font-size: 1.4em;
  font-weight: 700;
  line-height: 1.4;
  padding: .75em 1em;
  margin: 4em 0 2em;
  border-radius: var(--dd-radius);
}
/* H3: 下線型 */
body.single-column .dd-article-body h3 {
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1.4;
  padding: 0 .5em .5em;
  margin: 3em 0 2em;
  border-bottom: 2px solid var(--dd-gold);
  color: var(--dd-text);
}
/* H4: 左線型 */
body.single-column .dd-article-body h4 {
  font-size: 1.05em;
  font-weight: 700;
  padding: 0 0 0 14px;
  margin: 3em 0 1.5em;
  border-left: 3px solid var(--dd-gold);
  color: var(--dd-text);
}
/* 最初の見出しは上マージン詰め */
body.single-column .dd-article-body > .elementor-widget-container > :first-child {
  margin-top: 0;
}

/* ===== 画像（上品な影＋角丸） ===== */
body.single-column .dd-article-body .wp-block-image img {
  border-radius: var(--dd-radius);
  box-shadow: var(--dd-shadow);
  height: auto;
}

/* ===== リスト装飾（ブロックスタイル） ===== */
body.single-column .is-style-dd-check, .editor-styles-wrapper .is-style-dd-check { list-style: none; padding-left: .2em; }
body.single-column .is-style-dd-check li, .editor-styles-wrapper .is-style-dd-check li {
  position: relative; padding-left: 1.6em; margin: .5em 0;
}
body.single-column .is-style-dd-check li::before, .editor-styles-wrapper .is-style-dd-check li::before {
  content: "✔"; position: absolute; left: 0; color: var(--dd-gold); font-weight: 700;
}
body.single-column .is-style-dd-good li, .editor-styles-wrapper .is-style-dd-good li { list-style: none; position: relative; padding-left: 1.6em; margin: .5em 0; }
body.single-column .is-style-dd-good li::before, .editor-styles-wrapper .is-style-dd-good li::before { content: "◎"; position: absolute; left: 0; color: #3cd250; font-weight: 700; }
body.single-column .is-style-dd-bad li, .editor-styles-wrapper .is-style-dd-bad li { list-style: none; position: relative; padding-left: 1.6em; margin: .5em 0; }
body.single-column .is-style-dd-bad li::before, .editor-styles-wrapper .is-style-dd-bad li::before { content: "✕"; position: absolute; left: 0; color: #f36060; font-weight: 700; }

/* ===== ボックス（SWELL cap_box仕様の移植） ===== */
.is-style-dd-box-point, .is-style-dd-box-alert, .is-style-dd-box-memo {
  border-radius: var(--dd-radius);
  padding: 1.25em 1.5em;
  margin: 2em 0;
  position: relative;
  border: 2px solid;
}
.is-style-dd-box-point { border-color: var(--dd-gold); background: var(--dd-gold-light); }
.is-style-dd-box-point::before { content: "POINT"; }
.is-style-dd-box-alert { border-color: #f36060; background: #fef2f2; }
.is-style-dd-box-alert::before { content: "注意"; }
.is-style-dd-box-memo { border-color: #6599b7; background: #f0f7fb; }
.is-style-dd-box-memo::before { content: "MEMO"; }
.is-style-dd-box-point::before, .is-style-dd-box-alert::before, .is-style-dd-box-memo::before {
  position: absolute; top: -0.9em; left: 1em;
  font-size: .8em; font-weight: 700; color: #fff;
  padding: .15em .8em; border-radius: 3px;
}
.is-style-dd-box-point::before { background: var(--dd-gold); }
.is-style-dd-box-alert::before { background: #f36060; }
.is-style-dd-box-memo::before  { background: #6599b7; }
.is-style-dd-box-point > p:first-child, .is-style-dd-box-alert > p:first-child, .is-style-dd-box-memo > p:first-child { margin-top: .25em; }

/* ===== リード文 ===== */
.is-style-dd-lead {
  font-size: 1.05em;
  color: var(--dd-text);
  background: var(--dd-gold-light);
  border-left: 4px solid var(--dd-gold);
  padding: 1em 1.25em;
  border-radius: 0 var(--dd-radius) var(--dd-radius) 0;
}

/* ===== マーカー（SWELL式: 下側36%塗り） ===== */
body.single-column .has-dd-marker-gold-background-color   { background: linear-gradient(transparent 64%, #f5e0b0 0%) !important; padding: 0 .1em; }
body.single-column .has-dd-marker-yellow-background-color { background: linear-gradient(transparent 64%, #fff16c 0%) !important; padding: 0 .1em; }

/* ===== LINE CTA ===== */
.dd-cta-line-wrap {
  background: #fff;
  border: 2px solid var(--dd-line-green);
  border-radius: 8px;
  padding: 1.5em 1.25em;
  margin: 3em 0;
  text-align: center;
}
.dd-cta-copy { margin: 0 0 1em !important; }
.dd-cta-line-btn {
  display: inline-block;
  background: var(--dd-line-green);
  color: #fff !important;
  font-weight: 700;
  font-size: 1.05em;
  padding: .9em 2em;
  border-radius: 999px;
  text-decoration: none !important;
  box-shadow: 0 2px 2px rgba(0,0,0,.1), 0 4px 8px -4px rgba(0,0,0,.2);
  transition: transform .15s ease, box-shadow .15s ease;
}
.dd-cta-line-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 6px rgba(0,0,0,.15); }

/* ===== 目次（Easy Table of Contents をSWELL風に） ===== */
body.single-column #ez-toc-container {
  background: #fff;
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius);
  box-shadow: var(--dd-shadow);
  padding: 1.25em 1.5em;
  margin: 2em 0;
  width: 100%;
}
body.single-column #ez-toc-container .ez-toc-title { font-weight: 700; color: var(--dd-text); }
body.single-column #ez-toc-container a { color: var(--dd-text); text-decoration: none; }
body.single-column #ez-toc-container a:hover { color: var(--dd-gold-deep); }

/* ===== テーブル ===== */
body.single-column .dd-article-body table {
  border-collapse: collapse; width: 100%;
}
body.single-column .dd-article-body th {
  background: var(--dd-gold); color: #fff; padding: .6em .8em; border: 1px solid var(--dd-border);
}
body.single-column .dd-article-body td {
  padding: .6em .8em; border: 1px solid var(--dd-border);
}

/* ===== モバイル調整 ===== */
@media (max-width: 767px) {
  body.single-column .dd-article-body { font-size: 15px; }
  body.single-column .dd-article-body h2 { margin: 3em 0 1.5em; }
}


/* ============================================================
   レイアウト v2（参考: blog.socialplus.jp 型）
   白背景 / 左メイン＋右サイドバー / コンパクトヒーロー
   ============================================================ */
body.single-column .dd-article-page {
  background: #fff;
  color: var(--dd-text);
}
body.single-column .dd-article-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 32px) 64px;
}
@media (min-width: 821px) {
  body.single-column .dd-article-container { padding-top: 8px; }
}
body.single-column .dd-article-main { min-width: 0; background: none; padding: 0; border-radius: 0; }

/* パンくず */
.dd-breadcrumb { font-size: .8em; color: var(--dd-text-thin); display: flex; gap: .5em; flex-wrap: wrap; margin-bottom: 1.25em; }
.dd-breadcrumb a { color: var(--dd-text-thin); text-decoration: none; }
.dd-breadcrumb a:hover { color: var(--dd-gold-deep); }
.dd-breadcrumb-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

/* タイトル＋メタ＋アイキャッチ（コンパクトヒーロー） */
body.single-column .dd-article-page h1.dd-article-title {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--dd-text);
  margin: 0 0 .6em;
  font-family: "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}
.dd-article-meta { display: flex; gap: 1.25em; font-size: .82em; color: var(--dd-text-thin); margin-bottom: 1.5em; }
.dd-eyecatch { margin: 0 0 2.5em; }
.dd-eyecatch img { width: 100%; height: auto; border-radius: 6px; box-shadow: var(--dd-shadow); }

/* 本文タイポ（スコープ移行後の基礎） */
body.single-column .dd-article-body {
  font-family: "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px; font-weight: 500; line-height: 1.8; color: var(--dd-text);
}

/* ===== 右サイドバー（ウィジェット） ===== */
.dd-article-sidebar { display: flex; flex-direction: column; gap: 24px; }
.dd-widget {
  background: #fff; border: 1px solid var(--dd-border);
  border-radius: 6px; padding: 1.25em; box-shadow: var(--dd-shadow);
  font-size: .9em; line-height: 1.7;
}
.dd-widget-title {
  font-weight: 700; color: #fff; background: var(--dd-gold);
  margin: -1.25em -1.25em 1em; padding: .6em 1.25em;
  border-radius: 6px 6px 0 0; font-size: 1.02em;
}
.dd-widget img { max-width: 100%; height: auto; border-radius: 4px; }
.dd-widget ul { list-style: none; margin: 0; padding: 0; }
.dd-widget li { border-bottom: 1px dashed var(--dd-border); padding: .55em 0; }
.dd-widget li:last-child { border-bottom: 0; }
.dd-widget a { color: var(--dd-text); text-decoration: none; }
.dd-widget a:hover { color: var(--dd-gold-deep); }
.dd-widget-placeholder { color: var(--dd-text-thin); font-size: .85em; }

/* ===== 関連記事カード ===== */
.dd-related { background: #f7f5f0; padding: 48px 0 64px; }
.dd-related-inner { max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }
body.single-column .dd-related h2.dd-related-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dd-text);
  margin: 0 0 1.25em;
  padding: .1em 0 .1em .6em;
  border-left: 4px solid var(--dd-gold);
  background: none;
  line-height: 1.5;
  font-family: "游ゴシック体", "Yu Gothic", YuGothic, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
}
.dd-related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.dd-related-card { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: var(--dd-shadow); text-decoration: none; color: var(--dd-text); transition: transform .15s ease; display: block; }
.dd-related-card:hover { transform: translateY(-3px); }
.dd-related-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.dd-related-card-title { display: block; padding: .9em 1em 1.1em; font-size: .88em; font-weight: 700; line-height: 1.5; }

/* ===== モバイル ===== */
@media (max-width: 959px) {
  body.single-column .dd-article-container { grid-template-columns: 1fr; gap: 40px; }
  .dd-related-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== サイドバーウィジェット: サムネ付きリスト ===== */
.dd-w-list { list-style: none; margin: 0; padding: 0; }
.dd-w-list li { padding: 0 0 18px; }
.dd-w-list li:last-child { padding-bottom: 4px; }
.dd-w-list a { display: block; color: var(--dd-text); text-decoration: none; }
.dd-w-list a:hover .dd-w-title { color: var(--dd-gold-deep); }
.dd-w-thumb { margin-bottom: 8px; }
.dd-w-thumb img { width: 100%; height: auto; border-radius: 4px; display: block; }
.dd-w-thumb-empty { width: 100%; aspect-ratio: 1.91 / 1; background: var(--dd-gold-light); border-radius: 4px; }
.dd-w-title { font-size: .82em; font-weight: 600; line-height: 1.5; }
.dd-w-more { display: block; text-align: right; margin-top: .75em; font-size: .82em; font-weight: 700; color: var(--dd-gold-deep) !important; text-decoration: none; }
.dd-w-more:hover { text-decoration: underline; }

/* ===== サイドバー追従（ウィジェット設定の「追従」チェックで有効化） ===== */
.dd-article-sidebar { align-self: stretch; }
.dd-widget.dd-sticky { position: sticky; top: 24px; }
body.admin-bar .dd-widget.dd-sticky { top: 56px; }

/* ===== 画像ウィジェット（バナー）は枠なし・目一杯表示 ===== */
.dd-article-sidebar .dd-widget.widget_media_image {
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}
.dd-article-sidebar .dd-widget.widget_media_image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  box-shadow: var(--dd-shadow);
}
.dd-article-sidebar .dd-widget.widget_media_image .dd-widget-title {
  margin: 0 0 .5em;
  border-radius: 6px;
}

/* ===== 箇条書き（標準リストの見た目を整備） ===== */
body.single-column .dd-article-body ul:not([class*="is-style-dd"]) { list-style: none; padding-left: .2em; }
body.single-column .dd-article-body ul:not([class*="is-style-dd"]) > li { position: relative; padding-left: 1.4em; margin: .4em 0; }
body.single-column .dd-article-body ul:not([class*="is-style-dd"]) > li::before {
  content: ""; position: absolute; left: .2em; top: .68em;
  width: .5em; height: .5em; border-radius: 2px; background: var(--dd-gold);
}
body.single-column .dd-article-body ol:not([class*="is-style-dd"]) { padding-left: 1.6em; }
body.single-column .dd-article-body ol:not([class*="is-style-dd"]) > li { margin: .4em 0; }
body.single-column .dd-article-body ol:not([class*="is-style-dd"]) > li::marker { color: var(--dd-gold-deep); font-weight: 700; }

/* ===== メリット/デメリットボックス（キャプション付き） ===== */
.is-style-dd-box-merit, .is-style-dd-box-demerit {
  border-radius: var(--dd-radius); padding: 1.5em 1.5em 1.25em; margin: 2.5em 0;
  position: relative; border: 2px solid;
}
.is-style-dd-box-merit   { border-color: #3cb96a; background: #f0faf4; }
.is-style-dd-box-demerit { border-color: #e05252; background: #fdf3f3; }
.is-style-dd-box-merit::before, .is-style-dd-box-demerit::before {
  position: absolute; top: -0.9em; left: 1em; font-size: .8em; font-weight: 700;
  color: #fff; padding: .15em .9em; border-radius: 3px;
}
.is-style-dd-box-merit::before   { content: "メリット"; background: #3cb96a; }
.is-style-dd-box-demerit::before { content: "デメリット"; background: #e05252; }
.is-style-dd-box-merit ul li::before  { background: #3cb96a !important; }
.is-style-dd-box-demerit ul li::before { background: #e05252 !important; }
.is-style-dd-box-merit > *:first-child, .is-style-dd-box-demerit > *:first-child { margin-top: 0; }
.is-style-dd-box-merit > *:last-child,  .is-style-dd-box-demerit > *:last-child  { margin-bottom: 0; }

/* ===== 監修者/執筆者コメント（ふきだし型） ===== */
.dd-voice {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px;
  margin: 2.5em 0; align-items: start;
}
.dd-voice::before {
  grid-row: 1 / 3;
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .78em; font-weight: 700; color: #fff; line-height: 1.2; text-align: center;
}
.dd-voice-supervisor::before { content: "監修"; background: var(--dd-gold-deep); }
.dd-voice-author::before     { content: "執筆"; background: #4a5568; }
.dd-voice .dd-voice-name { font-size: .78em !important; color: var(--dd-text-thin); margin: 0 0 .4em !important; grid-column: 2; }
.dd-voice > p:not(.dd-voice-name) {
  grid-column: 2; margin: 0 !important;
  background: #f6f6f4; border-radius: 10px; padding: 1em 1.25em;
  position: relative; font-size: .95em;
}
.dd-voice > p:not(.dd-voice-name)::before {
  content: ""; position: absolute; left: -8px; top: 18px;
  border: 8px solid transparent; border-right-color: #f6f6f4; border-left: 0;
}

/* ===== テーブル: スマホ横スクロール（ブロックスタイルで切替） ===== */
body.single-column .dd-article-body .wp-block-table.is-style-dd-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 767px) {
  body.single-column .dd-article-body .wp-block-table.is-style-dd-scroll table { min-width: 640px; }
}

/* ===== マーカー（記法 [マーカー]〜[/マーカー] 用） ===== */
body.single-column .dd-article-body .dd-marker { background: linear-gradient(transparent 64%, #f5e0b0 0%); padding: 0 .1em; }

/* ===== 目次（自動生成・SWELL/トベシン風・コンパクト） ===== */
html { scroll-behavior: smooth; }
body.single-column .dd-article-body .dd-toc {
  background: #f9f7f2; border: 1px solid #e8e2d4; border-radius: 4px;
  padding: 20px 24px 14px; margin: 2em 0; position: relative; }
body.single-column .dd-article-body .dd-toc-title {
  text-align: center; font-weight: 700; font-size: 1.05em; color: #333;
  margin: 0 0 10px; letter-spacing: .12em; }
body.single-column .dd-article-body .dd-toc-title::before {
  content: "☰"; color: var(--dd-gold, #b08d4f); margin-right: .45em; }
/* リスト（本文リスト用の余白スタイルを完全に上書きしてコンパクトに） */
body.single-column .dd-article-body .dd-toc ol {
  counter-reset: none; list-style: none; margin: 0; padding: 0; }
body.single-column .dd-article-body .dd-toc .dd-toc-list { counter-reset: toc; }
body.single-column .dd-article-body .dd-toc .dd-toc-list > li {
  margin: 0; padding: 3px 0; line-height: 1.65; }
body.single-column .dd-article-body .dd-toc .dd-toc-list > li::before {
  counter-increment: toc; content: counter(toc) "｜"; color: var(--dd-gold, #b08d4f);
  font-weight: 700; margin-right: .15em; }
body.single-column .dd-article-body .dd-toc a {
  color: #333; text-decoration: none; font-weight: 600; font-size: .93em; }
body.single-column .dd-article-body .dd-toc a:hover { color: var(--dd-gold-deep, #96743a); }
body.single-column .dd-article-body .dd-toc .dd-toc-sub {
  counter-reset: sub; margin: 1px 0 1px 1.1em; padding: 0; }
body.single-column .dd-article-body .dd-toc .dd-toc-sub li {
  margin: 0; padding: 2px 0; line-height: 1.6; }
body.single-column .dd-article-body .dd-toc .dd-toc-sub li::before {
  counter-increment: sub; content: counter(toc) "-" counter(sub) "｜";
  color: var(--dd-gold, #b08d4f); font-weight: 600; font-size: .85em; margin-right: .15em; }
body.single-column .dd-article-body .dd-toc .dd-toc-sub a { font-weight: 500; font-size: .89em; }
/* 折りたたみ */
body.single-column .dd-article-body .dd-toc-collapsed .dd-toc-list {
  max-height: 260px; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
body.single-column .dd-article-body .dd-toc-more-wrap { text-align: center; margin-top: 4px; }
body.single-column .dd-article-body .dd-toc-more {
  background: none; border: 1px solid #d8cfba; border-radius: 999px; color: #666;
  font-size: .82em; padding: 6px 22px; cursor: pointer; }
body.single-column .dd-article-body .dd-toc-more:hover { color: var(--dd-gold-deep, #96743a); border-color: var(--dd-gold, #b08d4f); }
@media (max-width: 600px) {
  body.single-column .dd-article-body .dd-toc { padding: 16px 16px 12px; }
  body.single-column .dd-article-body .dd-toc a { font-size: .9em; }
  body.single-column .dd-article-body .dd-toc-collapsed .dd-toc-list { max-height: 220px; }
}
