/* ============================================================
   부동산연구소 전용 레이아웃 (v2, 구조 전면 개편)
   이전 버전(2단 헤더 + 번호형 인덱스 탭 + 홈 스택형 섹션)이 다른 자매
   사이트들과 구조가 비슷해 보인다는 피드백에 따라 다시 짰습니다.

   가장 큰 차이는 상단 탭 내비게이션을 완전히 없애고, "카테고리 체크리스트 +
   정렬 + 인테리어 비용 계산기"를 담은 좌측 필터 패널을 홈/카테고리/글 상세/
   검색 페이지 전체에 공통으로 붙여둔 것입니다(부동산 매물 사이트의 필터 UI에서
   착안). 헤더는 로고·검색만 있는 얇은 한 줄로 줄였고, 히어로 배너·표(table)·
   카테고리 허브 타일 그리드는 모두 없앤 뒤 "대표 카드 1개 + 나머지 카드"로
   구성되는 매서너리형 그리드 하나로 메인 목록을 통일했습니다.
   색상은 딥틸(#0f766e) 한 가지 accent + 화이트/라이트그레이 배경, 얇은
   테두리, 작은 radius로 공공기관/공인 정보사이트에 가까운 톤을 유지합니다.
   ============================================================ */

:root{
  --header-bg: #ffffff;
  --header-fg: #12312c;
  --header-fg-dim: #5c7b75;
  --accent: #0f766e;
  --accent-dark: #0b5750;
  --accent-soft: #e3f4f1;
  --bg: #f5f8f7;
  --surface: #ffffff;
  --border: #dbe6e2;
  --text: #182420;
  --text-soft: #5c6864;
  --text-dim: #94a19c;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15,40,35,.06);
  --shadow-md: 0 8px 22px rgba(15,40,35,.10);
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:"Pretendard","Apple SD Gothic Neo","Malgun Gothic",-apple-system,BlinkMacSystemFont,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}
button{font-family:inherit;}
ul{list-style:none;margin:0;padding:0;}
h1,h2,h3,h4{margin:0;}
p{margin:0;}

.site-main{max-width:760px;margin:0 auto;padding:32px 20px 64px;}

/* ---------- 헤더: 로고·검색만 있는 얇은 한 줄 ---------- */
.site-header-mini{
  position:sticky;top:0;z-index:40;
  background:var(--header-bg);border-bottom:1px solid var(--border);
}
.shm-inner{
  max-width:1180px;margin:0 auto;padding:14px 20px;
  display:flex;align-items:center;gap:18px;
}
.logo{
  display:flex;align-items:center;gap:9px;
  font-size:19px;font-weight:800;color:var(--header-fg);
  white-space:nowrap;
}
.logo .mark{
  display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:30px;border-radius:7px;
  background:var(--accent);color:#fff;font-size:15px;font-weight:800;
}
.search-form{
  flex:1;display:flex;align-items:center;
  background:var(--bg);border:1px solid var(--border);
  border-radius:999px;padding:6px 6px 6px 16px;
  max-width:460px;
}
.search-form input{
  flex:1;border:0;background:none;outline:none;
  color:var(--text);font-size:14px;padding:6px 0;
}
.search-form input::placeholder{color:var(--text-dim);}
.search-form button{
  border:0;background:var(--accent);color:#fff;
  padding:8px 16px;border-radius:999px;
  cursor:pointer;font-size:13px;font-weight:700;flex:0 0 auto;
}
.mobile-search-link{
  display:none;
  padding:8px 14px;border-radius:999px;
  align-items:center;justify-content:center;
  background:var(--accent);color:#fff;
  font-size:13px;font-weight:700;flex:0 0 auto;
}
.topbar-actions{
  display:flex;align-items:center;gap:8px;flex:0 0 auto;
  margin-left:auto;
}
.btn-line, .btn-solid{
  display:inline-flex;align-items:center;justify-content:center;
  padding:8px 16px;border-radius:999px;
  font-size:13px;font-weight:700;white-space:nowrap;
  cursor:pointer;border:1px solid transparent;
}
.btn-line{
  border-color:var(--border);color:var(--text-soft);
  background:transparent;
}
.btn-line:hover{border-color:var(--accent);color:var(--accent);}
.btn-solid{background:var(--accent);color:#fff;}
.btn-solid:hover{background:var(--accent-dark);}
.btn-block{width:100%;border-radius:8px;padding:10px;}

/* ---------- 전체 화면 셸: 좌측 필터 패널 + 우측 본문 (모든 콘텐츠 페이지 공통) ---------- */
.db-shell{
  max-width:1180px;margin:0 auto;padding:28px 20px 64px;
  display:grid;grid-template-columns:250px minmax(0,1fr);gap:28px;align-items:start;
  min-width:0;
}
.db-main{min-width:0;}

/* ---------- 좌측 필터 패널 부동산 필터 UI에서 착안한 체크리스트형 카테고리 ---------- */
.filter-panel{
  position:sticky;top:76px;
  display:flex;flex-direction:column;gap:14px;
  min-width:0;
}
.filter-block, .filter-more{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:16px 16px 18px;
  min-width:0;
}
.filter-block h3{
  font-size:12px;font-weight:800;margin-bottom:10px;color:var(--text-dim);
  text-transform:uppercase;letter-spacing:.04em;
}
.filter-check-list{display:flex;flex-direction:column;gap:2px;}
.fcheck{
  display:flex;align-items:center;gap:9px;padding:8px 6px;border-radius:8px;
  font-size:13.5px;font-weight:600;color:var(--text-soft);
}
.fcheck:hover{background:var(--bg);}
.fcheck-box{
  width:15px;height:15px;border:1.5px solid var(--border);border-radius:4px;flex:0 0 auto;
  display:inline-flex;align-items:center;justify-content:center;
}
.fcheck-label{flex:1;}
.fcheck-count{font-size:11.5px;color:var(--text-dim);font-weight:700;}
.fcheck.is-active{color:var(--accent-dark);background:var(--accent-soft);font-weight:800;}
.fcheck.is-active .fcheck-box{background:var(--accent);border-color:var(--accent);position:relative;}
.fcheck.is-active .fcheck-box::after{
  content:"";position:absolute;left:4px;top:1px;width:4px;height:8px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(40deg);
}
.fcheck.is-active .fcheck-count{color:var(--accent-dark);}

.filter-more summary{
  cursor:pointer;font-size:12px;font-weight:800;color:var(--text-dim);
  text-transform:uppercase;letter-spacing:.04em;list-style:none;
  display:flex;align-items:center;justify-content:space-between;
}
.filter-more summary::-webkit-details-marker{display:none;}
.filter-more summary::after{content:"+";font-size:15px;color:var(--text-dim);font-weight:700;}
.filter-more[open] summary::after{content:"–";}
.filter-more .sort-select-side{
  width:100%;margin-top:12px;border:1px solid var(--border);border-radius:8px;
  padding:9px 10px;font-size:13px;background:var(--bg);color:var(--text);
}
.cost-form-mini{display:flex;flex-direction:column;gap:12px;margin-top:12px;}
.cost-form-mini .form-field{display:flex;flex-direction:column;gap:5px;}
.cost-form-mini label{font-size:12.5px;font-weight:700;color:var(--text);}
.cost-form-mini input[type="number"]{
  border:1px solid var(--border);border-radius:8px;padding:9px 10px;
  font-size:13.5px;font-family:inherit;outline:none;
}
.cost-form-mini input[type="number"]:focus{border-color:var(--accent);}
.cost-radio-row{display:flex;gap:14px;}
.cost-radio{
  display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--text-soft);
  cursor:pointer;
}
.cost-radio input{accent-color:var(--accent);}
.cost-result-mini{margin-top:12px;font-size:12.5px;color:var(--text-soft);line-height:1.6;}
.cost-result-mini .cost-empty{font-size:12.5px;color:var(--text-soft);}
.cost-result-mini .cost-range{display:block;font-size:18px;font-weight:800;color:var(--accent-dark);margin-bottom:2px;}
.cost-result-mini .cost-label{display:block;font-size:12.5px;font-weight:700;color:var(--text);margin-bottom:6px;}
.cost-result-mini .cost-tip{font-size:11.5px;color:var(--text-dim);line-height:1.55;}

/* ---------- 페이지 상단 타이틀 블록(홈/카테고리/검색/글 상세 공통, 히어로 배너 대신) ---------- */
.page-title-block{
  margin-bottom:24px;padding-left:16px;
  border-left:4px solid var(--hero-tint-fg, var(--accent));
}
.page-title-block .eyebrow{
  display:inline-block;font-size:12px;font-weight:800;letter-spacing:.05em;
  color:var(--accent);margin-bottom:6px;
}
.page-title-block h1{font-size:24px;font-weight:800;color:var(--text);line-height:1.35;}
.page-title-block p{font-size:13.5px;color:var(--text-soft);margin-top:6px;}
.cat-crumb{
  display:flex;align-items:center;gap:6px;
  font-size:12px;color:var(--text-soft);margin-bottom:10px;
}
.cat-crumb a:hover{text-decoration:underline;}
.post-title-block h1{font-size:23px;}
.post-meta{font-size:13px;color:var(--text-soft);margin-top:6px;}

.home-stat-row{
  display:flex;gap:16px;flex-wrap:wrap;margin-top:14px;
}
.home-stat{font-size:13px;color:var(--text-soft);}
.home-stat b{color:var(--accent-dark);font-size:15px;font-weight:800;margin-right:3px;}

/* ---------- 매서너리 그리드 홈/카테고리/검색의 메인 목록 전용 ----------
   첫 번째 카드만 2칸을 차지하는 대표 카드로 커지고, 나머지는 균일한 카드로
   자동 배치되어 균일한 카드 그리드와는 다른 비대칭 레이아웃이 됩니다. */
.masonry-grid{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:20px;
  min-width:0;
}
.mason-card{
  display:flex;flex-direction:column;gap:8px;min-width:0;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:18px;transition:transform .15s, box-shadow .15s;
}
.mason-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);}
.mason-cat{font-size:12px;font-weight:700;}
.mason-title{
  font-size:15px;font-weight:700;line-height:1.45;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
}
.mason-date{font-size:12px;color:var(--text-dim);margin-top:auto;padding-top:2px;}
.mason-card-featured{
  grid-column:span 2;padding:26px;
  background:linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 65%);
  box-shadow:var(--shadow);
}
.mason-card-featured .mason-title{font-size:20px;-webkit-line-clamp:2;}
.mason-card-featured .mason-summary{
  font-size:13.5px;color:var(--text-soft);line-height:1.6;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}

/* ---------- 카드 그리드(추천/관련 글 보조 리스트 전용) ---------- */
.pick-grid, .card-grid{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;min-width:0;
}
.card-grid-list{grid-template-columns:repeat(2,minmax(0,1fr));}
.card-grid-compact{grid-template-columns:repeat(2,minmax(0,1fr));}
.card-grid + .card-grid{margin-top:28px;}
.pick-grid{margin-bottom:32px;}

.pick-card{
  display:flex;flex-direction:column;gap:10px;min-width:0;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);padding:18px;
  transition:transform .15s, box-shadow .15s;
  height:100%;
}
.pick-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md);}
.pick-body{display:flex;flex-direction:column;gap:7px;flex:1;}
.pick-card .srow-cat{
  font-size:12px;font-weight:700;color:var(--accent);
  display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.pick-card .title{
  font-size:15px;font-weight:700;line-height:1.45;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.pick-date{font-size:12px;color:var(--text-dim);margin-top:auto;padding-top:4px;}

.empty-state, .side-empty{
  padding:36px 16px;text-align:center;color:var(--text-dim);
  font-size:14px;background:var(--surface);
  border:1px dashed var(--border);border-radius:var(--radius);
  grid-column:1/-1;
}

/* ---------- 카테고리 목록 페이지 ---------- */
.filter-bar{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:14px;gap:12px;flex-wrap:wrap;
}
.result-count{font-size:13px;color:var(--text-soft);}
.result-count strong{color:var(--text);}
.pagination{
  display:flex;justify-content:center;gap:6px;margin-top:8px;margin-bottom:28px;flex-wrap:wrap;
}
.pagination a, .pagination span, .pagination button{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:34px;height:34px;padding:0 8px;border-radius:8px;
  font-size:13px;font-weight:600;color:var(--text-soft);
  border:1px solid var(--border);background:var(--surface);cursor:pointer;
}
.pagination button:hover{border-color:var(--accent);color:var(--accent);}
.pagination .is-active{background:var(--accent);color:#fff;border-color:var(--accent);}
.pagination button:disabled{opacity:.4;cursor:default;}

.feed-head, .hub-head, .block-head{
  display:flex;align-items:baseline;justify-content:space-between;
  margin-bottom:16px;gap:12px;flex-wrap:wrap;
}
.feed-head h2, .hub-head h2, .block-head h2{font-size:18px;font-weight:800;}
.block-more{font-size:13px;font-weight:700;color:var(--accent);white-space:nowrap;}
.block-more:hover{text-decoration:underline;}

.explore-more{
  margin-top:36px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;min-width:0;
}
.explore-more-single{grid-template-columns:minmax(0,1fr);}
.explore-col{min-width:0;}
.explore-col h3, .explore-col h4{font-size:15px;font-weight:800;margin-bottom:12px;}

/* ---------- 글 상세 페이지 ---------- */
.post-narrow{max-width:100%;}
.info-box{
  background:var(--accent-soft);border:1px solid #bfe0da;
  border-radius:var(--radius);padding:18px 20px;margin:22px 0 28px;
}
.spec-title{font-size:14px;font-weight:800;color:var(--accent-dark);margin-bottom:12px;}
.spec-grid{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 20px;min-width:0;
}
.spec-row{display:flex;flex-direction:column;gap:3px;}
.spec-label{font-size:12px;color:var(--accent-dark);font-weight:700;}
.spec-value{font-size:14px;color:var(--text);font-weight:600;}
.spec-empty{font-size:13px;color:var(--text-dim);}

.post-intro{font-size:15px;color:var(--text-soft);margin-bottom:20px;}
.post-section{margin-bottom:26px;}
.post-section h2{font-size:17px;font-weight:800;margin-bottom:10px;}
.post-section p{font-size:14.5px;line-height:1.75;color:var(--text);}
.keyfact-box{
  background:var(--bg);border:1px solid var(--border);
  border-radius:var(--radius-sm);padding:14px 16px;margin-top:12px;
  display:flex;flex-direction:column;gap:8px;
}
.keyfact-box .kf-label{font-size:12px;font-weight:800;color:var(--accent);}
.post-table{
  width:100%;border-collapse:collapse;margin-top:12px;font-size:13.5px;
}
.post-table th, .post-table td{
  border:1px solid var(--border);padding:9px 11px;text-align:left;
}
.post-table th{background:var(--bg);font-weight:700;}
.post-tags{
  display:flex;flex-wrap:wrap;gap:8px;margin-top:22px;
}
.post-tags a{
  font-size:12.5px;padding:6px 12px;border-radius:999px;
  background:var(--bg);color:var(--text-soft);border:1px solid var(--border);
}

.related-block{margin-top:40px;}
.related-block h3{font-size:16px;font-weight:800;margin-bottom:14px;}

/* ---------- 검색 페이지 ---------- */
.search-form-big{
  display:flex;align-items:center;gap:8px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:999px;padding:6px 6px 6px 18px;max-width:520px;margin-bottom:24px;
}
.search-form-big input{flex:1;border:0;outline:none;font-size:14px;padding:10px 0;}
.search-form-big button{
  border:0;background:var(--accent);color:#fff;padding:10px 20px;
  border-radius:999px;font-weight:700;font-size:13px;cursor:pointer;
}

.keyword-block{margin-top:40px;}
.keyword-block h3{font-size:15px;font-weight:800;margin-bottom:14px;}
.keyword-chips{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px;}
.keyword-chips a{
  font-size:13px;padding:7px 14px;border-radius:999px;
  background:var(--surface);border:1px solid var(--border);color:var(--text-soft);
}
.keyword-chips a:hover{border-color:var(--accent);color:var(--accent);}

/* ---------- 정적 페이지 ---------- */
.static-page{max-width:760px;margin:0 auto;}
.static-page h1{font-size:24px;font-weight:800;margin-bottom:18px;}
.static-page h2{font-size:17px;font-weight:800;margin:26px 0 10px;}
.static-page p{font-size:14.5px;color:var(--text-soft);line-height:1.8;margin-bottom:10px;}
.static-page ul{margin:12px 0;display:flex;flex-direction:column;gap:8px;}
.static-page li{font-size:14.5px;color:var(--text-soft);line-height:1.6;padding-left:16px;position:relative;}
.static-page li::before{content:"•";position:absolute;left:0;color:var(--accent);font-weight:800;}
.bracket{color:var(--accent);font-weight:700;}

.contact-tabs{display:flex;gap:8px;margin-bottom:20px;flex-wrap:wrap;}
.contact-tabs a, .contact-tabs span{
  padding:8px 16px;border-radius:999px;font-size:13px;font-weight:700;
  border:1px solid var(--border);color:var(--text-soft);
}
.contact-tabs .is-active{background:var(--accent);color:#fff;border-color:var(--accent);}
.contact-form{
  display:flex;flex-direction:column;gap:18px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);padding:22px;
}
.contact-form .form-field{display:flex;flex-direction:column;gap:7px;}
.contact-form label{font-size:13px;font-weight:700;color:var(--text);}
.contact-form input, .contact-form textarea{
  width:100%;box-sizing:border-box;
  border:1px solid var(--border);border-radius:8px;
  padding:11px 13px;font-size:14px;font-family:inherit;outline:none;
}
.contact-form input:focus, .contact-form textarea:focus{border-color:var(--accent);}
.contact-form textarea{min-height:120px;resize:vertical;}
.contact-form button{
  align-self:flex-start;border:0;background:var(--accent);color:#fff;
  padding:11px 26px;border-radius:999px;font-weight:700;font-size:14px;cursor:pointer;
}
.contact-form button:hover{background:var(--accent-dark);}

/* ---------- 푸터 ---------- */
.site-footer{
  background:var(--accent-dark);color:rgba(255,255,255,.75);
  margin-top:60px;
}
.footer-inner{
  max-width:1180px;margin:0 auto;padding:34px 20px;
  display:flex;flex-direction:column;gap:14px;
}
.footer-links{display:flex;gap:16px;flex-wrap:wrap;}
.footer-links a{font-size:13px;color:rgba(255,255,255,.9);}
.footer-links a:hover{color:#a8e8dd;}
.footer-meta{font-size:12px;color:rgba(255,255,255,.58);}

/* 글 상세 페이지 "추천 글" 전용 그리드 explore-col을 하나만 쓰므로
   데스크톱에서 3열, 모바일에서는 1열로 노출합니다. */
.card-grid-rec3{grid-template-columns:repeat(3,minmax(0,1fr));}

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 960px){
  .db-shell{grid-template-columns:minmax(0,1fr);gap:20px;}
  .filter-panel{
    position:static;flex-direction:row;flex-wrap:wrap;gap:10px;
  }
  .filter-block{flex:1 1 100%;min-width:0;}
  .filter-check-list{
    flex-direction:row;flex-wrap:nowrap;overflow-x:auto;gap:6px;
    scrollbar-width:none;min-width:0;
  }
  .filter-check-list::-webkit-scrollbar{display:none;}
  .fcheck{flex:0 0 auto;white-space:nowrap;}
  .fcheck-count{margin-left:2px;}
  .filter-more{flex:1 1 220px;min-width:0;}

  .masonry-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .pick-grid, .card-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .card-grid-list{grid-template-columns:minmax(0,1fr);}
  .card-grid-compact{grid-template-columns:repeat(2,minmax(0,1fr));}
  .explore-more{grid-template-columns:minmax(0,1fr);}
}

@media (max-width: 640px){
  .shm-inner{padding:10px 14px;gap:8px;flex-wrap:nowrap;}
  .logo{font-size:0;gap:0;flex:0 0 auto;}
  .logo .mark{font-size:15px;}
  .search-form{display:none;}
  .mobile-search-link{display:flex;}
  .btn-line{display:none;}
  .topbar-actions{gap:6px;}
  .btn-solid{padding:8px 12px;font-size:12px;}

  .db-shell{padding:20px 14px 44px;}
  .site-main{padding:22px 14px 44px;}

  .page-title-block h1{font-size:20px;}
  .post-title-block h1{font-size:19px;}

  .masonry-grid{grid-template-columns:minmax(0,1fr);}
  .mason-card-featured{grid-column:1;padding:20px;}
  .mason-card-featured .mason-title{font-size:18px;}
  .pick-grid, .card-grid, .card-grid-compact{grid-template-columns:minmax(0,1fr);}
  .card-grid-rec3{grid-template-columns:minmax(0,1fr);}

  .filter-bar{flex-direction:column;align-items:flex-start;}
}
