/*
 * 新サイト独自の補足CSS。旧サイトでは別プラグイン（vk-all-in-one-expansion-unit／vk-blocks／スムーススクロール等）や
 * WordPressコアのインラインCSS（global-styles）が担っていた部分を、依存なしで再現する。
 */

/* 固定ヘッダー分だけアンカー移動の位置をずらし、スムーズにスクロールする */
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ログイン中の管理者に出る管理バー（32px／スマホ46px）と固定ヘッダーが重ならないようにする */
.admin-bar .header { top: 32px; }
@media (max-width: 1200px) { .admin-bar .header-nav { top: 102px; } }
@media (max-width: 782px) {
	.admin-bar .header { top: 46px; }
	.admin-bar .header-nav { top: 116px; }
}

/* グループ末尾の要素の下余白を0にする（旧サイトでは vk-blocks のCSSが担っていた規則と同じ） */
.wp-block-group p:last-child,
.wp-block-group ul:last-child,
.wp-block-group ol:last-child,
.wp-block-group dl:last-child,
.wp-block-group table:last-child,
.wp-block-group .wp-block-columns:last-child { margin-bottom: 0; }

/* アイコン（Font Awesome の代わりのインラインSVG） */
.hvr-icon-envelope { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; }

/* WordPressコアのグローバルスタイルのうち、ボタン・レイアウトの既定値（旧サイトでは global-styles-inline が出力していたもの） */
:root :where(.wp-element-button, .wp-block-button__link) {
	background-color: #32373c;
	border-width: 0;
	color: #fff;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	padding: calc(0.667em + 2px) calc(1.333em + 2px);
	text-decoration: none;
}
:where(.is-layout-flex) { gap: 0.5em; }
body .is-layout-flex { display: flex; }
.is-layout-flex { flex-wrap: wrap; align-items: center; }
.is-layout-flex > :is(*, div) { margin: 0; }
.is-layout-flow > .alignleft { float: left; margin-inline-start: 0; margin-inline-end: 2em; }
.is-layout-flow > .alignright { float: right; margin-inline-start: 2em; margin-inline-end: 0; }
.is-layout-flow > .aligncenter { margin-left: auto !important; margin-right: auto !important; }

/* ページ上部へ戻るボタン（旧サイトではプラグイン由来。スクロール後に表示） */
.page_top_btn {
	position: fixed;
	right: 2%;
	bottom: 3%;
	z-index: 9980;
	width: 40px;
	height: 38px;
	background: rgba(0, 0, 0, .8);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .8), 0 0 0 2px rgba(0, 0, 0, .8);
	text-decoration: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .3s, visibility .3s;
}
.page_top_btn::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 10px;
	height: 10px;
	border-top: 2px solid #fff;
	border-left: 2px solid #fff;
	transform: translate(-50%, -30%) rotate(45deg);
}
.page_top_btn > span {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}
.page_top_btn:focus-visible { outline: 2px solid #4f94d4; outline-offset: 2px; }
.scrolled .page_top_btn { opacity: 1; visibility: visible; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { .page_top_btn { transition: none; } }
