/* ============================================================
   ブロック本文共通スタイル
   固定ページの公開表示とブロックエディターで同じ指定を使う
   ============================================================ */

.editor-styles-wrapper,
.page-content {
    font-family: var(--hg-font-ja);
    font-size: 0.95rem;
    line-height: 2;
    color: var(--hg-ink);
}

/* 本文の大見出しは公開側のリセット後も、編集画面と同じ大きさを保つ。 */
.editor-styles-wrapper h1:not(.editor-post-title__input),
.page-content h1 {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 2;
    margin: 28px 0;
}

.editor-styles-wrapper h2,
.page-content h2 {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 48px 0 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--hg-accent);
    color: var(--hg-ink);
}

.editor-styles-wrapper h3,
.page-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 36px 0 14px;
    padding-left: 14px;
    border-left: 4px solid var(--hg-accent);
    color: var(--hg-ink);
}

.editor-styles-wrapper h4,
.page-content h4 {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 2;
    margin: 28px 0 12px;
    color: var(--hg-ink);
}

.editor-styles-wrapper p,
.page-content p {
    font-size: 0.95rem;
    line-height: 2;
    margin: 0 0 20px;
    color: var(--hg-ink);
}

.editor-styles-wrapper img,
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ボタンの文字色・背景色は WordPress のブロック設定を使う。 */
.editor-styles-wrapper a:where(:not(.wp-block-button__link, .wp-element-button)),
.page-content a:where(:not(.wp-block-button__link, .wp-element-button)) {
    color: var(--hg-accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.editor-styles-wrapper ul,
.editor-styles-wrapper ol,
.page-content ul,
.page-content ol {
    margin: 0 0 20px;
    padding-left: 1.6em;
}

/* 公開側のリセット CSS で消えるリストマーカーを戻す。 */
.page-content ul,
.page-content ol {
    list-style: revert;
    list-style-position: outside;
}

.editor-styles-wrapper li,
.page-content li {
    font-size: 0.95rem;
    line-height: 2;
    color: var(--hg-ink);
}

.editor-styles-wrapper blockquote,
.page-content blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: var(--hg-surface);
    border-left: 4px solid var(--hg-accent);
    border-radius: 0 10px 10px 0;
    font-size: 0.92rem;
    line-height: 1.9;
    color: var(--hg-muted);
}

.editor-styles-wrapper blockquote p,
.page-content blockquote p {
    color: var(--hg-muted);
    margin-bottom: 0;
}

.editor-styles-wrapper pre,
.page-content pre {
    margin: 24px 0;
    padding: 20px 24px;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.7;
}

.editor-styles-wrapper code,
.page-content code {
    background: var(--hg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
}

.editor-styles-wrapper pre code,
.page-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    color: inherit;
}

.editor-styles-wrapper table,
.page-content table {
    width: 100%;
    margin: 24px 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.editor-styles-wrapper th,
.editor-styles-wrapper td,
.page-content th,
.page-content td {
    padding: 12px 16px;
    border: 1px solid var(--hg-border);
    text-align: left;
}

.editor-styles-wrapper th,
.page-content th {
    background: var(--hg-surface);
    font-weight: 700;
}

.editor-styles-wrapper figure,
.page-content figure {
    margin: 24px 0;
}

.editor-styles-wrapper figcaption,
.page-content figcaption {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--hg-muted);
    text-align: center;
}

/* ── セパレータ ── */
.editor-styles-wrapper .wp-block-separator,
.page-content .wp-block-separator {
    border: none;
    border-top: 2px solid var(--hg-border);
    margin: 32px 0;
}

/* ── ボタン ── */
.editor-styles-wrapper .wp-block-button__link,
.page-content .wp-block-button__link {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

/* ── グループ背景付き ── */
.editor-styles-wrapper .wp-block-group.has-background,
.page-content .wp-block-group.has-background {
    padding: 24px;
    border-radius: 10px;
}

/* クラシックテーマのブロックエディター標準余白を、入れ子のグループ・カラムにも共有する。
   低い詳細度で指定し、WordPress の flex/grid 配置や個別の余白設定を優先する。 */
.editor-styles-wrapper :where(.wp-block-group, .wp-block-columns),
.page-content :where(.wp-block-group, .wp-block-columns) {
    margin-block: 28px;
}
