/**
 * 固定 .article-header 用の上余白。
 * SWELL 互換で single 等が #body_wrap に付く場合、body.single 前提のルールだけでは余白が効かない。
 * 数値は --livecom-fixed-header-offset のみ変更する（Liver 側と同名で移植しやすい）。
 */
:root {
  --livecom-fixed-header-offset: 48px;
}

/* 主: #body_wrap に body_class() が付く構成 */
#body_wrap.article-header-active {
  padding-top: var(--livecom-fixed-header-offset);
}

/*
 * 互換: #body_wrap に article-header-active が付かない退行環境では body 側に余白を付ける。
 * 通常は #body_wrap にも付くため :has で二重にならないようにする。
 */
body.article-header-active:not(:has(#body_wrap.article-header-active)) {
  padding-top: var(--livecom-fixed-header-offset);
}

/* アンカー位置が固定ヘッダーに隠れないように */
html:has(#body_wrap.single.article-header-active),
html:has(#body_wrap.single-post.article-header-active),
html:has(body.single.article-header-active),
html:has(body.single-post.article-header-active) {
  scroll-padding-top: var(--livecom-fixed-header-offset);
}
