/* 汎用ブロック - フレーム */
.box-related-post-frame-block,
.box-related-post-frame-block-editor {
  position: relative;
  padding: 16px 16px 0 16px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
  border: 2px solid #fbbe0a;
  margin-top: 53px;
}

.body
  .wp-block-custom-blocks-box-related-post-frame-block
  .block-editor-inner-blocks
  .wp-block,
.body .box-related-post-frame-block .block-editor-inner-blocks .wp-block {
  margin-bottom: 16px !important;
}

/* components-placeholder に対する特異性の高いセレクタ */
.body
  .wp-block-custom-blocks-box-related-post-frame-block
  .components-placeholder,
.body .box-related-post-frame-block .components-placeholder,
.body .wp-block-custom-blocks-box-related-post-frame-block .wp-block-embed,
.body .box-related-post-frame-block .wp-block-embed {
  margin-bottom: 16px !important;
}

/* フレームラベル */
.frame-label-related {
  position: absolute;
  top: -25px;
  left: -2px;
  background-color: #fbbe0a;
  border-top-right-radius: 6px;
  border-top-left-radius: 6px;
  color: white;
  padding: 2px 8px;
  font-size: 15px;
  line-height: 21px;
  font-weight: 700;
  z-index: 1;
  height: 25px;
  letter-spacing: 0.03em;
  /* overflow: hidden; */
}

/* ===========================================
   WordPressコアスタイル上書き用セレクタ
   特異性を最大限高めてmargin-bottom: 16pxを強制適用
   =========================================== */

/* 編集画面用: 具体的なブロック要素を個別指定 */
.body
  .wp-block-custom-blocks-box-related-post-frame-block
  .block-editor-inner-blocks
  .components-placeholder.wp-block-embed,
.body
  .box-related-post-frame-block-editor
  .block-editor-inner-blocks
  .components-placeholder.wp-block-embed,
.body
  .wp-block-custom-blocks-box-related-post-frame-block
  .block-editor-inner-blocks
  .wp-block.wp-block-embed,
.body
  .box-related-post-frame-block-editor
  .block-editor-inner-blocks
  .wp-block.wp-block-embed,
.body
  .wp-block-custom-blocks-box-related-post-frame-block
  .block-editor-inner-blocks
  .block-editor-block-list__block,
.body
  .box-related-post-frame-block-editor
  .block-editor-inner-blocks
  .block-editor-block-list__block {
  margin-bottom: 16px !important;
}

/* 記事表示画面用: figure要素（埋め込みブロックが変換される） */
.body
  .article
  .wp-block-custom-blocks-box-related-post-frame-block
  figure.wp-block-embed,
.body .article .box-related-post-frame-block figure.wp-block-embed,
.entry-content
  .wp-block-custom-blocks-box-related-post-frame-block
  figure.wp-block-embed,
.entry-content .box-related-post-frame-block figure.wp-block-embed,
.body
  .article
  .wp-block-custom-blocks-box-related-post-frame-block
  .wp-block-embed,
.body .article .box-related-post-frame-block .wp-block-embed,
.entry-content
  .wp-block-custom-blocks-box-related-post-frame-block
  .wp-block-embed,
.entry-content .box-related-post-frame-block .wp-block-embed {
  margin-bottom: 16px !important;
}

/* blogcard（内部リンクカード）要素にも適用 */
.body
  .article
  .wp-block-custom-blocks-box-related-post-frame-block
  .blogcard-wrap,
.body .article .box-related-post-frame-block .blogcard-wrap,
.entry-content
  .wp-block-custom-blocks-box-related-post-frame-block
  .blogcard-wrap,
.entry-content .box-related-post-frame-block .blogcard-wrap {
  margin-bottom: 16px !important;
}

/* 包括的セレクタ（最終手段） */
.body .article .wp-block-custom-blocks-box-related-post-frame-block > *,
.body .article .box-related-post-frame-block > *,
.entry-content .wp-block-custom-blocks-box-related-post-frame-block > *,
.entry-content .box-related-post-frame-block > *,
.body .box-related-post-frame-block > *,
.body .box-related-post-frame-block-editor > * {
  margin-bottom: 16px !important;
}

.wp-block-custom-blocks-box-related-post-frame-block figure {
  margin: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block .blogcard {
  border-color: none !important;
  border-width: none !important;
  border-style: none !important;
  color: black;
  padding: 0 !important;
  margin-left: 16px !important;
  margin-right: 16px !important;
  margin-top: 16px !important;
}

.wp-block-custom-blocks-box-related-post-frame-block figure.wp-block-embed {
  border-radius: 6px;
  overflow: hidden;
  margin: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block .blogcard figure {
  width: 140px !important;
  height: 78px !important;
  margin-bottom: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block.box-related-post-frame-block {
  cursor: pointer;
}

.blogcard-content.internal-blogcard-content {
  margin-left: 0 !important;
  padding-left: 8px !important;
  min-height: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block .a-wrap {
  background-color: white !important;
  margin-bottom: 0 !important;
  padding: 16px;
}

.wp-block-custom-blocks-box-related-post-frame-block .a-wrap:hover {
  background-color: rgb(245, 248, 250) !important;
  transition: 0.3s ease-in-out;
}

.wp-block-custom-blocks-box-related-post-frame-block .internal-blogcard {
  margin: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block {
  padding: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block
  figure.wp-block-embed.is-type-wp-embed.is-provider-roo.wp-block-embed-roo {
  margin: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block
  .blogcard-wrap.external-blogcard-wrap.a-wrap.cf {
  margin: 0 !important;
  overflow: hidden !important;
  border-top-right-radius: 6px;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

.wp-block-custom-blocks-box-related-post-frame-block
  .blogcard.external-blogcard.eb-left.cf {
  margin: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block
  .blogcard-wrap.internal-blogcard-wrap.a-wrap.cf {
  margin: 0 !important;
}

.wp-block-custom-blocks-box-related-post-frame-block .blogcard-wrap {
  margin: 0 !important;
  width: 100% !important;
}

.wp-block-custom-blocks-box-related-post-frame-block .blogcard-content {
  min-height: 0 !important;
  margin-left: 0 !important;
  max-height: none !important;
}

.wp-block-custom-blocks-box-related-post-frame-block
  .blogcard-content.external-blogcard-content {
  padding-left: 8px;
}
