/*
 * スマホ幅（media="only screen and (max-width: 768px)" で読む）で、PC のマークアップに現行スマホ（WPtouch bauhaus）の見た目を寄せる。
 * 本文は PC テンプレートの出力をそのまま使う。WPtouch の CSS（mobile/assets/）が効くよう、テンプレート側で
 * .post・.post-title・.post-page-content を足してあり、ここでは WPtouch に無い PC 固有の部分だけを扱う。
 */

/* ---- PC にしか要らない周り ---- */
#header_area > h1, #header_left, #headr_right, #global_navi,
#pankuzu, .page_category_name, #pagetop,
#page_content_area > p.pic, #top_content_area > p.pic,
#page_main_content_right > p.pic, #page_main_content_right #side_content, #page_main_content_right #side_ul02,
#top_main_left > h2, #footer_contact_box,
#container > h1, #navi, #main-contents p.al-r, #main > p.pic, #main > #side_content, #main > #side_ul02 {
	display: none !important;
}

/* ---- WPtouch の pushit がページ本体に付けていた style。sp-nav.js が #body / #container に .page-wrapper を付ける ---- */
.page-wrapper { position: relative; transition: transform .33s cubic-bezier(.290, .050, .140, .870); }

/* ---- 本文の画像の中央寄せ。WPtouch の .aligncenter と同じ規則（sp-nav.js が付ける） ---- */
.gofuku-sp-center { text-align: center !important; margin-left: auto !important; margin-right: auto !important; float: none !important; display: block !important; }
.post-page-content img.gofuku-sp-center { padding: 0 !important; border: none !important; }

/* ---- 固定ページ・投稿：本番はカテゴリーの一覧 → 見出し → 本文の順 ---- */
#page_main_content { display: flex; flex-direction: column; }
#page_main_content_right { order: -1; }

/* 見出し：本番は #content h2（WPtouch）。PC は h3 なので大きさと余白を h2 に合わせる */
.post-title.heading-font {
	font-size: 1.5em;
	font-weight: bold;
	margin: 15px 0;
	line-height: 130%;
}

/* PC 用に幅を固定した要素・画像を画面幅に収める */
[style*="width: 640px"], [style*="width:640px"] { width: auto !important; }
#top_main_left img, .post img { max-width: 100%; height: auto; }

/* ---- トップ：バナー列（本番スマホの index と同じ背景・並び） ---- */
/* ヒーローの下だけ本番は 38px、バナーどうしは 20px。p の margin を変えるとバナーどうしの間隔まで動くので、ヒーロー側で足す。
   margin だと次のバナーの margin-top（20px）と相殺されて 2px しか増えないので padding にする */
#gofuku-sp-hero { padding-bottom: 18px; }
#top_main_left > p > a > img { width: 100%; }
#top_main_left img[src*="/bland."], #top_main_left img[src*="/rental."] { width: 50%; }
#brand, #deguchi, #code {
	background-repeat: no-repeat;
	background-position: bottom;
	background-size: cover;
	text-align: center;
	margin-top: 0;
}
#brand { background-image: url(../top_image/back-.jpg); padding-top: 80px; }
#deguchi { background-image: url(../top_image/deguchi_2.jpg); padding-top: 115px; }
#code { background-image: url(../top_image/code.jpg); padding-top: 110px; }
#brand img, #code img { width: 30% !important; }
/* index.php の各画像に PC 用の style="margin: 10px;" が直書きされており、!important が無いとそちらが勝って3枚目が折り返す */
#deguchi img { margin: 5px !important; width: 28% !important; }
#top_main_right { text-align: center; }
#gofuku-sp-news-more { text-align: center; margin: 30px 0; }

/* ---- 検索結果：本番スマホと同じくタイトルの一覧にする（PC は1件ごとに本文全体・タグ・投稿情報を出す） ---- */
#container > #header #top-menu { display: none; }
#main-contents:has(> h2 > a[rel="bookmark"]) > .contents,
#main-contents:has(> h2 > a[rel="bookmark"]) > h3 { display: none; }
#main-contents > h2:has(> a[rel="bookmark"]) { font-size: 1.1em; margin: 0; padding: 12px 15px; border-bottom: 1px solid rgba(0,0,0,.1); line-height: 140%; }
#main-contents > h2 > a[rel="bookmark"] { display: block; }

/* ---- 旧形式のテンプレート（検索の該当なし・サイトマップ）の見出し：固定ページの見出しと同じ ---- */
#main-contents > h2:not(:has(> a[rel="bookmark"])) { font-size: 1.5em; font-weight: bold; margin: 15px 0; padding: 0; line-height: 130%; }
#main-contents .menu ul { padding: 0 15px; }
#main-contents .menu li { list-style: none; }
#main-contents .menu li a { display: block; padding: 10px 0; border-bottom: 1px solid rgba(0,0,0,.1); }
#main-contents .menu ul.sub { padding: 0 0 0 15px; }

/* ---- カテゴリー一覧：本番スマホと同じく日付とタイトルの一覧にする（PC は1件ごとに本文全体を出す） ---- */
.gofuku-sp-list .post-page-content { display: none; }
.gofuku-sp-list .page_title.post-title { font-size: 1em; font-weight: normal; margin: 0; padding: 0; line-height: 140%; }
.gofuku-sp-list .page_title > a { display: block; padding: 12px 15px; border-bottom: 1px solid rgba(0,0,0,.1); }
.gofuku-sp-date { display: block; font-size: 80%; color: rgba(0,0,0,.6); }
/* 記事の画面の日付（現行スマホと同じく、タイトルの上に小さな灰色で出す） */
.gofuku-sp-post-date { font-size: 12px; color: rgba(0,0,0,.5); margin: 2px 0 4px 10px; line-height: 1.4; }
#main-contents > .al-r { text-align: center; padding: 15px; }
#main-contents > .contents, #main-contents > p, #main-contents > .contents ul.topics { padding: 0 15px; }
.wp-pagenavi { text-align: center; padding: 15px 0; }
.wp-pagenavi a, .wp-pagenavi span { display: inline-block; padding: 3px 8px; margin: 2px; border: 1px solid rgba(0,0,0,.2); }

/*
 * 画像だけの行に幅ゼロの文字を足して、行の高さを本番（標準モード）と同じにする。
 * テーマの DOCTYPE（XHTML 1.0 Transitional）はブラウザを限定互換モードにし、画像だけの行で文字ぶんの余白（約4px）を
 * 取らない。DOCTYPE を変えると PC の描画が変わるので、スマホ幅の CSS で打ち消す。
 * 本文（.post-page-content）は対象外：sp-nav.js が本文の画像をブロック表示にするため、文字を足すと逆に行が増える。
 * メニュー（.wptouch-menu）も対象外：項目はアイコン画像の後に float の文字リンクが続き、文字を足すと行が増える。
 */
:is(p, div, li, dd, a.header-center):has(> img, > a > img):not(.post-page-content, .post-page-content *, .wptouch-menu *)::after { content: "\200B"; }

/*
 * お問い合わせ・エントリー（CF7）。本番の trust-form は「案内文 <p>（白地）＋ <form>（WPtouch の .post form で灰色・余白10px）」の並び。
 * CF7 は案内文ごと <form> の中に入るので、灰色を #trust-form に移し、案内文だけ白地で枠の外に見せて同じ見え方にする。
 */
.post .wpcf7 form.wpcf7-form { background: none; padding: 0; margin: 0; }
.post #trust-form { background-color: rgba(0,0,0,.1); padding: 0 10px 10px; margin: 0 0 10px; width: auto; }
.post #trust-form > #message-container-input { background-color: #fff; margin: 16px -10px 10px; padding: 0 20px 16px; }
/* 入力欄の寸法は本番スマホの trust-form の実測値。PC 用に合わせた cf7-trustform-match の幅（472px 等）はスマホでは本番と合わない */
div#trust-form.contact-form :is(input[type="text"], input[type="email"], input[type="tel"]) { box-sizing: border-box; width: 574px; height: 24px; padding: 1px 2px; }
div#trust-form.contact-form textarea { box-sizing: border-box; width: 360px; height: 156px; padding: 2px; font-size: 13.3333px; }
div#trust-form.contact-form select { font-size: 13.3333px; }
#trust-form .require:has(> img)::after { content: "\200B"; }
