/* ===== 共通：margin-blockをリセット ===== */
:is(.content-block, .editor-styles-wrapper .block-editor-block-list__layout)
  :is(h2, h3, p, ol, ul, li, figure, figcaption, .box) {
  margin-block-start: 0;
  margin-block-end: 0 !important;
}

/* ボーダー下 */
.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout {
  margin-block-start: 40px;
}

/* テキスト → 見出し */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(p, ol, ul) + h2 {
  margin-block-start: 56px;
}

/* 画像 → 見出し */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(figure + h2, .wp-block:has(figure) + h2) {
  margin-block-start: 56px;
}

/* BOX → 見出し */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
.box + h2 {
  margin-block-start: 56px;
}

/* 見出し → 小見出し */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
h2 + h3 {
  margin-block-start: 16px;
}

/* テキスト → 小見出し */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(p, ol, ul) + h3 {
  margin-block-start: 40px;
}

/* 画像 → 小見出し */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(figure + h3, .wp-block:has(figure) + h3) { 
  margin-block-start: 40px;
}

/* BOX → 小見出し */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
.box + h3 {
  margin-block-start: 40px;
}

/* 見出し → テキスト */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
h2 + :is(p, ol, ul) {
  margin-block-start: 16px;
}

/* 小見出し → テキスト */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
h3 + :is(p, ol, ul) {
  margin-block-start: 16px;
}

/* 画像 → テキスト */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(figure + :is(p, ol, ul), .wp-block:has(figure) + :is(p, ol, ul)) {
  margin-block-start: 16px;
}

/* BOX → テキスト */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
.box + :is(p, ol, ul) {
  margin-block-start: 16px;
}

/* テキスト → テキスト */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
p + p {
  margin-block-start: 16px;
}

/* 見出し → 画像 */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(h2 + figure, h2 + .wp-block:has(figure)) {
  margin-block-start: 16px;
}

/* 小見出し → 画像 */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(h3 + figure, h3 + .wp-block:has(figure)) {
  margin-block-start: 16px;
}

/* テキスト → 画像 */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(:is(p, ol, ul) + figure, :is(p, ol, ul) + .wp-block:has(figure)) {
  margin-block-start: 16px;
}

/* BOX → 画像 */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(.box + figure, .box + .wp-block:has(figure)) {
  margin-block-start: 16px;
}

/* 見出し → BOX */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
h2 + .box {
  margin-block-start: 24px;
}

/* 小見出し → BOX */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
h3 + .box {
  margin-block-start: 24px;
}

/* テキスト → BOX */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(p, ol, ul) + .box {
  margin-block-start: 24px;
}

/* 画像 → BOX */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
:is(figure + .box, .wp-block:has(figure) + .box) {
  margin-block-start: 24px;
}

/* 画像 → キャプション*/
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
figure > figcaption {
  margin-block-start: 8px;
}

/* BOXスタイル */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout) .box {
  padding: 20px;
  background-color: var(--color-background02);
}

/* BOXタイトルのスタイル */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout) .box-title {
  padding-bottom: 8px;
}
.t-box-title {
	font-family: var(--ff-mincho);
	font-weight: var(--fw-semibold);
	font-size: var(--fs-18);
	line-height: var(--lh-160);
}


@media (max-width: 767px){
  /* ボーダー下 */
  .content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout {
    margin-block-start: 24px;
  }

  /* テキスト → 見出し */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(p, ol, ul) + h2 {
    margin-block-start: 40px;
  }

  /* 画像 → 見出し */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(figure + h2, .wp-block:has(figure) + h2) {
    margin-block-start: 40px;
  }

  /* BOX → 見出し */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  .box + h2 {
    margin-block-start: 40px;
  }

  /* 見出し → 小見出し */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  h2 + h3 {
    margin-block-start: 16px;
  }

  /* テキスト → 小見出し */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(p, ol, ul) + h3 {
    margin-block-start: 24px;
  }

  /* 画像 → 小見出し */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(figure + h3, .wp-block:has(figure) + h3) { 
    margin-block-start: 24px;
  }

  /* BOX → 小見出し */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  .box + h3 {
    margin-block-start: 24px;
  }

  /* 見出し → テキスト */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  h2 + :is(p, ol, ul) {
    margin-block-start: 8px;
  }

  /* 小見出し → テキスト */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  h3 + :is(p, ol, ul) {
    margin-block-start: 8px;
  }

  /* 画像 → テキスト */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(figure + :is(p, ol, ul), .wp-block:has(figure) + :is(p, ol, ul)) {
    margin-block-start: 16px;
  }

  /* BOX → テキスト */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  .box + :is(p, ol, ul) {
    margin-block-start: 16px;
  }

  /* 見出し → 画像 */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(h2 + figure, h2 + .wp-block:has(figure)) {
    margin-block-start: 16px;
  }

  /* 小見出し → 画像 */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(h3 + figure, h3 + .wp-block:has(figure)) {
    margin-block-start: 16px;
  }

  /* テキスト → 画像 */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(:is(p, ol, ul) + figure, :is(p, ol, ul) + .wp-block:has(figure)) {
    margin-block-start: 16px;
  }

  /* BOX → 画像 */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(.box + figure, .box + .wp-block:has(figure)) {
    margin-block-start: 16px;
  }

  /* 見出し → BOX */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  h2 + .box {
    margin-block-start: 16px;
  }

  /* 小見出し → BOX */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  h3 + .box {
    margin-block-start: 16px;
  }

  /* テキスト → BOX */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(p, ol, ul) + .box {
    margin-block-start: 16px;
  }

  /* 画像 → BOX */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  :is(figure + .box, .wp-block:has(figure) + .box) {
    margin-block-start: 16px;
  }

  /* 画像 → キャプション*/
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout)
  figure > figcaption {
    margin-block-start: 4px;
  }

  /* BOXスタイル */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout) .box {
    padding: 16px;
  }

  /* BOXタイトルのスタイル */
  :is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout) .box-title {
    padding-bottom: 4px;
  }
  .t-box-title {
    font-size: var(--fs-16);
  }
}

/* リンクの下線 */
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout) :is(p, ol, ul) a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;

	padding-bottom: 0.1em;
  background-image: linear-gradient(180deg, currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 100% 1px;
  transition: background-size 0.3s cubic-bezier(0.17, 0.75, 0.45, 1);
}
:is(.content-block, .editor-styles-wrapper .is-layout-flow.block-editor-block-list__layout) :is(p, ol, ul) a:hover {
	background-position: right bottom;
	background-size: 0 1px;
}