/*
 * Migration Adjustments
 * WordPress / Gutenberg との競合を解消するための上書き用CSS。
 *
 * [よくある問題と対処]
 * 1. 親クラスを頼るセレクタが効かない
 *    例: .l-wrapper .hero {} → .hero {} に書き直す
 * 2. Gutenberg が content area に max-width を強制する
 *    → .wp-block-post-content { max-width: none !important; } を追加
 * 3. wp:group ブロックに不要なマージンが付く
 *    → .wp-block-group { margin: 0; } を追加
 * 4. wp:heading に Gutenberg のフォントスタイルが当たる
 *    → .wp-block-heading { font-family: inherit; } を追加
 */

.migration-form-placeholder {
	border: 2px dashed #ccc;
	padding: 2rem;
	text-align: center;
	color: #666;
}

/* wp:group はデフォルトで margin/padding 0。テーマ CSS が上書きする場合はここで打ち消す */
.wp-block-group {
	margin-top: 0;
	margin-bottom: 0;
}

/* Add custom adjustments below */

/* ── 構造パッチ 2026-07-20 15:47:36 ── */
/* 1. コンテンツエリアの幅制限・パディングを解除
 *    元サイトのセクションは全幅で設計されているため、
 *    WordPress の .entry-content が設ける max-width / padding を除去する */
.entry-content {
	max-width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	position: relative;
	overflow: hidden;
	background-color: var(--container-bg, #fdfdfc);
}

/* 2. wp:group ブロックに付与されるデフォルトマージンをリセット */
.entry-content .wp-block-group {
	margin-top: 0;
	margin-bottom: 0;
}

/* 3. is-layout-constrained による幅制限・自動センタリングを解除 */
.entry-content :where(.is-layout-constrained) > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: none !important;
	margin-left: initial !important;
	margin-right: initial !important;
}

/* NOTE: 見出しの font-size は移行元CSSに委ねる（上書き不要）
 * 元サイトの .c-head.--lv1 等が priority 20 で正しく適用される */


/* ── クラス消失パッチ 2026-07-20 15:47:48 ── */
/* ━━ 問題1: H2/H3 フォントサイズ ━━
 * 構造パッチのrule4が見出しサイズを継承設定していた問題を修正。
 * 元サイトの .c-head.--lv1 等の font-size を強制適用する */
.entry-content .wp-block-heading.c-head.--lv1 { font-size: 4.2rem !important; }
.entry-content .wp-block-heading.c-head.--lv2 { font-size: 3.2rem !important; }
.entry-content .wp-block-heading.c-head.--lv3 { font-size: 2.4rem !important; }
@media screen and (max-width: 1000px) {
	.entry-content .wp-block-heading.c-head.--lv1 { font-size: 2.2rem !important; }
}
@media screen and (max-width: 767px) {
	.entry-content .wp-block-heading.c-head.--lv1 { font-size: 2.1rem !important; }
	.entry-content .wp-block-heading.c-head.--lv2 { font-size: 1.6rem !important; }
	.entry-content .wp-block-heading.c-head.--lv3 { font-size: 1.4rem !important; }
}

/* ━━ 問題2: サービス内容 (specialities) ━━
 * <ol class="specialities-list"> が <ol class="wp-block-list"> に変換されたため
 * .specialities コンテキストで CSS を代替する */
.specialities > .wp-block-list {
	counter-reset: speciality-counter;
	list-style: none;
	padding: 0;
}
.specialities > .wp-block-list > li {
	position: relative;
	counter-increment: speciality-counter;
}
.specialities > .wp-block-list > li:not(:last-child) { margin-bottom: 15rem; }
@media screen and (min-width: 768px) {
	.specialities > .wp-block-list > li::after {
		content: ""; position: absolute; top: -65px;
		display: block; width: 300px; padding-top: 12%;
		background-repeat: no-repeat; background-position: center 0; background-size: contain;
	}
	.specialities > .wp-block-list > li:nth-child(odd)::after  { right: -150px; }
	.specialities > .wp-block-list > li:nth-child(even)::after { left: -150px;  }
}
@media screen and (max-width: 767px) {
	.specialities > .wp-block-list > li:not(:last-child) { margin-bottom: 5rem; }
	.speciality-item { display: block; }
}

/* ━━ 問題3: EXAMPLE 工事事例グリッド ━━
 * <ul class="menu-list --layout-1"> が <ul class="wp-block-list"> に変換 */
.menu-section.potato > .wp-block-list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 7vw 5.25vw;
	list-style: none;
	padding: 0;
}
@media screen and (max-width: 767px) {
	.menu-section.potato > .wp-block-list {
		grid-template-columns: repeat(2, 1fr);
		gap: 2rem;
	}
}

/* ━━ 問題4: MERITS 2カラムレイアウト ━━
 * <ul class="freeSpace-list"> が <ul class="wp-block-list"> に変換 */
.freespace .wp-block-list {
	position: relative;
	list-style: none;
	padding: 0;
}
.freespace .wp-block-list > li             { position: relative; margin-top: 20rem; }
.freespace .wp-block-list > li:first-child { margin-top: 0; }
.freespace .wp-block-list .item__contents  { display: flex; flex-wrap: wrap; }
.freespace .wp-block-list > li:nth-child(2n) .item__contents { flex-direction: row-reverse; }
.freespace .wp-block-list .item__info-wrap { width: 38.333%; }
.freespace .wp-block-list .item__img-wrap  { z-index: 100; width: 54.583%; margin-left: 7.083%; }
.freespace .wp-block-list > li:nth-child(2n) .item__img-wrap { margin-left: 0; margin-right: 7.083%; }
@media screen and (max-width: 767px) {
	.freespace .wp-block-list > li             { margin-top: 9.6rem; }
	.freespace .wp-block-list .item__contents  { display: block; }
	.freespace .wp-block-list .item__info-wrap,
	.freespace .wp-block-list .item__img-wrap  { width: 100%; margin: 18px 0 0; }
	.freespace .wp-block-list .item__img-wrap  { margin-left: 0; margin-right: 0; }
}


/* ── 構造パッチ 2026-07-20 17:44:19 ── */
/* 1. コンテンツエリアの幅制限・パディングを解除
 *    元サイトのセクションは全幅で設計されているため、
 *    WordPress の .entry-content が設ける max-width / padding を除去する */
.entry-content {
	max-width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	position: relative;
	overflow: hidden;
	background-color: var(--container-bg, #fdfdfc);
}

/* 2. wp:group ブロックに付与されるデフォルトマージンをリセット */
.entry-content .wp-block-group {
	margin-top: 0;
	margin-bottom: 0;
}

/* 3. is-layout-constrained による幅制限・自動センタリングを解除 */
.entry-content :where(.is-layout-constrained) > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
	max-width: none !important;
	margin-left: initial !important;
	margin-right: initial !important;
}

/* NOTE: 見出しの font-size は移行元CSSに委ねる（上書き不要）
 * 元サイトの .c-head.--lv1 等が priority 20 で正しく適用される */


/* ── クラス消失パッチ 2026-07-20 17:44:21 ── */
/* ━━ 問題1: H2/H3 フォントサイズ ━━
 * 構造パッチのrule4が見出しサイズを継承設定していた問題を修正。
 * 元サイトの .c-head.--lv1 等の font-size を強制適用する */
.entry-content .wp-block-heading.c-head.--lv1 { font-size: 4.2rem !important; }
.entry-content .wp-block-heading.c-head.--lv2 { font-size: 3.2rem !important; }
.entry-content .wp-block-heading.c-head.--lv3 { font-size: 2.4rem !important; }
@media screen and (max-width: 1000px) {
	.entry-content .wp-block-heading.c-head.--lv1 { font-size: 2.2rem !important; }
}
@media screen and (max-width: 767px) {
	.entry-content .wp-block-heading.c-head.--lv1 { font-size: 2.1rem !important; }
	.entry-content .wp-block-heading.c-head.--lv2 { font-size: 1.6rem !important; }
	.entry-content .wp-block-heading.c-head.--lv3 { font-size: 1.4rem !important; }
}

/* ━━ 問題2: サービス内容 (specialities) ━━
 * <ol class="specialities-list"> が <ol class="wp-block-list"> に変換されたため
 * .specialities コンテキストで CSS を代替する */
.specialities > .wp-block-list {
	counter-reset: speciality-counter;
	list-style: none;
	padding: 0;
}
.specialities > .wp-block-list > li {
	position: relative;
	counter-increment: speciality-counter;
}
.specialities > .wp-block-list > li:not(:last-child) { margin-bottom: 15rem; }
@media screen and (min-width: 768px) {
	.specialities > .wp-block-list > li::after {
		content: ""; position: absolute; top: -65px;
		display: block; width: 300px; padding-top: 12%;
		background-repeat: no-repeat; background-position: center 0; background-size: contain;
	}
	.specialities > .wp-block-list > li:nth-child(odd)::after  { right: -150px; }
	.specialities > .wp-block-list > li:nth-child(even)::after { left: -150px;  }
}
@media screen and (max-width: 767px) {
	.specialities > .wp-block-list > li:not(:last-child) { margin-bottom: 5rem; }
	.speciality-item { display: block; }
}

/* ━━ 問題3: EXAMPLE 工事事例グリッド ━━
 * <ul class="menu-list --layout-1"> が <ul class="wp-block-list"> に変換 */
.menu-section.potato > .wp-block-list {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 7vw 5.25vw;
	list-style: none;
	padding: 0;
}
@media screen and (max-width: 767px) {
	.menu-section.potato > .wp-block-list {
		grid-template-columns: repeat(2, 1fr);
		gap: 2rem;
	}
}

/* ━━ 問題4: MERITS 2カラムレイアウト ━━
 * <ul class="freeSpace-list"> が <ul class="wp-block-list"> に変換 */
.freespace .wp-block-list {
	position: relative;
	list-style: none;
	padding: 0;
}
.freespace .wp-block-list > li             { position: relative; margin-top: 20rem; }
.freespace .wp-block-list > li:first-child { margin-top: 0; }
.freespace .wp-block-list .item__contents  { display: flex; flex-wrap: wrap; }
.freespace .wp-block-list > li:nth-child(2n) .item__contents { flex-direction: row-reverse; }
.freespace .wp-block-list .item__info-wrap { width: 38.333%; }
.freespace .wp-block-list .item__img-wrap  { z-index: 100; width: 54.583%; margin-left: 7.083%; }
.freespace .wp-block-list > li:nth-child(2n) .item__img-wrap { margin-left: 0; margin-right: 7.083%; }
@media screen and (max-width: 767px) {
	.freespace .wp-block-list > li             { margin-top: 9.6rem; }
	.freespace .wp-block-list .item__contents  { display: block; }
	.freespace .wp-block-list .item__info-wrap,
	.freespace .wp-block-list .item__img-wrap  { width: 100%; margin: 18px 0 0; }
	.freespace .wp-block-list .item__img-wrap  { margin-left: 0; margin-right: 0; }
}
