/* 下層ページ（固定ページ）本文スタイル
 * core/post-content 内で使用するコンポーネントクラス。
 * CSS変数名はWPが生成する実名を使用（slug "font-18" → --wp--preset--font-size--font-18）
 */

/* ── 下層ページ内の kw-card-service-list--grid は固定2カラム
   section-services-card.css の auto-fit (フロントページ用) を上書き ── */
:root .wp-block-post-content .kw-card-service-list--grid {
	grid-template-columns: repeat(2, 1fr) !important;
}

@media (max-width: 600px) {
	:root .wp-block-post-content .kw-card-service-list--grid {
		grid-template-columns: 1fr !important;
	}
}

/* ── リード文 ── */
.kw-lead-quote {
	background: var(--wp--preset--color--neutral-50);
	border-radius: var(--wp--preset--border-radius--radius-md);
	padding: var(--wp--preset--spacing--size-32);
	margin: 0;
}

.kw-lead-quote p:first-child {
	font-weight: 700;
	color: var(--wp--preset--color--base-text);
}

.kw-lead-quote p:last-child {
	color: var(--wp--preset--color--text-muted);
	margin-bottom: 0;
}

.kw-section-services .kw-lead {
	color: var(--wp--preset--color--surface);
}


/* ── 参考価格テーブル ── */
.kw-price-table {
	margin: 0;
}

.kw-price-table table {
	width: 100%;
	border-collapse: collapse;
	border: none;
}

.kw-price-table thead {
	border-bottom: 1px solid var(--wp--preset--color--border) !important;
}

.kw-price-table thead th {
	background: none;
	color: var(--wp--preset--color--text-muted);
	font-weight: 600;
	text-align: left;
	padding: var(--wp--preset--spacing--size-12) var(--wp--preset--spacing--size-24);
	font-size: var(--wp--preset--font-size--font-14);
	border: none;
}

.kw-price-table thead th:last-child {
	text-align: right;
	white-space: nowrap;
	width: 30%;
}

.kw-price-table tbody td {
	padding: var(--wp--preset--spacing--size-12) var(--wp--preset--spacing--size-24);
	border: none;
	border-bottom: 1px solid var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--font-14);
	line-height: 1.6;
	vertical-align: middle;
}

.kw-price-table tbody td:last-child {
	text-align: right;
	white-space: nowrap;
	font-weight: 700;
	color: var(--wp--preset--color--text-primary);
}

.kw-price-table tbody tr:nth-child(even) td {
	background: var(--wp--preset--color--neutral-50);
}

/* ── 法人導線ボックス ── */
.kw-corp-link p {
	margin-top: 0;
	margin-bottom: var(--wp--preset--spacing--size-8);
}

.kw-corp-link p:last-child {
	margin-bottom: 0;
}

.kw-corp-link a {
	color: var(--wp--preset--color--text-primary);
	font-weight: 700;
	text-decoration: none;
}

.kw-corp-link a:hover {
	text-decoration: underline;
}

/* ── サービス一覧リンクカード（親ページ） ── */
.kw-service-link-card {
	height: 100%;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.kw-service-link-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.kw-service-link-card h3 {
	margin-top: 0;
	margin-bottom: var(--wp--preset--spacing--size-8);
	padding-left: 0;
}

.kw-service-link-card h3::before {
	display: none;
}

/* ── ページ内アンカー: 固定ヘッダーに見出しが隠れないようにする ──
   ヘッダー分の補正は style.css の html { scroll-padding-top: 150px } が担う。
   ここでは見出しの上に余白を足し、移動先でヘッダー直下に張り付かないようにする */
:root .wp-block-post-content :is(h2, h3)[id] {
	scroll-margin-top: var(--wp--preset--spacing--size-16);
}

/* ── ページ内目次 ── */
.kw-toc {
	margin: 0;
}

/* ── ご依頼の流れ: 縦並びステップ（CSSなしでも番号付きリストとして読める） ── */
ol.kw-steps {
	list-style: none;
	counter-reset: kw-step;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--size-16);
}

ol.kw-steps > li {
	counter-increment: kw-step;
	position: relative;
	/* 左余白 + 番号の丸 + 丸と本文の間隔（スペーシングはレスポンシブなので合算で指定） */
	padding: var(--wp--preset--spacing--size-24) var(--wp--preset--spacing--size-24) var(--wp--preset--spacing--size-24)
		calc(var(--wp--preset--spacing--size-24) + var(--wp--preset--spacing--size-48) + var(--wp--preset--spacing--size-16));
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--preset--border-radius--radius-md);
	line-height: 1.8;
}

ol.kw-steps > li::before {
	content: counter(kw-step);
	position: absolute;
	top: var(--wp--preset--spacing--size-24);
	left: var(--wp--preset--spacing--size-24);
	width: var(--wp--preset--spacing--size-48);
	height: var(--wp--preset--spacing--size-48);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--wp--preset--border-radius--radius-full);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-weight: 700;
}

ol.kw-steps > li > strong {
	display: block;
	font-size: var(--wp--preset--font-size--font-20);
	color: var(--wp--preset--color--base-text);
}

@media (max-width: 600px) {
	/* 価格表: 金額列に長い文言が入っても品名列が潰れないよう折り返しを許可 */
	.kw-price-table thead th:last-child {
		width: auto;
	}

	.kw-price-table tbody td:last-child {
		white-space: normal;
	}
}

/* ── カテゴリページの下層ページカード: カード全体をクリック可能にする ── */
.kw-service-link-card {
	position: relative;
}

.kw-service-link-card h3 a {
	color: inherit;
	text-decoration: none;
}

.kw-service-link-card h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}
