/*
 * VancityRoom 物件詳細ページ専用デザイン
 * 詳細ページの構造は item.php で直接出力し、JSによるDOM移動は行わない。
 */


/* 詳細ページのパンくずはSEO用の全文を保持し、見た目だけ1行に省略する。 */
.sf-crumbs.vcr-detail-breadcrumbs {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 7px;
	min-width: 0;
	width: 100%;
	overflow: hidden;
	white-space: nowrap;
}

.vcr-detail-breadcrumbs > a,
.vcr-detail-breadcrumbs__separator {
	flex: none;
}

.vcr-detail-breadcrumbs__current {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* タイトルを左右の2列より上に置き、パンくずとの間に薄い線を入れる。 */
.sf-detail__grid.vcr-detail-grid {
	grid-template-areas: "heading heading" "media aside" "body aside";
	row-gap: 12px;
}

.vcr-detail-page-heading {
	grid-area: heading;
	min-width: 0;
	border-top: 1px solid var(--color-divider);
	padding-top: 12px;
}

.vcr-detail-page-heading .sf-detail__title {
	font-size: clamp(24px, 2.5vw, 30px);
	line-height: 1.35;
	margin: 0;
	overflow-wrap: anywhere;
	text-wrap: pretty;
}

.vcr-detail-page-heading .vcr-detail-status-date {
	display: block;
	margin: 0 0 6px;
}

@media (max-width: 920px) {
	.sf-detail__grid.vcr-detail-grid {
		grid-template-areas: "heading" "media" "aside" "body";
	}
}

@media (max-width: 680px) {
	.vcr-detail-page-heading .sf-detail__title {
		font-size: 23px;
	}
}

/* ライトボックスの表示画像をブラウザ標準のドラッグ・選択対象にしない。 */
.sf-lightbox {
	-webkit-user-select: none;
	user-select: none;
}

.sf-lightbox .sf-lightbox__img {
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
}

/*
 * 詳細写真は枠の高さ（4:3）を固定し、写真そのものは上揃え・左右中央へ最大限拡大。
 * 横長は幅、縦長は高さが上限になる。画像自体に細い枠線を表示する。
 * 画像の比率が変わってもサムネイル位置は動かさない。
 * _previewファイル内部の白い余白はCSSでは除去できないため、PHPでOriginalを選ぶ。
 */
.sf-detail__media .sf-gallery__stage {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	width: 100%;
	aspect-ratio: 4 / 3;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	overflow: hidden;
}

.sf-detail__media .sf-gallery__stage > img[data-gallery-stage] {
	position: static;
	inset: auto;
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	box-sizing: border-box;
	border: 1px solid var(--color-divider);
	border-radius: 4px;
}

/* サムネイル間のスペースは親テーマの8pxから4pxへ縮小する。 */
.sf-detail__media .sf-gallery__thumbs {
	gap: 4px;
}

/* サムネイルは正方形のcoverで表示し、メイン写真と同じ細枠と角丸を付ける。 */
.sf-detail__media .sf-gallery__thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	box-sizing: border-box;
	padding: 0;
	border: 1px solid var(--color-divider);
	border-radius: 4px;
	box-shadow: none;
	background: transparent;
	overflow: hidden;
}

.sf-detail__media .sf-gallery__thumb[aria-pressed="true"] {
	border-color: var(--color-divider);
	box-shadow: none;
}

.sf-detail__media .sf-gallery__thumb img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	border-radius: 0;
}

.sf-detail__media .sf-gallery__thumb:not([aria-pressed="true"]) img {
	opacity: .82;
}

.sf-detail__media .sf-gallery__thumb:hover img,
.sf-detail__media .sf-gallery__thumb:focus-visible img {
	opacity: 1;
}

/* 親テーマのぼかし背景が生成された場合も表示しない。 */
.sf-detail__media .sf-gallery__stage > img.sf-gallery__backdrop {
	display: none;
}

/* 物件形態・部屋タイプを右カラム先頭に配置し、入居可能日は家賃の直下に表示する。 */
.sf-detail__meta.vcr-detail-meta-summary {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 7px;
	margin-bottom: 10px;
}

.vcr-detail-summary-row {
	align-items: flex-start;
	display: flex;
	gap: 10px;
	justify-content: space-between;
	min-width: 0;
	width: 100%;
}

.vcr-detail-status-date {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--color-muted);
}

.vcr-detail-category-summary {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 7px;
	min-width: 0;
}

.vcr-detail-category-summary__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	padding: 3px 5px;
	border: 1px solid color-mix(in srgb, #c53c1e 38%, var(--color-divider));
	border-radius: var(--radius-md);
	background: color-mix(in srgb, #c53c1e 10%, var(--color-surface));
	color: #8f2d17;
	font-size: 15px;
	font-weight: 750;
	line-height: 1.25;
	text-decoration: none;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.vcr-detail-category-summary__item:hover,
.vcr-detail-category-summary__item:focus-visible {
	background: color-mix(in srgb, #c53c1e 16%, var(--color-surface));
	border-color: color-mix(in srgb, #c53c1e 55%, var(--color-divider));
	color: #7a2411;
	text-decoration: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, #c53c1e 12%, transparent);
}

.vcr-detail-category-summary__separator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	color: #c53c1e;
}

.vcr-detail-category-summary__separator svg {
	display: block;
	width: 16px;
	height: 16px;
}

/* 入居可能日：家賃の直下へ独立配置し、日付だけ少し大きくする。 */
.vcr-detail-available-date {
	align-items: center;
	display: inline-flex;
	gap: 8px;
	margin: 0 0 12px;
	max-width: 100%;
	padding: 7px 10px;
	border: 1px solid color-mix(in srgb, var(--color-accent) 34%, var(--color-divider));
	border-radius: 10px;
	background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
	color: var(--color-accent);
	line-height: 1.3;
	text-align: left;
	white-space: nowrap;
}

.vcr-detail-available-date__label {
	font-size: 11px;
	font-weight: 650;
}

.vcr-detail-available-date__value {
	font-size: 17px;
	font-weight: 750;
}

.sf-detail__price .vcr-detail-price-period {
	margin-left: 5px;
	font-size: .48em;
	font-weight: 650;
	color: var(--color-muted);
	vertical-align: .12em;
}

/* スマホでは地図上の指操作をページの縦スクロールへ渡す。 */
.vcr-item-map-canvas--touch-scroll {
	touch-action: pan-y !important;
}

/* 掲載番号・閲覧数は画像の直下にまとめる。 */
.vcr-detail-media-ref {
	margin: 10px 0 0;
	font-size: 12px;
	color: var(--color-muted);
}

/* 詳細の各グループを投稿フォームと同じように明確なカードへ分ける。 */
.vcr-detail-specs .vcr-detail-group {
	margin: 0 0 18px;
	padding: 18px;
	border: 1px solid var(--color-divider);
	border-radius: var(--radius-lg);
	background: color-mix(in srgb, var(--color-surface) 96%, #808080 4%);
	overflow: hidden;
}

.vcr-detail-specs .vcr-detail-group:last-of-type {
	margin-bottom: 0;
}

.vcr-detail-group__title {
	margin: 0 0 12px;
	padding: 0 0 10px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.35;
	border-bottom: 2px solid var(--color-divider);
}

/* 賃貸条件・住居情報などの通常項目を2列に並べる。 */
.vcr-detail-data-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 24px;
}

.vcr-detail-data-item {
	display: grid;
	grid-template-columns: minmax(118px, .8fr) minmax(0, 1.2fr);
	gap: 12px;
	align-items: start;
	min-width: 0;
	padding: 10px 0;
	border-bottom: 1px solid color-mix(in srgb, var(--color-divider) 72%, transparent);
}

.vcr-detail-data-item__label {
	font-size: 13px;
	font-weight: 650;
	color: var(--color-muted);
}

.vcr-detail-data-item__value {
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

/* 生活設備・建物設備・室内設備・ルールをSVGカードで横並びにする。 */
.vcr-detail-feature-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(145px, 165px));
	justify-content: start;
	gap: 10px;
}

.vcr-detail-feature {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-width: 0;
	min-height: 62px;
	padding: 10px 12px;
	border: 1px solid color-mix(in srgb, var(--color-divider) 82%, transparent);
	border-radius: var(--radius-md);
	background: var(--color-surface);
}

.vcr-detail-feature__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--color-accent) 10%, var(--color-surface));
	color: var(--color-accent);
}

.vcr-detail-feature__icon svg {
	width: 21px;
	height: 21px;
}

.vcr-detail-feature__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.vcr-detail-feature__label {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.vcr-detail-feature__value {
	font-size: 12px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--color-muted);
	overflow-wrap: anywhere;
}

/* 支払い・送迎はアイコンなしの同じ幅の枠だけで表示する。 */
.vcr-detail-feature-grid--plain .vcr-detail-feature {
	min-height: 44px;
	padding: 10px 14px;
}

.vcr-detail-feature-grid--plain .vcr-detail-feature__body {
	justify-content: center;
}

.vcr-detail-feature-note {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: var(--radius-md);
	background: color-mix(in srgb, var(--color-surface) 88%, #808080 12%);
	font-size: 13px;
	line-height: 1.55;
}

.vcr-detail-feature-note > strong {
	display: block;
	margin-bottom: 3px;
	font-size: 12px;
	color: var(--color-muted);
}

.vcr-detail-feature-note__value {
	font-weight: 500;
}

/* 交通・周辺情報の本文は他の詳細カードと同じ構造で表示する。 */
.vcr-detail-group__text {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.7;
	color: var(--color-text);
}

.vcr-detail-specs .sf-detail__ref {
	margin-top: 14px;
}


/* コメント領域全体を淡色カードで包み、他セクションとの境目を明確にする。 */
.vcr-comments-wrap {
	margin-top: 22px;
	padding: 18px;
	border: 1px solid color-mix(in srgb, #c53c1e 14%, var(--color-divider));
	border-radius: var(--radius-lg);
	background: color-mix(in srgb, #c53c1e 3.5%, var(--color-surface));
}

.vcr-comments-wrap > *:first-child {
	margin-top: 0;
}

.vcr-comments-wrap h2,
.vcr-comments-wrap h3,
.vcr-comments-wrap .sf-comments__title,
.vcr-comments-wrap .sf-comments__count {
	margin-top: 0;
}

.vcr-comments-wrap .sf-comment,
.vcr-comments-wrap .sf-comments__item,
.vcr-comments-wrap .comment,
.vcr-comments-wrap .comment-item {
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, #c53c1e 10%, var(--color-divider));
	border-radius: var(--radius-md);
	background: var(--color-surface);
}

.vcr-comments-wrap form,
.vcr-comments-wrap .sf-comments__form,
.vcr-comments-wrap .comment-form {
	padding-top: 6px;
}

@media (max-width: 680px) {
	/* 投稿ページと同じ左右10pxの余白にする。 */
	.sf-main > .sf-container.sf-main__pad {
		padding-inline: 10px !important;
	}

	.vcr-detail-specs .vcr-detail-group,
	.vcr-comments-wrap {
		padding: 14px;
	}

	/* 賃貸条件・住居情報はスマホでも2列を維持する。 */
	.vcr-detail-data-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0 10px;
	}

	/* 各項目内は狭い画面でラベルと値を上下にして2列全体は維持する。 */
	.vcr-detail-data-item {
		grid-template-columns: 1fr;
		gap: 4px;
	}

	/* 設備・ルール・支払いもスマホで2列表示を維持する。 */
	.vcr-detail-feature-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.vcr-detail-feature {
		min-height: 58px;
		padding: 9px 10px;
		gap: 8px;
	}

	.vcr-detail-feature__icon {
		flex-basis: 32px;
		width: 32px;
		height: 32px;
	}

	.vcr-detail-feature__icon svg {
		width: 19px;
		height: 19px;
	}

	.vcr-detail-feature__label {
		font-size: 12.5px;
	}

	.vcr-detail-feature__value {
		font-size: 11.5px;
	}
}

/* コメント投稿フォームは投稿済みコメントとは別の淡いグレー枠で区切る。 */
.vcr-comments-wrap .vcr-comment-form-panel,
.vcr-comments-wrap #sf-comment-form {
	margin-top: 26px;
	padding: 18px;
	border: 1px solid color-mix(in srgb, #808080 22%, var(--color-divider));
	border-radius: var(--radius-lg);
	background: color-mix(in srgb, #808080 6%, var(--color-surface));
	box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 45%, transparent);
}

.vcr-comments-wrap .vcr-comment-form-panel .sf-comments__formhead,
.vcr-comments-wrap #sf-comment-form .sf-comments__formhead {
	margin: 0 0 16px;
	padding: 0 0 10px;
	border-bottom: 1px solid color-mix(in srgb, #808080 22%, var(--color-divider));
}

.vcr-comments-wrap .vcr-comment-form-panel .sf-form__actions,
.vcr-comments-wrap #sf-comment-form .sf-form__actions {
	margin-top: 16px;
}

@media (max-width: 680px) {
	.vcr-comments-wrap .vcr-comment-form-panel,
	.vcr-comments-wrap #sf-comment-form {
		padding: 14px;
	}
}


/* 1.5.64
 * 詳細ページの性別条件を右カラムでも見やすく表示する。
 */
.vcr-detail-gender-summary {
	align-items: center;
	background: #f6f8f9;
	border: 1px solid #d9e1e3;
	border-radius: 12px;
	display: flex;
	gap: 10px;
	margin: 12px 0 18px;
	padding: 10px 12px;
}

.vcr-detail-gender-summary__icon {
	align-items: center;
	border-radius: 999px;
	display: inline-flex;
	flex: 0 0 auto;
	height: 30px;
	justify-content: center;
	width: 30px;
}

.vcr-detail-gender-summary__icon svg {
	display: block;
	height: 18px;
	width: 18px;
}

.vcr-detail-gender-summary__label {
	color: #6d7b80;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.vcr-detail-gender-summary__value {
	color: #263638;
	font-size: 14px;
	font-weight: 800;
	margin-left: auto;
}

.vcr-detail-gender-summary--male .vcr-detail-gender-summary__icon {
	background: #eaf3ff;
	color: #2d5ea6;
}

.vcr-detail-gender-summary--female .vcr-detail-gender-summary__icon {
	background: #fcebf2;
	color: #b04e79;
}

.vcr-detail-gender-summary--any .vcr-detail-gender-summary__icon,
.vcr-detail-gender-summary--other .vcr-detail-gender-summary__icon {
	background: #eef2f4;
	color: #536367;
}

@media (max-width: 640px) {
	.vcr-detail-gender-summary {
		align-items: flex-start;
		flex-wrap: wrap;
		gap: 8px 10px;
	}

	.vcr-detail-gender-summary__value {
		margin-left: 0;
		width: 100%;
	}
}


/* 1.5.65
 * 詳細ページでも男女条件のSVGをはっきり見せる。
 */
.vcr-detail-gender-summary__icon {
	gap: 1px;
	width: auto;
	min-width: 30px;
	padding: 0 6px;
}

.vcr-detail-gender-summary__icon .vcr-gender-svg {
	display: block;
	height: 18px;
	width: 18px;
}

.vcr-detail-gender-summary--any .vcr-gender-svg--male {
	color: #3a6da8;
}

.vcr-detail-gender-summary--any .vcr-gender-svg--female {
	color: #b4577b;
}


/* 1.5.66
 * 性別条件のラベル・アイコン・値を同じ行で明確にする。
 */
.vcr-detail-gender-summary {
	justify-content: flex-start;
}

.vcr-detail-gender-summary__label {
	color: #6d7b80;
	font-weight: 700;
}

.vcr-detail-gender-summary__value {
	margin-left: 0;
}


/* 1.5.67
 * 性別条件は未設定でも「指定なし」として詳細ページに必ず表示する。
 */
.vcr-detail-gender-summary {
	display: flex !important;
	visibility: visible !important;
}


/* 1.5.69
 * 詳細ページ: 性別条件は賃貸条件の元の行にアイコン付きで表示する。
 * 右カラムの重複ブロックは非表示にする。
 */
.vcr-detail-gender-summary {
	display: none !important;
}

.vcr-detail-gender-inline {
	align-items: center;
	display: inline-flex;
	gap: 8px;
}

.vcr-detail-gender-inline__icon {
	align-items: center;
	display: inline-flex;
	gap: 1px;
	justify-content: center;
	min-width: 20px;
}

.vcr-detail-gender-inline__icon .vcr-gender-svg {
	height: 16px;
	width: 16px;
}

.vcr-detail-gender-inline__text {
	color: #263638;
	font-weight: 700;
}

.vcr-detail-gender-inline--male .vcr-gender-svg--male,
.vcr-detail-gender-inline--any .vcr-gender-svg--male {
	color: #3a6da8;
}

.vcr-detail-gender-inline--female .vcr-gender-svg--female,
.vcr-detail-gender-inline--any .vcr-gender-svg--female {
	color: #b4577b;
}


/* 1.6.64
 * コメントフォームのタイトルとコメント欄は横幅いっぱいにし、投稿ボタンは中央配置にする。
 */
.vcr-comments-wrap #sf-comment-form .sf-field {
	width: 100%;
	max-width: none;
}

.vcr-comments-wrap #sf-comment-form .sf-input,
.vcr-comments-wrap #sf-comment-form textarea.sf-input,
.vcr-comments-wrap #sf-comment-form input.sf-input {
	display: block;
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}

.vcr-comments-wrap #sf-comment-form .sf-form__actions {
	display: flex;
	justify-content: center;
}

/* 電話番号を開いた際はボタン文言を「閉じる」に切り替える。
 * ネイティブdetails/summaryを維持するためJavaScriptは不要。 */
.sf-phone > summary .vcr-phone-label--opened,
.sf-phone[open] > summary .vcr-phone-label--closed {
	display: none;
}
.sf-phone[open] > summary .vcr-phone-label--opened {
	display: inline;
}

/*
 * 詳細ページの説明文だけ、リスト・段落・見出しの上下余白をコンパクトに統一。
 * ギャラリーや管理メニュー、コメント欄などには影響させない。
 * li内のpも後続の専用ルールで余計な上下余白を抑える。
 */
.sf-detail__body .sf-prose p {
	margin: 16px 0;
}

.sf-detail__body .sf-prose :is(blockquote, pre) {
	margin: 8px 0;
}

.sf-detail__body .sf-prose :is(h2, h3, h4, h5, h6) {
	margin: 12px 0 8px;
}
.sf-detail__body .sf-prose :is(ul, ol) {
	margin: 16px 0;
	padding-left: 2em;
	line-height: 1;
}

.sf-detail__body .sf-prose :is(ul, ol) > li {
	margin: 10px 0;
	padding: 0;
	line-height: inherit;
}

.sf-detail__body .sf-prose :is(ul, ol) > li > :is(p, div) {
	margin: 0;
}

.sf-detail__body .sf-prose :is(ul, ol) > li > p + p {
	margin-top: 4px;
}

.sf-detail__body .sf-prose :is(ul, ol) :is(ul, ol) {
	margin: 4px 0;
}

.sf-detail__body .sf-prose :is(h2, h3, h4):has(+ :is(ul, ol)) {
	margin-bottom: 0;
}

/*
 * B案のH2装飾は「説明・場所・詳細」の主要3セクションだけに適用。
 * 交通・周辺情報・支払い・送迎など既存のカード見出しを変更しない。
 */
.sf-detail__body > .vcr-detail-primary-section {
	/* Keep heading and content margins inside each section. */
	display: flow-root;
}

.sf-detail__body > .vcr-detail-primary-section + .vcr-detail-primary-section {
	margin-top: 16px;
}

.sf-detail__body > .vcr-detail-primary-section > h2 {
	margin: 20px 0;
}

/* The final paragraph/list must not add extra space after a section's content. */
.sf-detail__body > .vcr-detail-primary-section .sf-prose > :last-child {
	margin-bottom: 0;
}

.sf-detail__body > .vcr-detail-primary-section > h2::after {
	content: "";
	display: block;
	width: 100%;
	height: 3px;
	margin-top: 12px;
	background: linear-gradient(
		to right,
		var(--color-accent-700) 0 52px,
		var(--color-divider) 52px 100%
	);
}
