/* ==========================================================================
   PROJECT-10 — PHASE-5A : 단지 상세페이지 (complex-detail.html) 전용 스타일
   Design Freeze v1.0(assets/css/style.css)의 색상/폰트/Radius/Shadow 변수를
   그대로 상속해서 사용합니다. 이 파일은 새 클래스(cd- 접두사)만 정의하며
   style.css의 기존 선택자는 전혀 건드리지 않습니다.
   ========================================================================== */

.cd-main{ max-width:1180px; margin:0 auto; padding:0 32px 40px; }

.cd-breadcrumb{
  font-size:12.5px; color:var(--text-muted);
  padding:16px 0 8px;
}
.cd-breadcrumb a{ color:var(--text-muted); text-decoration:none; }
.cd-breadcrumb a:hover{ color:var(--navy2); }
.cd-breadcrumb .sep{ margin:0 6px; }
.cd-breadcrumb .current{ color:var(--text-headline); font-weight:600; }

/* ---------------------------------------------------------------------
   Hero Summary
   --------------------------------------------------------------------- */
.cd-hero{
  display:grid;
  grid-template-columns: 340px 1fr;
  gap:24px;
  padding:16px 0 28px;
}
.cd-hero-photo{
  width:100%; aspect-ratio:16/11;
  border-radius:var(--radius-lg);
  overflow:hidden; background:var(--bg-alt);
}
.cd-hero-photo img{ width:100%; height:100%; object-fit:cover; display:block; }

.cd-hero-body{ display:flex; flex-direction:column; justify-content:center; gap:10px; }
.cd-badge{
  display:inline-flex; align-self:flex-start;
  background:rgba(66,120,102,0.12); color:var(--green);
  font-size:12px; font-weight:700; padding:5px 12px; border-radius:999px;
}
.cd-hero-title{ font-size:26px; font-weight:800; color:var(--text-headline); margin:0; }
.cd-hero-address{ font-size:13.5px; color:var(--text-body); margin:0; }

.cd-hero-meta{ display:flex; flex-wrap:wrap; gap:8px; margin-top:4px; }
.cd-hero-meta span{
  background:var(--bg-alt); border:1px solid var(--border);
  font-size:12px; color:var(--text-body); padding:6px 12px; border-radius:999px;
}

.cd-hero-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:6px; }
.cd-action-btn{
  display:inline-flex; align-items:center; gap:6px;
  border:1px solid var(--border); background:#fff; color:var(--text-headline);
  font-size:12.5px; font-weight:600; padding:9px 16px; border-radius:999px;
  text-decoration:none;
}
.cd-action-btn:hover{ background:var(--bg-alt); }
.cd-action-btn.is-accent{ background:var(--navy2); color:#fff; border-color:var(--navy2); }
.cd-action-btn.is-accent:hover{ background:#081430; }

/* ---------------------------------------------------------------------
   Tabs
   --------------------------------------------------------------------- */
.cd-tabs{
  display:flex; flex-wrap:wrap; gap:4px;
  border-bottom:1px solid var(--border);
  margin-bottom:24px;
}
.cd-tab{
  padding:12px 16px; font-size:13.5px; font-weight:600; color:var(--text-body);
  text-decoration:none; border-bottom:2px solid transparent; margin-bottom:-1px;
  white-space:nowrap;
}
.cd-tab:hover{ color:var(--text-headline); }
.cd-tab.is-active{ color:var(--navy2); border-bottom-color:var(--navy2); }

/* ---------------------------------------------------------------------
   공통 3열 그리드 행 (Row 1 / Row 2 / Row 3)
   --------------------------------------------------------------------- */
.cd-row{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px; margin-bottom:20px; align-items:stretch; }
.cd-card{
  background:#fff; border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:20px; display:flex; flex-direction:column;
}
.cd-card h3{ font-size:15px; font-weight:700; color:var(--text-headline); margin:0 0 14px; display:flex; align-items:center; justify-content:space-between; }
.cd-card h3 .cd-more-link{ font-size:12px; font-weight:500; color:var(--text-muted); text-decoration:none; }
.cd-card h3 .cd-more-link:hover{ color:var(--navy2); }

/* 단지 개요 표 */
.cd-overview-table{ display:flex; flex-direction:column; gap:10px; }
.cd-overview-row{ display:flex; justify-content:space-between; gap:12px; font-size:12.5px; }
.cd-overview-row dt{ color:var(--text-muted); flex-shrink:0; }
.cd-overview-row dd{ color:var(--text-headline); font-weight:600; margin:0; text-align:right; }

/* 지도 카드 */
.cd-map-placeholder{
  flex:1; min-height:150px; border-radius:var(--radius-md);
  background:repeating-linear-gradient(45deg,#EFF2F1,#EFF2F1 10px,#E7ECEA 10px,#E7ECEA 20px);
  display:flex; align-items:center; justify-content:center; margin-bottom:12px;
}
.cd-map-pin{ display:flex; flex-direction:column; align-items:center; gap:5px; }
.cd-map-pin-dot{ width:14px; height:14px; border-radius:50% 50% 50% 0; background:var(--navy2); transform:rotate(-45deg); }
.cd-map-pin-label{ font-size:11px; font-weight:600; background:#fff; padding:4px 9px; border-radius:999px; box-shadow:var(--shadow-card); }
.cd-map-btn{
  border:1px solid var(--border); background:#fff; padding:9px; border-radius:8px;
  font-size:12px; font-weight:600; color:var(--text-headline); text-align:center; text-decoration:none; display:block;
}
.cd-map-btn:hover{ background:var(--bg-alt); }

/* 단지 한눈에 보기 (점수 바) */
.cd-score-list{ display:flex; flex-direction:column; gap:10px; flex:1; }
.cd-score-row{ display:flex; align-items:center; gap:10px; font-size:12.5px; }
.cd-score-label{ width:36px; color:var(--text-body); flex-shrink:0; }
.cd-score-bar{ flex:1; height:6px; border-radius:999px; background:var(--bg-alt); overflow:hidden; }
.cd-score-bar-fill{ height:100%; background:var(--green); border-radius:999px; }
.cd-score-value{ width:28px; text-align:right; font-weight:700; color:var(--text-headline); flex-shrink:0; }
.cd-score-total{ margin-top:14px; padding-top:14px; border-top:1px solid var(--border); text-align:center; }
.cd-score-total-label{ font-size:12px; color:var(--text-body); }
.cd-score-total-value{ font-size:22px; font-weight:800; color:var(--green); }
.cd-score-total-value span{ font-size:13px; font-weight:600; color:var(--text-muted); }

/* 실거래가 추이 */
.cd-chart-tabs{ display:flex; gap:6px; margin-bottom:10px; }
.cd-chip-btn{
  border:1px solid var(--border); background:#fff; color:var(--text-body);
  font-size:11.5px; font-weight:600; padding:5px 11px; border-radius:999px; cursor:pointer;
}
.cd-chip-btn.is-active{ background:var(--navy2); color:#fff; border-color:var(--navy2); }
.cd-chart-periods{ display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; }
.cd-chart-canvas-wrap{ height:150px; margin-bottom:12px; }
.cd-chart-canvas-wrap canvas{ max-width:100%; }
.cd-chart-latest{ display:flex; align-items:baseline; justify-content:space-between; padding-top:10px; border-top:1px solid var(--border); }
.cd-chart-latest-label{ font-size:11.5px; color:var(--text-body); }
.cd-chart-latest-value{ font-size:17px; font-weight:800; color:var(--text-headline); }
.cd-chart-latest-delta{ font-size:11.5px; color:var(--green); }

/* 평형 정보 표 */
.cd-unit-table{ width:100%; border-collapse:collapse; font-size:12px; margin-bottom:12px; }
.cd-unit-table th{ text-align:left; color:var(--text-muted); font-weight:600; padding:6px 4px; border-bottom:1px solid var(--border); }
.cd-unit-table td{ padding:8px 4px; border-bottom:1px solid var(--border); color:var(--text-body); }
.cd-unit-table tr.is-highlight td{ color:var(--text-headline); font-weight:700; background:var(--bg-cream); }
.cd-unit-actions{ display:flex; gap:8px; margin-top:auto; }
.cd-unit-actions .cd-map-btn{ flex:1; }

/* 관리비 */
.cd-fee-total{ text-align:left; margin-bottom:14px; }
.cd-fee-total-label{ font-size:12px; color:var(--text-body); }
.cd-fee-total-value{ font-size:22px; font-weight:800; color:var(--text-headline); }
.cd-fee-list{ display:flex; flex-direction:column; gap:9px; flex:1; }
.cd-fee-row{ display:flex; justify-content:space-between; font-size:12.5px; color:var(--text-body); }
.cd-fee-row strong{ color:var(--text-headline); font-weight:700; }
.cd-fee-note{ font-size:11px; color:var(--text-muted); margin-top:12px; }

/* 학군 정보 */
.cd-school-table{ display:flex; flex-direction:column; gap:10px; }
.cd-school-row{ display:flex; justify-content:space-between; align-items:center; font-size:12.5px; }
.cd-school-level{ color:var(--text-muted); width:56px; flex-shrink:0; }
.cd-school-name{ color:var(--text-headline); font-weight:600; flex:1; }
.cd-school-distance{ background:var(--bg-alt); color:var(--text-body); font-size:11px; padding:3px 9px; border-radius:999px; }
.cd-school-rating{ margin-top:14px; padding-top:14px; border-top:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.cd-stars{ color:var(--gold); letter-spacing:1px; }
.cd-school-score{ font-size:12.5px; font-weight:700; color:var(--text-headline); }

/* 상권/편의시설 */
.cd-amenity-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.cd-amenity-item{ display:flex; flex-direction:column; gap:6px; align-items:center; text-align:center; background:var(--bg-alt); border-radius:var(--radius-md); padding:12px 8px; }
.cd-amenity-icon{ width:32px; height:32px; border-radius:50%; background:rgba(33,112,201,0.12); color:var(--blue); display:flex; align-items:center; justify-content:center; }
.cd-amenity-label{ font-size:11.5px; font-weight:600; color:var(--text-headline); }
.cd-amenity-distance{ font-size:11px; color:var(--text-muted); }

/* 최근 블로그 & 리포트 */
.cd-post-list{ display:flex; flex-direction:column; gap:12px; }
.cd-post-item{ display:flex; gap:10px; align-items:center; text-decoration:none; }
.cd-post-thumb{ width:44px; height:44px; border-radius:8px; flex-shrink:0; background:linear-gradient(135deg,#DCE9E2,#8FB6A6); }
.cd-post-title{ font-size:12.5px; font-weight:600; color:var(--text-headline); margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cd-post-date{ font-size:11px; color:var(--text-muted); }

/* ---------------------------------------------------------------------
   추천 매물
   --------------------------------------------------------------------- */
.cd-section-title{ font-size:17px; font-weight:700; color:var(--text-headline); margin:0 0 14px; }
.cd-listing-row{ display:grid; grid-template-columns:repeat(5,1fr); gap:16px; margin-bottom:32px; }
.cd-listing-card{ background:#fff; border:1px solid var(--border); border-radius:var(--radius-lg); overflow:hidden; text-decoration:none; display:block; }
.cd-listing-thumb{ position:relative; aspect-ratio:4/3; background:linear-gradient(135deg,#E4DCC8,#B39A6A); }
.cd-listing-tag{
  position:absolute; top:8px; left:8px;
  font-size:10.5px; font-weight:700; color:#fff; padding:3px 9px; border-radius:999px;
  background:var(--orange);
}
.cd-listing-tag.is-featured{ background:var(--green); }
.cd-listing-body{ padding:12px; }
.cd-listing-title{ font-size:12px; color:var(--text-muted); margin:0 0 3px; }
.cd-listing-price{ font-size:14.5px; font-weight:800; color:var(--text-headline); margin:0 0 5px; }
.cd-listing-detail{ font-size:11px; color:var(--text-body); margin:0; }
.cd-listing-sub{ font-size:11px; color:var(--text-muted); margin:2px 0 0; }
.cd-listing-status{ font-size:10.5px; color:var(--green); font-weight:600; margin-top:5px; }

/* ---------------------------------------------------------------------
   상담 / 문의
   --------------------------------------------------------------------- */
.cd-contact-card{
  background:var(--bg-cream); border-radius:var(--radius-lg); padding:26px;
  margin-bottom:8px;
}
.cd-contact-title{ font-size:15px; font-weight:700; color:var(--text-headline); margin:0 0 4px; }
.cd-contact-sub{ font-size:12.5px; color:var(--text-body); margin:0 0 18px; }
.cd-contact-form{ display:flex; flex-direction:column; gap:10px; max-width:480px; }
.cd-contact-form input,
.cd-contact-form textarea{
  border:1px solid var(--border); border-radius:10px; padding:11px 14px;
  font-size:13px; font-family:inherit; color:var(--text-headline); background:#fff;
  resize:vertical;
}
.cd-contact-form textarea{ min-height:80px; }
.cd-contact-form button{
  align-self:flex-start; border:none; background:var(--green); color:#fff;
  font-size:13.5px; font-weight:600; padding:12px 24px; border-radius:999px; cursor:pointer;
}
.cd-contact-form button:hover{ background:#365f52; }

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 1080px){
  .cd-row{ grid-template-columns:1fr 1fr; }
  .cd-row .cd-card:nth-child(3){ grid-column:1 / -1; }
  .cd-listing-row{ grid-template-columns:repeat(3,1fr); }
}
@media (max-width: 860px){
  .cd-hero{ grid-template-columns:1fr; }
  .cd-row{ grid-template-columns:1fr; }
  .cd-row .cd-card:nth-child(3){ grid-column:auto; }
  .cd-listing-row{ grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 620px){
  .cd-amenity-grid{ grid-template-columns:1fr 1fr; }
  .cd-listing-row{ grid-template-columns:1fr 1fr; }
}
