/* =========================================================
   Editor Output Base Styles
   作用範囲：.c-editor-output（フロント） / .editor-styles-wrapper（エディタ）
   ※ サイト全体には影響しないよう、本文スコープに限定
========================================================= */

/* ベース（本文内だけ） */
:where(.c-editor-output, .editor-styles-wrapper) {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #000;
  line-height: 1.8;
}

/* 先頭・末尾の余白整形（本文の上下だけ詰める） */
:where(.c-editor-output, .editor-styles-wrapper) > :first-child {
  margin-top: 0;
}
:where(.c-editor-output, .editor-styles-wrapper) > :last-child {
  margin-bottom: 0;
}

/* 段落・見出し */
:where(.c-editor-output, .editor-styles-wrapper) :where(p) {
  margin: 0 0 1em;
  font-size: 16px;
}
:where(.c-editor-output, .editor-styles-wrapper) :where(h1, h2, h3, h4, h5, h6) {
  font-weight: 700;
  line-height: 1.35;
  margin: 2rem 0 0.75rem;
}
:where(.c-editor-output, .editor-styles-wrapper) h1 {
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
}
:where(.c-editor-output, .editor-styles-wrapper) h2 {
  font-size: clamp(1.5rem, 2vw, 1.75rem);
}
:where(.c-editor-output, .editor-styles-wrapper) h3 {
  font-size: 1.25rem;
}

/* テキスト要素 */
:where(.c-editor-output, .editor-styles-wrapper) :where(ul, ol) {
  padding-left: 1.5em;
  margin: 0 0 1.25rem;
}
:where(.c-editor-output, .editor-styles-wrapper) li {
  margin: 0.25em 0;
}

:where(.c-editor-output, .editor-styles-wrapper) a {
  color: inherit;
  text-decoration: underline;
}
:where(.c-editor-output, .editor-styles-wrapper) a:hover {
  text-decoration: none;
}

/* 引用 */
:where(.c-editor-output, .editor-styles-wrapper) blockquote {
  border-left: 4px solid #3a6499;
  background: #f7f9fc;
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  color: #333;
}

/* 画像・キャプション */
:where(.c-editor-output, .editor-styles-wrapper) figure {
  margin: 1.2rem 0;
}
:where(.c-editor-output, .editor-styles-wrapper) img {
  max-width: 100%;
  height: auto;
}
:where(.c-editor-output, .editor-styles-wrapper) figcaption {
  color: #666;
  font-size: 0.875rem;
  text-align: center;
  margin-top: 0.5rem;
}

/* 表 */
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-table table {
  border-collapse: collapse;
  width: 100%;
}
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-table th,
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-table td {
  border: 1px solid #ddd;
  padding: 0.6rem 0.75rem;
}
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-table thead th {
  background: #f0f3f6;
  font-weight: 700;
}

/* ボタン（ブロックボタンも共通化） */
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-button__link,
:where(.c-editor-output, .editor-styles-wrapper) .btn {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  background: #3a6499;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

/* 埋め込み・動画（レスポンシブ） */
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-embed__wrapper,
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-video {
  max-width: 100%;
}
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-embed.is-type-video iframe,
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-video video {
  display: block;
  width: 100%;
  height: auto;
}

/* コード */
:where(.c-editor-output, .editor-styles-wrapper) code,
:where(.c-editor-output, .editor-styles-wrapper) pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9375rem;
}
:where(.c-editor-output, .editor-styles-wrapper) pre {
  background: #0b1220;
  color: #e6edf3;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow: auto;
}

/* 区切り線 */
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-separator {
  border: none;
  height: 1px;
  background: #e5e7eb;
  margin: 2rem 0;
}

/* カバー上の文字視認性 */
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-cover .wp-block-cover__inner-container {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ギャラリーのギャップ（blockGapがあればそちら優先） */
:where(.c-editor-output, .editor-styles-wrapper) .wp-block-gallery {
  gap: var(--wp--style--block-gap, 1.2rem);
}

/* アクセシビリティ */
:where(.c-editor-output, .editor-styles-wrapper) a:focus-visible,
:where(.c-editor-output, .editor-styles-wrapper) button:focus-visible {
  outline: 2px solid #3a6499;
  outline-offset: 2px;
}
