@charset "utf-8";

/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: #191f28;
  background-color: #ffffff;
  line-height: 1.7;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Header Layout */
#header {
  background: #ffffff;
  border-bottom: 1px solid #e5e8eb;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 9999;
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand a {
  font-size: 22px;
  font-weight: 800;
  color: #191f28;
  font-family: 'Inter', sans-serif;
}
.brand .badge {
  font-size: 10px;
  font-weight: 800;
  background: #3182f6;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 메인 2단 레이아웃 */
#main-container { min-height: 80vh; padding: 40px 0 80px; }
.layout-wrapper {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 40px;
}

/* 좌측 사이드바 영역 */
.sidebar-left {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 우측 본문 영역 */
.content-area {
  flex: 1;
  min-width: 0;
}

/* 공통 위젯 카드 스타일 */
.widget {
  background: #f9fafb;
  border: 1px solid #e5e8eb;
  border-radius: 16px;
  padding: 22px 20px;
}

.widget .widget-title {
  font-size: 15px;
  font-weight: 700;
  color: #191f28;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e8eb;
}

/* ==================================================
   좌측 카테고리 트리 (1차 메뉴 상시 노출 / 2차 메뉴 호버 팝업)
   ================================================== */
.category-widget ul, .category-widget li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 최상위(분류 전체보기) & 1차 카테고리 목록 - 상시 펼침 */
.category-widget .category > ul,
.category-widget .tt_category,
.category-widget .category ul.tt_category > li > ul {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  position: relative !important;
}

/* 1차 메뉴(주간금리, 부동산뉴스, 부동산트랜드 등) 항목 */
.category-widget .category li {
  position: relative !important; /* 2차 분류 팝업의 위치 기준점 */
  display: block !important;
  width: 100% !important;
}

/* 최상위(분류 전체보기) 및 1차 메뉴 링크 스타일 */
.category-widget .category a {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #333d4b !important;
  border-radius: 8px !important;
  transition: all 0.15s ease !important;
}

.category-widget .category a:hover {
  background: #f0f7ff !important;
  color: #3182f6 !important;
}

/* '분류 전체보기' 블루 강조 버튼 */
.category-widget .category > ul > li:first-child > a,
.category-widget .tt_category > li:first-child > a {
  background: #3182f6 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  margin-bottom: 6px !important;
}

.category-widget .category > ul > li:first-child > a:hover,
.category-widget .tt_category > li:first-child > a:hover {
  background: #1b64da !important;
  color: #ffffff !important;
}

/* 카테고리 내 글 수 표시 (숫자) */
.category-widget .c_cnt {
  font-size: 12px !important;
  color: #8b95a1 !important;
  font-weight: 400 !important;
}

.category-widget .category > ul > li:first-child > a .c_cnt,
.category-widget .tt_category > li:first-child > a .c_cnt {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* 2차 분류 (서울특별시, 부산광역시 등 하위 메뉴) - 평소 숨김 */
.category-widget .sub_category_list,
.category-widget .category ul.tt_category ul ul {
  display: none !important;
  position: absolute !important;
  top: 0 !important;
  left: 100% !important; /* 1차 메뉴 오른쪽에 팝업 */
  min-width: 190px !important;
  max-height: 400px !important; /* 길어지면 내부 스크롤 생성 */
  overflow-y: auto !important;
  background: #ffffff !important;
  border: 1px solid #e5e8eb !important;
  border-radius: 12px !important;
  padding: 8px 0 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
  margin-left: 8px !important;
  z-index: 9999 !important;
}

/* 2차 분류 내부 스크롤바 정돈 */
.category-widget .sub_category_list::-webkit-scrollbar,
.category-widget .category ul.tt_category ul ul::-webkit-scrollbar {
  width: 4px;
}
.category-widget .sub_category_list::-webkit-scrollbar-thumb,
.category-widget .category ul.tt_category ul ul::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* 1차 메뉴에 마우스를 올리면 2차 분류(지역 목록) 팝업 노출 */
.category-widget .category li:hover > .sub_category_list,
.category-widget .category li:hover > ul {
  display: block !important;
}

/* 2차 분류 링크 디자인 */
.category-widget .sub_category_list a,
.category-widget .category ul.tt_category ul ul a {
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #4e5968 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.category-widget .sub_category_list a:hover,
.category-widget .category ul.tt_category ul ul a:hover {
  color: #3182f6 !important;
  background: #f0f7ff !important;
}

/* ==================================================
   좌측 최근 글 위젯 스타일
   ================================================== */
.recent-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.recent-list li {
  margin-bottom: 10px !important;
  padding-bottom: 10px !important;
  border-bottom: 1px dotted #e5e8eb;
}

.recent-list li:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
}

.recent-list a {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #4e5968;
  line-height: 1.45;
  transition: color 0.15s ease;
}

.recent-list a:hover {
  color: #3182f6 !important;
  font-weight: 600;
}

.recent-list .recent-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Article & Content Styling */
.post-header { margin-bottom: 35px; }
.post-category { font-size: 13px; font-weight: 700; color: #3182f6; margin-bottom: 10px; }
.post-title { font-size: 32px; font-weight: 800; color: #191f28; line-height: 1.35; margin-bottom: 14px; }
.post-meta { font-size: 14px; color: #8b95a1; font-family: 'Inter', sans-serif; display: flex; gap: 8px; }

#article-view { font-size: 17px; color: #333d4b; line-height: 1.85; word-break: keep-all; }
#article-view p { margin-bottom: 24px; }
#article-view h2 { font-size: 24px; font-weight: 700; color: #191f28; margin: 40px 0 16px; }
#article-view h3 { font-size: 20px; font-weight: 700; color: #191f28; margin: 30px 0 14px; }

#article-view table {
  width: 100% !important; border-collapse: collapse;
  margin: 28px 0; border-radius: 10px; overflow: hidden;
  border: 1px solid #e5e8eb;
}
#article-view table th, #article-view table td {
  padding: 12px 16px; font-size: 14px; text-align: center; border-bottom: 1px solid #f2f4f6;
}
#article-view table th { background-color: #f9fafb; font-weight: 700; color: #333d4b; }

.adsense-slot { margin: 35px 0; padding: 10px; background: #fafbfc; border-radius: 10px; text-align: center; }

#paging { padding: 40px 0; text-align: center; font-family: 'Inter', sans-serif; font-weight: 600; }
#paging a { display: inline-block; padding: 6px 14px; color: #6b7684; border-radius: 6px; }
#paging .selected { background: #3182f6; color: #ffffff !important; }

#footer { padding: 30px 0; text-align: center; font-size: 13px; color: #8b95a1; border-top: 1px solid #f2f4f6; }

/* Responsive Mobile */
@media (max-width: 992px) {
  .layout-wrapper { flex-direction: column; gap: 0; }
  .sidebar-left { display: none; }
  .post-title { font-size: 24px; }
  #main-container { padding: 20px 0 50px; }
  #article-view table { display: block; overflow-x: auto; white-space: nowrap; }
}