/*
 * 旧サイトの CSS（legacy/。html:root 付きで強さをそろえてある）の前に読む「下地合わせ」。
 * テーマ・ONEsta・WordPress が付ける見た目のうち、旧サイトに無かったものを消す。
 * ここで消したものに旧サイトの指定があれば、後から読む legacy/ の指定が勝つ。
 */

/* 本文の文字：旧サイトの指定（reset.css の html・body）を使う。ONEsta の書体設定は旧 CSS（html:root body）の方が強いので、ここでは折り返し（ONEstar の break-word）だけ戻す */
:root body {
	overflow-wrap: normal;
	word-break: normal;
}

/* 見出し：旧サイトは色・書体・行の高さ・字間を親から受け継ぐ（テーマの見出し設定を打ち消す） */
:root :where(.wp-site-blocks) :is(h1, h2, h3, h4, h5, h6) {
	color: inherit;
	font-family: inherit;
	letter-spacing: inherit;
	line-height: inherit;
}

/* ブロックの間の空き：旧サイトには無い（WordPress のブロック間隔を打ち消す）。
   強さは WordPress の :root :where(.is-layout-flow) > * より 1 つ上（body の分）。旧サイトの要素への指定（html:root … h3 の下の余白など）には負けるようにする */
:root body :where(.wp-site-blocks, .wp-site-blocks *) > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* 箱の大きさの数え方：旧サイトは、リセットの CSS で指定した要素以外（::before・::after など）はブラウザの標準（content-box）。
   テーマは全部を border-box にするので、旧サイトに合わせて戻す（旧 CSS で指定のあるものは旧 CSS が勝つ） */
:root :where(.wp-site-blocks) *,
:root :where(.wp-site-blocks) ::before,
:root :where(.wp-site-blocks) ::after {
	box-sizing: content-box;
}
/* ブラウザの標準で border-box のもの（表・ボタン・選択肢など）は、標準に戻す */
:root :where(.wp-site-blocks) :is(table, button, select, meter, progress, input:is([type="button" i], [type="submit" i], [type="reset" i], [type="color" i], [type="search" i], [type="image" i])) {
	box-sizing: border-box;
}

/* 画像：旧サイトは幅を CSS で決めていない画像は実寸のまま（WordPress・テーマの max-width: 100% で縮めない。旧 CSS の指定は旧 CSS が勝つ） */
:root :where(.wp-site-blocks) img {
	max-width: none;
}

/* ページ送り：ONEsta のページ送りの飾り（枠・今のページの背景）は旧サイトに無い。文字の色は旧サイトのリンク・本文の色 */
html:root body :is(.page-numbers, .page-numbers:hover, .page-numbers.current) {
	background: none;
	border: 0;
	border-radius: 0;
}
html:root body span.page-numbers {
	color: inherit;
}
html:root body a.page-numbers:hover {
	color: #0072b4;
}
