/* ==========================================================================
   components.css：部品（ナビ、ドロワー、ページヘッダー、パンくず、カード、
   サイドバー、ページ送り、ボタン、CTA）
   ========================================================================== */

/* --------------------------------------------------------------------------
   グローバルナビ（PC：1100px以上で表示。2階層のドロップダウン）
   項目が7つ（サービス〜ブログ）と問い合わせボタンが並ぶため、960px では収まらない
   -------------------------------------------------------------------------- */
.global-nav {
	display: none;
}

@media (min-width: 1100px) {
	.global-nav {
		display: block;
		margin-left: auto;
	}
}

.global-nav__list,
.global-nav__list .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.global-nav__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--bm-space-xs);
}

.global-nav__list > li {
	position: relative;
	display: flex;
	align-items: center;
}

.global-nav__list a {
	display: block;
	padding: var(--bm-space-xs) 0.75rem;
	color: var(--bm-color-text);
	font-size: var(--bm-font-size-sm);
	font-weight: var(--bm-font-weight-bold);
	text-decoration: none;
	border-radius: var(--bm-radius-sm);
}

.global-nav__list a:hover,
.global-nav__list .current-menu-item > a {
	color: var(--bm-color-primary);
	background: var(--bm-color-primary-light);
}

/* サブメニューを開くボタン（main.js が追加する） */
.submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin-left: -0.5rem;
	padding: 0;
	background: none;
	border: 0;
	border-radius: var(--bm-radius-sm);
	color: var(--bm-color-text-muted);
	cursor: pointer;
}

.submenu-toggle::before {
	content: "";
	width: 0.45em;
	height: 0.45em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform var(--bm-transition);
}

.submenu-toggle[aria-expanded="true"]::before {
	transform: translateY(2px) rotate(-135deg);
}

.global-nav__list .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	display: none;
	min-width: 14rem;
	padding: var(--bm-space-xs);
	background: var(--bm-color-bg);
	border: 1px solid var(--bm-color-border);
	border-radius: var(--bm-radius-md);
	box-shadow: var(--bm-shadow-md);
}

.global-nav__list .sub-menu a {
	font-weight: normal;
}

/* マウスでは hover で、キーボードではボタン（.is-open）で開く */
.global-nav__list > li:hover > .sub-menu,
.global-nav__list > li.is-open > .sub-menu {
	display: block;
}

/* --------------------------------------------------------------------------
   ドロワー（1100px未満）
   -------------------------------------------------------------------------- */
.drawer-toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--bm-space-xs);
	padding: var(--bm-space-xs) 0.75rem;
	background: none;
	border: 1px solid var(--bm-color-border);
	border-radius: var(--bm-radius-sm);
	color: var(--bm-color-primary-dark);
	font: inherit;
	font-size: var(--bm-font-size-sm);
	cursor: pointer;
}

.drawer-toggle__icon,
.drawer-toggle__icon::before,
.drawer-toggle__icon::after {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
}

.drawer-toggle__icon {
	position: relative;
}

.drawer-toggle__icon::before,
.drawer-toggle__icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.drawer-toggle__icon::before {
	top: -6px;
}

.drawer-toggle__icon::after {
	top: 6px;
}

@media (min-width: 1100px) {
	.drawer-toggle {
		display: none;
	}
}

.drawer[hidden] {
	display: none;
}

.drawer {
	position: fixed;
	inset: 0;
	z-index: 200;
}

.drawer__backdrop {
	position: absolute;
	inset: 0;
	background: var(--bm-color-overlay);
}

/* 面は下部の問い合わせの帯（pages.css の .cta-band）と同じネイビーと 32px の方眼。文字は白。
   上から「閉じる」・メニュー・問い合わせ。スクロールするのはメニューだけで、問い合わせは常に下に見せる。
   パネルの overflow-y は、高さが極端に足りないときに全体をスクロールできるようにする予備 */
.drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(85vw, 360px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background-color: var(--bm-color-primary);
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
	background-size: 32px 32px;
	box-shadow: var(--bm-shadow-lg);
	color: var(--bm-color-on-primary);
}

/* ネイビーの上では青のフォーカスの線が見えにくいので、白にする */
.drawer__panel :focus-visible {
	outline: 3px solid var(--bm-color-on-primary);
	outline-offset: 2px;
}

.drawer__close {
	flex: none;
	align-self: flex-end;
	min-height: 44px;
	margin: var(--bm-space-sm) var(--bm-space-md) var(--bm-space-xs);
	padding: var(--bm-space-xs) 1rem;
	background: none;
	border: 1px solid var(--bm-color-on-primary);
	border-radius: var(--bm-radius-sm);
	color: var(--bm-color-on-primary);
	font: inherit;
	font-size: var(--bm-font-size-sm);
	cursor: pointer;
}

.drawer__close:hover {
	background: var(--bm-color-on-dark-line);
}

/* 左右と上下の余白は、フォーカスの線が切れないための分も兼ねる */
.drawer__nav {
	flex: 1 1 0;
	min-height: 120px;
	padding: 6px var(--bm-space-md) var(--bm-space-sm);
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-padding-bottom: 56px; /* キーボードで移った項目が、下のぼかしに重ならないように */
}

.drawer__list,
.drawer__list .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* 大きな分類：太字。右に英字のラベル（inc/setup.php の bm_theme_drawer_menu_label()） */
.drawer__list a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 0.875rem 4px;
	border-bottom: 1px solid var(--bm-color-on-dark-line);
	color: var(--bm-color-on-primary);
	font-size: 1.0625rem;
	font-weight: var(--bm-font-weight-bold);
	line-height: 1.6;
	text-decoration: none;
	word-break: auto-phrase;
}

.drawer__list a:hover {
	background: var(--bm-color-on-dark-surface);
	color: var(--bm-color-on-primary);
}

/* 子の項目：少し小さく、字下げする */
.drawer__list .sub-menu a {
	padding-block: 0.75rem;
	padding-left: 1.25rem;
	color: rgba(255, 255, 255, 0.86);
	font-size: 0.9375rem;
	font-weight: 400;
}

.drawer__en {
	flex: none;
	color: rgba(255, 255, 255, 0.72);
	font-family: var(--bm-font-en), var(--bm-font-base);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: var(--bm-tracking-wider, 0.16em);
	text-transform: uppercase;
}

/* いちばん下：問い合わせのボタン（ドロワーでオレンジを使うのはここだけ）と補足 */
.drawer__contact {
	position: relative;
	flex: none;
	padding: var(--bm-space-sm) var(--bm-space-md);
	border-top: 1px solid var(--bm-color-on-dark-faint);
}

/* メニューに続きがあるときだけ、下端を薄くぼかす（main.js が .has-more を付け外しする。一番下で消える） */
.drawer__contact::before {
	position: absolute;
	right: 0;
	bottom: calc(100% + 1px);
	left: 0;
	height: 56px;
	background: linear-gradient(to bottom, transparent, var(--bm-color-primary));
	content: "";
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--bm-transition);
}

.drawer__panel.has-more .drawer__contact::before {
	opacity: 1;
}

.drawer__contact > * {
	margin: 0;
}

.drawer__contact .drawer__en--contact {
	margin-bottom: 8px;
}

.drawer__cta .button {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	text-align: center;
}

.drawer__contact .drawer__notes {
	display: grid;
	gap: 2px;
	margin-top: 12px;
	padding: 0;
	color: rgba(255, 255, 255, 0.86);
	font-size: 0.8125rem;
	line-height: 1.7;
	list-style: none;
}

.drawer__notes li {
	margin: 0;
	overflow-wrap: anywhere;
}

/* 横向きのスマホなど高さが低いときは、メニューを見せる分を確保するため、補足を出さない */
@media (max-height: 560px) {
	.drawer__contact .drawer__notes {
		display: none;
	}
}

body.is-drawer-open {
	overflow: hidden;
}

/* --------------------------------------------------------------------------
   ページ見出しの帯（H1。design-v2 段階6-c-0 §1-1。template-parts/page-header.php）
   写真を使わない淡いグレーの帯。下に細い線と、左に濃紺の短い線（セクションの見出しと同じ記号）。
   上から パンくず → 英字のラベル → H1 → 説明文 → タグ。
   -------------------------------------------------------------------------- */
.page-header {
	position: relative;
	padding-block: clamp(24px, 2.5vw, 36px) clamp(36px, 4vw, 56px);
	background: var(--bm-color-bg-subtle);
	border-bottom: 1px solid var(--bm-color-border);
}

.page-header__body {
	position: relative;
	z-index: 1; /* 背景の装飾（英字）より前 */
}

/* 帯の背景の装飾（inc/page-headers.php の bg_style・bg_word）：32px の方眼 */
.page-header.page-header--grid {
	background-image:
		linear-gradient(to right, rgba(20, 40, 75, 0.06) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(20, 40, 75, 0.06) 1px, transparent 1px);
	background-size: 32px 32px;
}

/* 右側の白抜きの大きな英字（1200px 以上だけ。狭い幅では文字に重なるので出さない）。右端はコンテンツの幅の右端、上下は中央。帯より大きい分は切れる */
@media (min-width: 1200px) {
	.page-header[data-bg-word]::after {
		position: absolute;
		top: 0;
		right: max(var(--bm-gutter), calc((100% - var(--bm-width-wide)) / 2));
		bottom: 0;
		z-index: 0;
		margin-right: -0.035em; /* 字面の右の余白の分を外に出して、字の右端をコンテンツの右端にそろえる */
		display: flex;
		align-items: center;
		overflow: hidden;
		padding-bottom: 0.1em; /* 大文字の見た目の中心を、帯の中央に合わせる */
		color: transparent;
		font-family: var(--bm-font-en);
		font-size: 200px;
		font-weight: 600;
		line-height: 1;
		white-space: nowrap;
		pointer-events: none;
		-webkit-text-stroke: 1.2px rgba(20, 40, 75, 0.16);
		content: attr(data-bg-word);
		content: attr(data-bg-word) / ""; /* 読み上げない（対応していないブラウザは上の指定） */
	}
}

/* 左下の濃紺の短い線（帯の下の線の上に重ねる） */
.page-header__body::after {
	position: absolute;
	bottom: calc(-1 * clamp(36px, 4vw, 56px) - 1px);
	left: var(--bm-gutter);
	width: 48px;
	height: 2px;
	background: var(--bm-color-primary);
	content: "";
}

/* パンくず（帯の中） */
.page-header .breadcrumbs {
	margin-bottom: clamp(20px, 2.5vw, 32px);
	padding: 0;
}

.page-header .breadcrumbs .container {
	max-width: none;
	padding: 0;
}

.page-header__label {
	margin: 0 0 10px;
	padding-left: 36px;
	background: linear-gradient(currentColor, currentColor) left center / 24px 1px no-repeat;
	color: var(--bm-color-text-muted);
	font-family: var(--bm-font-en);
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: var(--bm-tracking-wider);
	line-height: 1.6;
	text-transform: uppercase;
}

.page-header__title {
	max-width: 30em;
	margin: 0;
	color: var(--bm-color-primary-dark);
	font-size: clamp(1.625rem, 1.1rem + 2vw, 2.625rem);
	line-height: 1.4;
	letter-spacing: 0.02em;
	text-wrap: balance;
}

.page-header__sub {
	margin: 12px 0 0;
	color: var(--bm-color-text-muted);
	font-weight: var(--bm-font-weight-bold);
}

.page-header__catch {
	margin: 12px 0 0;
	color: var(--bm-color-primary-dark);
	font-size: var(--bm-font-size-lg);
	font-weight: var(--bm-font-weight-bold);
}

.page-header__desc {
	max-width: 40em;
	margin: 16px 0 0;
	color: var(--bm-color-text);
	line-height: 1.9;
}

.page-header__desc--pc {
	display: none;
}

@media (min-width: 768px) {
	.page-header__desc--pc {
		display: block;
	}

	.page-header__desc--sp {
		display: none;
	}
}

/* 帯の中のボタン（inc/page-headers.php の buttons）。問い合わせだけオレンジ、ほかは濃紺の線。スマホは縦に並べて幅いっぱい */
.page-header__buttons {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 24px 0 0;
	padding: 0;
	list-style: none;
}

.page-header__buttons li {
	margin: 0;
}

.page-header__button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	min-height: 52px;
	padding: 0.6em 1.6em;
	border: 1px solid var(--bm-color-primary);
	border-radius: var(--bm-radius-sm);
	background: var(--bm-color-bg);
	color: var(--bm-color-primary);
	font-weight: var(--bm-font-weight-bold);
	line-height: 1.5;
	text-decoration: none;
}

.page-header__button:hover {
	background: var(--bm-color-primary-light);
	color: var(--bm-color-primary);
}

.page-header__button--cta {
	border-color: var(--bm-color-cta);
	background: var(--bm-color-cta);
	color: var(--bm-color-cta-text);
}

.page-header__button--cta:hover {
	border-color: var(--bm-color-cta-hover);
	background: var(--bm-color-cta-hover);
	color: var(--bm-color-cta-text);
}

@media (min-width: 600px) {
	.page-header__buttons {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.page-header__button {
		min-width: 15rem;
	}
}

/* タグ（課題別：属する3本柱、記事：カテゴリー）：細い枠 */
.page-header__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.page-header__tags li {
	margin: 0;
	padding: 3px 12px;
	border: 1px solid rgba(20, 40, 75, 0.28);
	background: var(--bm-color-bg);
	color: var(--bm-color-primary-dark);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.6;
}

.page-title {
	margin-block: var(--bm-space-lg) var(--bm-space-md);
	font-size: var(--bm-font-size-xl);
}

/* --------------------------------------------------------------------------
   パンくず（AIOSEO）
   -------------------------------------------------------------------------- */
.breadcrumbs {
	padding-block: var(--bm-space-xs);
	color: var(--bm-color-text-muted);
	font-size: var(--bm-font-size-sm);
}

.breadcrumbs a {
	color: var(--bm-color-text-muted);
}

.breadcrumbs + .container,
.page-header + .container {
	margin-top: var(--bm-space-md);
}

/* --------------------------------------------------------------------------
   トップページの仮のヒーロー（デザインはフェーズ4）
   -------------------------------------------------------------------------- */
.front-hero {
	padding-block: var(--bm-space-xl);
	background: var(--bm-color-primary-light);
}

.front-hero__title {
	font-size: var(--bm-font-size-xl);
}

@media (min-width: 768px) {
	.front-hero__title {
		font-size: var(--bm-font-size-xxl);
	}
}

.front-hero__desc {
	max-width: var(--bm-width-content);
}

/* --------------------------------------------------------------------------
   カード一覧
   -------------------------------------------------------------------------- */
.card-list {
	display: grid;
	gap: var(--bm-space-md);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--bm-color-bg);
	border: 1px solid var(--bm-color-border);
	border-radius: var(--bm-radius-md);
	box-shadow: var(--bm-shadow-sm);
}

/* 画像の枠は 3:2（一覧の画像サイズ bm-card などと同じ比率。design-v2 段階6-c-0 §5） */
.card__media {
	aspect-ratio: 3 / 2;
	background: var(--bm-color-surface);
}

.card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 3:2 と比率が大きく違う画像：切り抜かずに縮小し、淡いグレーの余白を付ける（文字の入ったバナーが切れないように） */
.card__media--contain .card__image {
	object-fit: contain;
}

.card__body {
	padding: var(--bm-space-sm);
}

.card__meta {
	margin-bottom: var(--bm-space-xs);
	color: var(--bm-color-text-muted);
	font-size: var(--bm-font-size-sm);
}

.card__title {
	font-size: var(--bm-font-size-md);
}

.card__link {
	color: var(--bm-color-primary-dark);
	text-decoration: none;
}

/* カード全体をクリックできるようにする（リンクは見出しの1つだけ） */
.card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card:focus-within {
	outline: 3px solid var(--bm-color-focus);
	outline-offset: 2px;
}

.card__link:focus-visible {
	outline: none;
}

.card__excerpt {
	margin-bottom: 0;
	color: var(--bm-color-text-muted);
	font-size: var(--bm-font-size-sm);
}

.content-none {
	padding-block: var(--bm-space-lg);
}

/* --------------------------------------------------------------------------
   記事の詳細
   -------------------------------------------------------------------------- */
.entry__thumbnail {
	margin-bottom: var(--bm-space-md);
}

.entry__thumbnail img {
	display: block;
	border-radius: var(--bm-radius-md);
}

/* 実績の概要 */
/* --------------------------------------------------------------------------
   サイドバー
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   ページ送り
   -------------------------------------------------------------------------- */
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--bm-space-xs);
	margin-top: var(--bm-space-lg);
}

.pagination .page-numbers {
	display: inline-block;
	min-width: 2.5rem;
	padding: var(--bm-space-xs) 0.75rem;
	border: 1px solid var(--bm-color-border);
	border-radius: var(--bm-radius-sm);
	text-align: center;
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--bm-color-primary);
	border-color: var(--bm-color-primary);
	color: var(--bm-color-on-primary);
}

/* --------------------------------------------------------------------------
   ボタン・CTA
   -------------------------------------------------------------------------- */
.button {
	display: inline-block;
	padding: 0.75rem 1.5rem;
	border-radius: var(--bm-radius-md);
	font-weight: var(--bm-font-weight-bold);
	text-decoration: none;
}

.button--cta {
	background: var(--bm-color-cta);
	color: var(--bm-color-cta-text);
}

.button--cta:hover {
	background: var(--bm-color-cta-hover);
}

/* ヘッダーの問い合わせボタン（768px 未満は画面下の追従CTAがあるので出さない） */
.site-header__cta {
	display: none;
	flex-shrink: 0;
	padding: 0.6rem 1.25rem;
	font-size: var(--bm-font-size-sm);
	white-space: nowrap;
}

@media (min-width: 768px) {
	.site-header__cta {
		display: inline-block;
		margin-left: auto;
	}
}

@media (min-width: 1100px) {
	.site-header__cta {
		margin-left: 0;
	}
}

/* コアのボタンブロック：スタイル「問い合わせ（オレンジ）」と「アウトライン」（トップページ・本文共通） */
.wp-block-button.is-style-cta .wp-block-button__link,
.post_content .wp-block-button.is-style-cta .wp-block-button__link {
	background: var(--bm-color-cta);
	border: 2px solid var(--bm-color-cta);
	border-radius: var(--bm-radius-md);
	color: var(--bm-color-cta-text);
	font-weight: var(--bm-font-weight-bold);
}

.wp-block-button.is-style-cta .wp-block-button__link:hover,
.post_content .wp-block-button.is-style-cta .wp-block-button__link:hover {
	background: var(--bm-color-cta-hover);
	border-color: var(--bm-color-cta-hover);
}

/* スマホの追従CTA */
.cta-fixed {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 90;
	padding: 8px var(--bm-gutter);
	background: var(--bm-color-bg-translucent);
	border-top: 1px solid var(--bm-color-border);
}

.cta-fixed__button {
	display: block;
	padding: 0.6rem 1rem;
	background: var(--bm-color-cta);
	border-radius: var(--bm-radius-md);
	color: var(--bm-color-cta-text);
	font-weight: var(--bm-font-weight-bold);
	text-align: center;
	text-decoration: none;
}

@media (min-width: 768px) {
	.cta-fixed {
		display: none;
	}
}

/* 検索フォーム */
.search-form {
	display: flex;
	gap: var(--bm-space-xs);
	margin-bottom: var(--bm-space-md);
}

.search-form label {
	flex: 1;
}

.search-field {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--bm-color-border);
	border-radius: var(--bm-radius-sm);
	font: inherit;
}

.search-submit {
	padding: 0.5rem 1rem;
	background: var(--bm-color-primary);
	border: 0;
	border-radius: var(--bm-radius-sm);
	color: var(--bm-color-on-primary);
	font: inherit;
	cursor: pointer;
}

/* --------------------------------------------------------------------------
   ページ上部に固定する目次（サービス・業種ページ。inc/template-tags.php の bm_theme_toc()）
   横に並べ、入りきらないときは横にスクロールする。ヘッダー（sticky）のすぐ下に固定する。
   -------------------------------------------------------------------------- */
.page-toc {
	position: sticky;
	top: calc(var(--bm-header-height) + 4px);
	z-index: 50;
	background: var(--bm-color-bg); /* 不透明（半透明だと下の本文の文字が透けて見えるため） */
	border-bottom: 1px solid var(--bm-color-border);
}

.admin-bar .page-toc {
	top: calc(var(--bm-header-height) + 4px + var(--wp-admin--admin-bar--height, 0px));
}

/* 番号（Barlow）＋細い縦線で区切る一覧（design-v2 段階6-c-0 §1-2）。入りきらないときは横にスクロール */
.page-toc__list {
	display: flex;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	list-style: none;
	counter-reset: bm-toc;
	scrollbar-width: thin;
}

.page-toc__list > li {
	flex: 0 0 auto;
	margin: 0;
	border-left: 1px solid var(--bm-color-border);
	counter-increment: bm-toc;
}

.page-toc__list > li:last-child {
	border-right: 1px solid var(--bm-color-border);
}

.page-toc__list a {
	display: flex;
	align-items: baseline;
	gap: 10px;
	min-height: 48px;
	padding: 13px 20px 12px;
	color: var(--bm-color-primary-dark);
	font-size: var(--bm-font-size-sm);
	font-weight: 700;
	line-height: 1.6;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.page-toc__list a::before {
	color: var(--bm-color-primary);
	font-family: var(--bm-font-en);
	font-size: 0.875rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: var(--bm-tracking-wide);
	content: counter(bm-toc, decimal-leading-zero);
	content: counter(bm-toc, decimal-leading-zero) / "";
}

.page-toc__list a:hover {
	background: var(--bm-color-bg-subtle);
	box-shadow: inset 0 -2px 0 var(--bm-color-primary);
}

.page-toc__list a:focus-visible {
	outline: 3px solid var(--bm-color-focus);
	outline-offset: -3px;
}

/* 今読んでいる見出しの項目（main.js が .is-current を付ける）。見た目は記事の右の目次とそろえる */
.page-toc__list > li.is-current {
	background: var(--bm-color-bg-subtle);
	box-shadow: inset 3px 0 0 var(--bm-color-primary);
}

.page-toc__list > li.is-current a {
	color: var(--bm-color-primary-dark);
	font-weight: var(--bm-font-weight-bold);
}

/* 目次から移動したとき、見出しがヘッダーと目次に隠れないようにする（JavaScript なしと、# つきの URL を開いたとき）。
   ヘッダーの高さは html の scroll-padding-top で空けているので、ここでは目次の高さと余白（と管理バー）だけを足す */
.page-toc ~ .container h2[id],
.page-toc ~ .container h3[id] {
	scroll-margin-top: calc(80px + var(--wp-admin--admin-bar--height, 0px));
}

/* 目次から移動した見出しには、マウスの操作のときは枠を出さない */
h2[tabindex="-1"]:focus:not(:focus-visible),
h3[tabindex="-1"]:focus:not(:focus-visible) {
	outline: none;
}

/* ページの先頭へ戻るボタン（右下。ネイビー。少しスクロールしたら表示。main.js） */
.back-to-top {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 80;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	background: var(--bm-color-primary);
	border: 1px solid var(--bm-color-on-primary);
	border-radius: var(--bm-radius-sm);
	box-shadow: var(--bm-shadow-md);
	color: var(--bm-color-on-primary);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.back-to-top[hidden] {
	display: none;
}

.back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
}

.back-to-top:hover {
	background: var(--bm-color-primary-dark);
}

.back-to-top:focus-visible {
	outline: 3px solid var(--bm-color-focus);
	outline-offset: 2px;
}

/* スマホ：画面下の追従CTAの上に置く */
@media (max-width: 767px) {
	body:has(.cta-fixed) .back-to-top {
		bottom: calc(var(--bm-cta-fixed-height) + 12px);
	}
}

/* 一覧の前の説明 */
/* 実績がまだないときの「取り組み事例」 */
/* 目次のすぐ下の本文との間 */
.page-toc + .container {
	margin-top: var(--bm-space-lg);
}

/* ページ内の目次の項目名：短い名前（ブロックの名前）がないときは見出しの文字を使うので、長いときは約16文字で省略する（全文は title） */
.page-toc__text {
	display: block;
	max-width: 16em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* --------------------------------------------------------------------------
   帯の中のパンくず（AIOSEO）：下線なしの控えめなグレー。マウスを合わせたときだけ下線。
   区切りは「›」（AIOSEO の区切りの文字は設定のまま、見た目だけ CSS で置き換える。読み上げでは区切りを読まない）
   -------------------------------------------------------------------------- */
.page-header .aioseo-breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 0;
	color: var(--bm-color-text-muted);
	font-size: 0.8125rem;
	line-height: 1.6;
}

.page-header .aioseo-breadcrumbs a {
	color: var(--bm-color-text-muted);
	text-decoration: none;
}

.page-header .aioseo-breadcrumbs a:hover {
	color: var(--bm-color-primary);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.page-header .aioseo-breadcrumb-separator {
	margin: 0 8px; /* 文字の大きさを 0 にしているので、em ではなく px */
	font-size: 0;
}

.page-header .aioseo-breadcrumb-separator::before {
	color: rgba(20, 40, 75, 0.4);
	font-size: 0.875rem;
	content: "›";
	content: "›" / "";
}

/* 帯のタグ：リンクのもの（3本柱・カテゴリー）は細い枠と矢印。リンクでないものは枠のない控えめなラベル */
.page-header__tags li {
	padding: 0;
	border: 0;
	background: none;
}

.page-header__tags a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 32px;
	padding: 3px 12px;
	border: 1px solid rgba(20, 40, 75, 0.28);
	background: var(--bm-color-bg);
	color: var(--bm-color-primary-dark);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.6;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.page-header__tags a::after {
	color: var(--bm-color-primary);
	font-weight: 400;
	content: "→";
	content: "→" / "";
}

.page-header__tags a:hover {
	border-color: var(--bm-color-primary);
	color: var(--bm-color-primary);
}

.page-header__tags a:focus-visible {
	outline: 3px solid var(--bm-color-focus);
	outline-offset: 2px;
}

.page-header__tags span {
	color: var(--bm-color-text-muted);
	font-size: 0.8125rem;
	font-weight: 700;
}
