/**
 * CBR IDX — Listings & City Search styles
 * 브랜드 변수(cbr-astra-child) 사용 + 미로드 시 폴백값.
 * @since 0.8.0
 */

/* ---- 매물 카드 그리드 (v0.6.0 클래스 호환) ---- */
.cbr-listing-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	margin: 16px 0 32px;
}

.cbr-listing-card {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(27, 42, 74, 0.08);
	transition: transform .18s ease, box-shadow .18s ease;
	display: flex;
	flex-direction: column;
}
.cbr-listing-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(27, 42, 74, 0.14);
}

.cbr-lc-photo {
	position: relative;
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, var(--cbr-primary, #1B2A4A) 0%, #2a3d63 100%);
	overflow: hidden;
}
.cbr-lc-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.cbr-lc-photo.cbr-lc-noimg img { display: none; }
.cbr-lc-noimg-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255,255,255,.85);
	font-size: 1rem;
	letter-spacing: .04em;
}
.cbr-lc-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: var(--cbr-secondary, #C9A227);
	color: #fff;
	font-size: .72rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	letter-spacing: .03em;
}

.cbr-lc-body { padding: 16px 18px 14px; }
.cbr-lc-price {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--cbr-primary, #1B2A4A);
	line-height: 1.2;
}
.cbr-lc-addr {
	margin-top: 6px;
	font-weight: 600;
	color: var(--cbr-text, #1F2937);
}
.cbr-lc-city {
	color: #6B7280;
	font-size: .92rem;
	margin-top: 2px;
}
.cbr-lc-meta {
	margin-top: 8px;
	font-size: .92rem;
	color: var(--cbr-text, #1F2937);
}

/* IDX 크레딧 — CRMLS SOP: 가격 인접, 본문 폰트 크기 이상 (축소 금지) */
.cbr-lc-credit {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #F0F1F4;
	font-size: 1em; /* 본문과 동일 크기 유지 — 임의 축소 금지 */
	color: #6B7280;
	line-height: 1.4;
}

.cbr-listings-heading {
	margin: 24px 0 4px;
	color: var(--cbr-primary, #1B2A4A);
}
.cbr-listings-empty {
	padding: 28px;
	text-align: center;
	background: #F8F9FB;
	border-radius: 10px;
	color: #6B7280;
}

/* ---- 도시 검색 드롭다운 ---- */
.cbr-city-search { position: relative; max-width: 560px; }
.cbr-cs-input {
	width: 100%;
	padding: 14px 18px;
	border: 1px solid #D6D9E0;
	border-radius: 999px;
	font-size: 1rem;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.cbr-cs-input:focus {
	border-color: var(--cbr-secondary, #C9A227);
	box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}
.cbr-cs-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 36px rgba(27, 42, 74, .16);
	max-height: 420px;
	overflow-y: auto;
	z-index: 999;
	padding: 8px 0;
}
.cbr-cs-group-label {
	padding: 10px 18px 6px;
	font-size: .74rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--cbr-secondary, #C9A227);
}
.cbr-cs-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 9px 18px;
	text-decoration: none;
	color: var(--cbr-text, #1F2937);
}
.cbr-cs-item:hover,
.cbr-cs-item.is-focused { background: #F5F7FA; }
.cbr-cs-ko { color: #9CA3AF; font-size: .88em; margin-left: 6px; }
.cbr-cs-count { color: #9CA3AF; font-size: .85em; }
.cbr-cs-empty { padding: 18px; text-align: center; color: #9CA3AF; }

/* ---- 도시 인덱스 (city 미지정) ---- */
.cbr-city-index {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 28px;
	margin: 24px 0;
}
.cbr-county-group h3 {
	color: var(--cbr-primary, #1B2A4A);
	border-bottom: 2px solid var(--cbr-secondary, #C9A227);
	padding-bottom: 8px;
	margin-bottom: 12px;
}
.cbr-county-group ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.cbr-county-group li { margin: 0 0 6px; break-inside: avoid; }
.cbr-county-group a { text-decoration: none; color: var(--cbr-text, #1F2937); }
.cbr-county-group a:hover { color: var(--cbr-secondary, #C9A227); }
.cbr-county-group a span { color: #9CA3AF; font-size: .85em; }

/* ---- 도시 목록 헤더/페이지네이션 ---- */
.cbr-city-header { margin: 20px 0 4px; }
.cbr-city-title { color: var(--cbr-primary, #1B2A4A); margin: 0; }
.cbr-city-count { color: #6B7280; margin: 4px 0 0; }

.cbr-pagination {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin: 28px 0;
	flex-wrap: wrap;
}
.cbr-pagination a {
	min-width: 38px;
	padding: 8px 10px;
	text-align: center;
	border-radius: 8px;
	border: 1px solid #E2E5EB;
	text-decoration: none;
	color: var(--cbr-text, #1F2937);
}
.cbr-pagination a:hover { border-color: var(--cbr-secondary, #C9A227); }
.cbr-pagination a.current {
	background: var(--cbr-primary, #1B2A4A);
	border-color: var(--cbr-primary, #1B2A4A);
	color: #fff;
	pointer-events: none;
}

@media (max-width: 640px) {
	.cbr-listing-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
	.cbr-lc-body { padding: 12px; }
	.cbr-lc-price { font-size: 1.1rem; }
	.cbr-county-group ul { columns: 1; }
}
@media (max-width: 440px) {
	.cbr-listing-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   v1.0 — 히어로 검색창 (Zillow 스타일)
   ============================================================ */
.cbr-cs-hero { max-width: 640px; margin: 0 auto; }
.cbr-cs-field {
	display: flex;
	align-items: center;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
	overflow: hidden;
}
.cbr-cs-hero .cbr-cs-field { border-radius: 12px; }
.cbr-cs-field .cbr-cs-input {
	flex: 1;
	border: none;
	border-radius: 0;
	padding: 18px 22px;
	font-size: 1.05rem;
	background: transparent;
	box-shadow: none;
}
.cbr-cs-field .cbr-cs-input:focus { outline: none; box-shadow: none; }
.cbr-cs-btn {
	border: none;
	background: transparent;
	padding: 0 20px;
	height: 100%;
	min-height: 58px;
	cursor: pointer;
	color: var(--cbr-primary, #1B2A4A);
	display: flex;
	align-items: center;
	transition: color .15s ease;
}
.cbr-cs-btn:hover { color: var(--cbr-secondary, #C9A227); }
.cbr-cs-hero .cbr-cs-dropdown { text-align: left; }

/* 기본(비히어로) 검색창은 기존 라운드 유지 */
.cbr-city-search:not(.cbr-cs-hero) .cbr-cs-field {
	border: 1px solid #D6D9E0;
	border-radius: 999px;
	box-shadow: none;
}
.cbr-city-search:not(.cbr-cs-hero) .cbr-cs-field:focus-within {
	border-color: var(--cbr-secondary, #C9A227);
	box-shadow: 0 0 0 3px rgba(201, 162, 39, .18);
}
.cbr-city-search:not(.cbr-cs-hero) .cbr-cs-input { padding: 13px 20px; }

/* ---- 히어로(검색형) 섹션 ---- */
.cbr-hero-search {
	position: relative;
	min-height: 460px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	color: #fff;
	background: linear-gradient(135deg, var(--cbr-primary, #1B2A4A), #2a3d63);
}
.cbr-hero-search.has-img::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: var(--cbr-hero-img);
	background-size: cover;
	background-position: center;
}
.cbr-hero-search.has-img::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(11,18,32,.45) 0%, rgba(11,18,32,.75) 100%);
	opacity: calc(var(--cbr-ov, 80) / 100);
}
.cbr-hero-search-inner { position: relative; z-index: 2; width: 100%; padding: 60px 20px; }
.cbr-hero-search-title {
	color: #fff;
	font-size: clamp(2rem, 5vw, 3.2rem);
	margin: 0 0 8px;
	text-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.cbr-hero-search-title span { font-weight: 400; opacity: .92; }
.cbr-hero-search-sub {
	color: rgba(255,255,255,.9);
	font-size: 1.05rem;
	margin: 0 0 28px;
	text-shadow: 0 1px 12px rgba(0,0,0,.35);
}
.cbr-hero-quicklinks {
	margin-top: 22px;
	display: flex;
	gap: 22px;
	justify-content: center;
	flex-wrap: wrap;
}
.cbr-hero-quicklinks a {
	color: #fff;
	text-decoration: none;
	font-weight: 600;
	font-size: .95rem;
	padding-bottom: 3px;
	border-bottom: 2px solid transparent;
	transition: border-color .15s ease;
}
.cbr-hero-quicklinks a:hover { border-bottom-color: var(--cbr-secondary, #C9A227); }

/* ---- About v3 (사진 + 프로필) ---- */
.cbr-about-v3 {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 40px;
	align-items: start;
}
.cbr-about-photo img {
	width: 100%;
	border-radius: 14px;
	box-shadow: 0 10px 34px rgba(27,42,74,.16);
	display: block;
}
.cbr-about-name { font-size: 1.9rem; margin: 0 0 12px; color: var(--cbr-primary, #1B2A4A); }
.cbr-about-name span { font-weight: 400; opacity: .8; }
.cbr-about-main .cbr-badges { margin-bottom: 14px; }
.cbr-about-main .cbr-contact-line { margin-bottom: 18px; }
.cbr-about-main .cbr-bio-text { margin-bottom: 14px; line-height: 1.8; }
.cbr-about-main .cbr-hero-actions { margin-top: 20px; }
.cbr-about-main .cbr-sns-row { margin-top: 18px; }

/* ---- 상세 페이지 복귀 브레드크럼 ---- */
.cbr-detail-breadcrumb { margin-bottom: 18px; }
.cbr-detail-breadcrumb a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	background: #fff;
	border: 1px solid #E2E5EB;
	border-radius: 999px;
	text-decoration: none;
	color: var(--cbr-primary, #1B2A4A);
	font-weight: 600;
	font-size: .92rem;
	transition: all .15s ease;
}
.cbr-detail-breadcrumb a:hover {
	border-color: var(--cbr-secondary, #C9A227);
	color: var(--cbr-secondary, #C9A227);
}

@media (max-width: 860px) {
	.cbr-about-v3 { grid-template-columns: 1fr; gap: 24px; }
	.cbr-about-photo { max-width: 240px; margin: 0 auto; }
	.cbr-hero-search { min-height: 380px; }
	.cbr-cs-field .cbr-cs-input { padding: 15px 18px; font-size: .98rem; }
}
