/* 物件カード(.room)共通スタイル: 物件一覧/マンション一覧/マンション詳細で共用 */


/* 物件カード li.room の padding を 上下20px・左右30px に(ボタン右上配置の基準にposition:relative) */
.room { padding: 20px 40px; position: relative; }

/* お気に入り・資料請求ボタンをタイトル行の右に配置する。
   ボタンはHTML上<a>の外(.links)にあり、<a>の中へ移動すると<a>内に<a>/<label>が
   ネストして無効なHTML・クリック不能になるためHTMLは動かさない。
   代わりに <a>/.no_anchor と .links を display:contents で透過し、中身(タイトル行・
   バンド・画像・スペック・タグ・ボタン)を li.room 直下のCSS Gridの行として並べる。
   ボタンは「タイトル+評価」のセル(head)にalign-self/justify-self:endで右下寄せし、
   結果としてタイトル行の右に来る。position:absoluteは使わず、画像枚数が違っても
   各行が自分の内容ぶんの高さで自動的に並ぶ(固定オフセットではないため崩れない)。 */
.room {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"head btns"
		"band band"
		"pics pics"
		"spec spec"
		"tags tags";
	column-gap: 1em;
}
.room_list li.room > a,
.room_list li.room > .no_anchor { display: contents; }
.room .links { display: contents; }
.room .bldg_data.main { grid-area: head; }
.room .bldg_band { grid-area: band; }
.room .bldg_pic { grid-area: pics; }
.room .bldg_data.sub { grid-area: spec; }
.room .links > .bl_flex:first-child { grid-area: tags; }
.room .links > .bl_flex:last-child {
	grid-area: btns;
	align-self: end;
	justify-self: end;
}

/* 物件詳細ボタン(白のdetail)を非表示にする。資料請求(request)・お気に入り(favorite)・会員登録(緑detail)は残す */
.room .links a.btn.white.detail { display: none; }

/* 公開日・タグリスト(linksの先頭ブロック)を小さく */
.room .links .bl_flex:first-child { font-size: 0.8em; }

/* 評価・価格・利回りをタイトルの下の行に配置(タイトルを1行目に全幅、評価/価格/利回りを次の行へ) */
.room .bldg_data.main { grid-template-columns: auto auto auto; }
.room .bldg_data.main .bldg_name { grid-column: 1 / -1; }

/* 長い物件名(特に全角英字。例: ＥＸＣＬＵＳＩＶＥ　ＭＵＳＡＳＨＩＫＯＹＡＭＡ)で
   カードが横に伸び、ページ全体に横スクロールが出るのを防ぐ。
   grid/flex アイテムの min-width 初期値は auto(=最小内容幅まで縮まない)のため、
   .bldg_data.main と .bldg_name の両方に min-width:0 を入れて縮小を許可し、
   さらに単語区切りが無い文字列でも折り返せるよう overflow-wrap:anywhere を付ける。 */
.room .bldg_data.main { min-width: 0; }
.room .bldg_data.main .bldg_name { min-width: 0; overflow-wrap: anywhere; }
/* 共有CSS(.bldg_data.main .bldg_name strong)の white-space:nowrap + text-overflow:ellipsis で
   長い物件名が1行に省略されるため、リデザイン対象カードでは解除して複数行で全文を出す。 */
.room .bldg_data.main .bldg_name strong {
	white-space: normal;
	overflow: visible;
	text-overflow: clip;
}

/* テキストリンクになっている見出し=公開カードの物件名(カード全体が<a>リンク)の右に、
   くの字(chevron)アイコンを置く。会員カード(.no_anchorで非リンク)には付けない。 */
.room_list li.room > a .bldg_name strong::after {
	content: "";
	display: inline-block;
	width: 0.36em;
	height: 0.36em;
	margin-left: 0.5em;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translate(0, -0.12em) rotate(45deg);
	vertical-align: middle;
	transition: transform 0.2s;
}
/* マウスオンでくの字を右へ動かす(translateはrotateより先=画面座標で右移動) */
.room_list li.room > a:hover .bldg_name strong::after {
	transform: translate(0.6em, -0.12em) rotate(45deg);
}

/* 評価: 小見出し「評価」ラベルを非表示にし、数値(2.34)と星を左端(タイトル左)に揃える。
   共有 .evaluation の justify-content:space-evenly が数値を右へ押していた原因。 */
.room .bldg_star .evaluation { justify-content: flex-start; align-items: center; gap: 0.4em; font-size: 0.78em; }
.room .bldg_star .evaluation .small.pc { display: none; }
/* 評価の数値(2.34)を少し小さく */
.room .bldg_star .mikata_point { font-size: 0.75em; color: #a5843d; }
/* 評価の星の金色を、利回りの文字色と同じ茶色(#a5843c)にする */
.room .bldg_star .star.gold { color: #a5843c; }
/* 空(グレー)の星を少し明るく(#ccc→#e0e0e0)。goldの方が特異度が高いので上書きされない */
.room .bldg_star .star { color: #e0e0e0; }
/* 見出しと評価の位置を入れ替える(評価を上・タイトルを下)。縦間隔は詰める */
.room .bldg_data.main { row-gap: 0; }
.room .bldg_data.main .bldg_star { grid-row: 1; margin-top: 0; }
.room .bldg_data.main .bldg_name { grid-row: 2; margin-top: -0.5em; margin-bottom: 0; }

/* 価格・利回り・最寄り駅を1つのベージュ帯(#f6f1e6)にまとめて大きく表示。
   ビルド側で3項目を .bldg_band に再構成済み。ラベル小(グレー)+値大、縦罫線で区切る。 */
.room .bldg_band {
	display: flex;
	align-items: stretch;
	background: #fbf7ef;
	border-radius: 8px;
	padding: 16px 22px 12px;
	margin: 10px 0 6px;
}
.room .bldg_band .band_cell {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	position: relative;
	padding: 0 22px;
}
.room .bldg_band .band_cell:first-child { padding-left: 0; }
.room .bldg_band .band_cell:last-child { padding-right: 0; }
/* 縦罫線: 上端は元の位置のまま、下端だけ7px短くする(border-rightの代わりに擬似要素で高さ指定) */
.room .bldg_band .band_cell:not(:last-child)::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 7px;
	right: 0;
	width: 1px;
	background: #e0d9c5;
}
.room .bldg_band .band_station { flex: 1; }
.room .bldg_band .band_lbl {
	font-size: 12px;
	color: #9c9484;
	margin-bottom: 2px;
	line-height: 1;
}
.room .bldg_band .band_val {
	font-size: 15px;
	font-weight: 500;
	color: #2b2b2b;
	line-height: 1.15;
	margin-top: auto;
	margin-bottom: auto;
}
.room .bldg_band .band_val strong { font-size: 25px; font-weight: 500; }
.room .bldg_band .band_yield .band_val { color: #a5843c; }
/* 最寄り駅の値はセル下端に揃え(価格/利回りの大きな数値の下端に合わせる)、文字も少し大きく */
.room .bldg_band .band_station .band_val { margin-top: auto; font-size: 18px; }
/* 最寄り駅のアイコン・テキストが上寄りに見えるため、少し下へずらす */
.room .bldg_band .band_station .band_val { position: relative; top: 2px; }

/* SP: 価格・利回りを1行(横並び)、最寄り駅は次行に全幅(PC無影響) */
@media screen and (max-width:768px) {
	.room .bldg_band { flex-direction: row; flex-wrap: wrap; padding: 14px 16px; align-items: stretch; }
	/* 価格・利回り: 横並び。ラベル上・値下(縦積み)のまま */
	.room .bldg_band .band_price,
	.room .bldg_band .band_yield { flex: 0 0 calc(50% - 5px); width: calc(50% - 5px); padding: 0 16px 0 12px; border-right: none; }
	.room .bldg_band .band_price { padding-left: 0; border-right: none; }
	.room .bldg_band .band_price::after,
	.room .bldg_band .band_yield::after { display: none; }
	.room .bldg_band .band_price .band_val,
	.room .bldg_band .band_yield .band_val { margin: 0; white-space: nowrap; }
	/* 最寄り駅: 次行に全幅、ラベル+値を横並び、上に区切り線 */
	.room .bldg_band .band_station {
		flex: 1 1 100%;
		flex-direction: row;
		align-items: baseline;
		border-right: none;
		margin-top: 12px;
		padding-top: 12px;
		border-top: 1px solid #e0d9c5;
	}
	.room .bldg_band .band_station { justify-content: flex-start; padding-left: 0; }
	.room .bldg_band .band_station .band_lbl { margin-bottom: 0; margin-right: 1em; position: relative; top: 1px; }
	.room .bldg_band .band_station .band_val { margin: 0; }
	/* 最寄り駅テキストがアイコンに対して下にズレて見えるため縦中央に揃える */
	.room .bldg_band .band_station .band_val .ico_line { vertical-align: middle; position: relative; top: -2.125px; }
}

/* サムネイル画像列の上下の空きを広げ、上下を見た目でも均等にする。
   画像はdisplay:blockでインライン余白を除去。さらにli の margin-bottom:7px が最終行下に残り
   下側が広く見えるため、li下マージンを0にし、行間(SP折返し)はrow-gapで確保する。 */
.room .bldg_pic { margin-top: 16px; row-gap: 7px; }
.room .bldg_pic li { margin-bottom: 0; max-width: 6em; height: 6em; }
.room .bldg_pic img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* スペック上の余白は会員カード/公開カードで分けず、全カード共通のルールにする。
   帯→画像(公開)は帯mb6+画像mt16=22px、帯→スペック(会員)は帯mb6+スペックmt16=22pxで揃う。 */
.room .bldg_data.sub { margin-top: 16px; }

/* スペック(所在地/築年月/建物構造/専有面積/間取り)を小見出し(dt)なし・1行・スラッシュ区切りに */
.room .bldg_data.sub { display: block; }
.room .bldg_data.sub dt { display: none; }
.room .bldg_data.sub dd { display: inline; margin: 0; padding: 0; }
.room .bldg_data.sub dd:not(:last-child)::after { content: "/"; margin: 0 0.45em; color: #c9c9c9; }
/* 「ログイン後に住所表示」(非公開住所の代替文言)の文字色を薄く */
.room .bldg_data.sub .addr_login { color: #999; }

/* NEWバッジをタイトルの上に配置(ビルドで注入した .new_badge)。赤背景・白文字・角丸2px。
   カード全体のpaddingは変えず、タイトル上に1行分だけ差し込む。 */
.room .bldg_star .new_badge {
	display: inline-block;
	align-self: center;
	position: relative;
	top: -0.5px;
	background: #e60012;
	color: #fff;
	font-size: 0.6em;
	font-weight: 400;
	line-height: 1;
	padding: 0.21em 0.45em 0.16em;
	border-radius: 2px;
}
/* 下部(公開日横)の共有NEW疑似要素は非表示にする(上に移設したため) */
.room .links .date.new::after { display: none; }

/* 公開日エリアのグレー背景(共有 #fafafa)を除去。左paddingも0にして左端を他と揃える。
   外側.links(pb7.7px)と内側.bl_flexの下paddingを0にし、公開日の下の空きすぎを解消(カード下padding20pxのみに)。 */
.room .links { background: none; padding-left: 0; padding-right: 0; padding-bottom: 0; }
.room .links > .bl_flex { padding-bottom: 0; }

/* 公開日の文字色を黒から少しだけ薄く */
.room .links .date { color: #666; }

/* li直下のメインリンク(公開カードは<a>、会員カードは<div class="no_anchor">)の余分なpaddingを0に。
   会員カードだけ左paddingが大きく見えていた原因は .no_anchor に効いていなかったため。 */
.room_list li.room > a,
.room_list li.room > .no_anchor { padding: 0; }

/* お気に入り・資料請求(白ボタン)のドロップシャドウを無しにする。
   下paddingが開きすぎて文字が上寄りに見えるため下paddingを詰めて文字を下げる。
   会員登録(緑ボタン)も同じ白ベース(背景白・文字#007a8e・枠は共通)に揃える。 */
.room .links .btn.white,
.room .links .btn.green {
	box-shadow: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.1em;
}
/* アイコン字形は箱の上寄りに描画されるため、アイコンだけ下へ2px寄せて文字と字形を揃える
   (テキストは対称paddingで中央のまま) */
.room .links .btn.white i,
.room .links .btn.green i { position: relative; top: 1px; }
/* 会員登録(person_edit)アイコンは字形が他と違い下寄りに見えるので、もう少し上に */
.room .links .btn.green i { top: -1px; }

/* 資料請求・会員登録ボタンの右margin(共有7.7px)を除去し、右端をバンド右端に揃える */
.room .links .btn.white.request,
.room .links .btn.green { margin-right: 0; }

/* お気に入りボタンのマウスオン時、ハートを星と同じゴールド(#a5843c)にする。
   共有hoverの青緑塗り(ゴールドが埋もれる)を打ち消し、白背景のままハートだけゴールドに。 */
.room .links .btn.white.favorite i { font-size: 21px; }
.room .links .btn.white.favorite:hover { background: #fff; color: #007a8e; box-shadow: none; }
/* マウスオン時はハートを塗りつぶし(FILL 1)＋色#a5843cにする */
.room .links .btn.white.favorite:hover i { color: #a5843c; font-variation-settings: 'FILL' 1; }
.room .links .btn.green { background: #fff; color: #007a8e; transition: background-color 0.15s, color 0.15s; }
/* 会員登録ボタンもマウスオンで反転(背景ティール・文字白) */
.room .links .btn.green:hover { background: #007a8e; color: #fff; }
/* お気に入り・資料請求(・会員登録)のボタン文字を少し小さく */
.room .links .btn.white span,
.room .links .btn.green span { font-size: 0.9em; }
/* お気に入り・資料請求(白ボタン)の文字だけ上寄りに見えるので1px下げる */
.room .links .btn.white span { position: relative; top: 1px; }

/* タグリストを楕円(pill)で囲う */
.room .links a.link {
	display: inline-block;
	text-decoration: none;
	color: #666;
	font-size: 0.82em;
	border: 1px solid #cfd8dc;
	border-radius: 999px;
	padding: 0.1em 0.7em;
	margin-left: 0.4em;
	margin-right: 0;
	line-height: 1.8;
	transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
/* タグpillはマウスオンで文字色と背景色を反転(背景=文字色のティール, 文字=白)、グレー罫線は消す */
.room .links a.link:hover {
	background: #007a8e;
	color: #fff;
	border-color: transparent;
}

/* タグリストを右揃え(公開日は左のまま。公開日にmargin-right:autoでタグを右へ寄せる) */
.room .links > .bl_flex:first-child { flex: 1; flex-wrap: wrap; align-items: center; }
.room .links > .bl_flex:first-child .date { margin-right: auto; margin-left: 0; }

/* マウスオーバーでカードが浮き上がる挙動(translateY -7px + box-shadow)を無効化(共有.room_list li.room:hoverに勝つ特異度) */
.room_list li.room:hover { transform: none; box-shadow: none; }
/* ===== SP(768px以下)限定の調整。PC(769px以上)・他ページには影響しない ===== */
@media screen and (max-width: 768px) {
	/* カード内「評価」ラベル(SP用dt)を非表示 */
	.room .bldg_data.main dt.sp { display: none; }
	/* 会員登録ボタンのアイコンにPC向けの top:-1px(共通ルール)が効いており、SPでは
	   アイコン+テキストがボタン中心より上にずれる。SP限定でアイコン1px・テキスト1px下へ */
	.room .links .btn.green i { top: 1px; }
	.room .links .btn.green span { position: relative; top: 1px; }
	/* SP限定: お気に入り・資料請求ボタンはテキストを隠しアイコンのみの丸ボタンにする(サイズは相対値) */
	.room .links .btn.white.favorite span,
	.room .links .btn.white.request span { display: none; }
	.room .links .btn.white.favorite,
	.room .links .btn.white.request {
		width: 2.8em;
		height: 2.8em;
		padding: 0;
		border-radius: 50%;
		gap: 0;
	}
	/* カードのドロップシャドウは不要 */
	.room_list li.room { box-shadow: none !important; border-top: none !important; margin-bottom: 0 !important; }
	/* 最寄り駅テキスト(大江戸線 築地市場駅 徒歩3分 等)の文字サイズを下げる */
	.room .bldg_band .band_station .band_val { font-size: 15px; }
	/* カードの左右余白は常に20px。下marginは不要。
	   一覧(.m_search_result)はコンテナ側が既に左右20pxを持つため、そこだけカード側を0に戻す。
	   これで一覧・マンション詳細・関連物件(新着/周辺)のどこでもカードの左右余白が20pxに揃う。 */
	.room { padding: 24px 20px 36px; }
	.m_search_result .room { padding-left: 0; padding-right: 0; }
	/* 物件名の下マージンを少しだけ小さく(タイトルとバンドの間を詰める) */
	.room .bldg_band { margin-top: 2px; }
	/* SPは.bldg_data.mainがdisplay:flexになりDOM順(タイトル→NEW/評価)で並んでしまう。
	   PCはgridでNEW/評価が先に来るため、SPも order で同じ並び(NEW/評価が上・タイトルが下)に揃える。
	   これによりタイトル側の元々のmargin-top:-0.5em(共通ルール)がそのままタイトルを評価に
	   寄せるため、画面幅や会員/公開カードの違いを気にした個別のmargin計算が不要になる。 */
	.room .bldg_data.main .bldg_star { order: -1; margin-top: 0; }
	/* くの字マークをもう少し左に */
	.room_list li.room > a .bldg_name strong::after { margin-left: 0.3em; }
	/* お気に入り・資料請求の丸ボタンを、評価+タイトルのブロック全体に対して縦中央揃えにする
	   (PCはalign-self:endのまま、SPのみcenterに変更) */
	.room .links > .bl_flex:last-child { align-self: center; }
	/* 価格・利回りの小見出しは左下に(数字を先に表示し、見出しをその下へ) */
	/* 価格・利回りの小見出しは数字の左・下揃え(縦積みから横並びへ) */
	.room .bldg_band .band_price,
	.room .bldg_band .band_yield { flex-direction: row; align-items: center; }
	.room .bldg_band .band_price .band_lbl,
	.room .bldg_band .band_yield .band_lbl { margin-bottom: 0; margin-right: 1em; }
	/* タグリストは公開日と同じ行で右揃え(折り返さず1行に収める) */
	.room .links > .bl_flex:first-child { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; }
	.room .links > .bl_flex:first-child .date,
	.room .links > .bl_flex:first-child a.link { flex: 0 0 auto; }
	.room .links .date { width: auto; }
	/* スペック(所在地/築年月/建物構造/専有面積/間取り)の下マージンを広げる */
	.room .bldg_data.sub { margin-bottom: 12px; }
	/* 各カードのサムネイル画像一覧を、折返し(複数行)から横1列のスワイプ(横スクロール)に変更。
	   .bldg_pic は li.room のCSS Gridアイテムであり、grid item の min-width 初期値は auto
	   (=中身の最小幅まで広がる)ため、min-width:0 を入れないと ul が画像の合計幅まで伸びて
	   ページ全体に横スクロールが出る。必ずセットで指定する。 */
	.room .bldg_pic {
		flex-wrap: nowrap;
		min-width: 0;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		row-gap: 0;
		scrollbar-width: none;
		/* 右端で画像が途中で切れて見えるよう、画面右端まで伸ばす(左端は本文と揃えたまま)。
		   右の余白の実体は .m_search_result の padding-right: 20px(固定px)なので、
		   同値の負マージンで打ち消す。祖先に overflow:hidden は無く(実測)クリップされない。
		   padding-right はスクロール末尾で最後の画像が画面端に貼り付かないための余白。 */
	}
	/* 右端まで伸ばす負マージンは「カードの右に20pxの余白がある」前提。
	   一覧では .m_search_result の padding-right:20px、それ以外では .room 自身の
	   padding-right:20px がその実体なので、どちらでも -20px で打ち消せる。
	   .bldg_pic は min-width:0 + overflow-x:auto のため横溢れにはならない。 */
	.room .bldg_pic {
		margin-right: -20px;
		padding-right: 20px;
	}
	/* スクロールバーは非表示(スワイプ操作前提。高さが変わらないよう領域も取らせない) */
	.room .bldg_pic::-webkit-scrollbar { display: none; }
	/* nowrap下でも画像が潰れないよう縮小を止め、幅は既存の 6em を明示する */
	.room .bldg_pic li {
		flex: 0 0 auto;
		width: 6em;
		max-width: none;
		scroll-snap-align: start;
	}
}