:root {
    /* [Color System] Slate & Indigo Theme */
    --primary: #1e3a8a;       /* 신뢰의 딥 네이비 */
    --primary-light: #3b82f6; /* 활력의 블루 */
    --accent: #f43f5e;        /* 포인트 레드 */
    
    --bg-body: #f8fafc;       /* 쿨그레이 배경 */
    --surface: #ffffff;       /* 카드 흰색 배경 */
    
    --text-main: #0f172a;     /* 본문 텍스트 */
    --text-sub: #64748b;      /* 서브 텍스트 */
    --border: #e2e8f0;        /* 연한 테두리 */
    
    --radius-l: 24px;
    --radius-m: 16px;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased; /* 폰트 렌더링 부드럽게 */
}

a { text-decoration: none; color: inherit; }

/* [Header] Hero Section */
.hero-section {
    background: linear-gradient(180deg, #fff 0%, #f1f5f9 100%);
    padding: 50px 20px 110px; /* 하단 여백 충분히 */
    text-align: center;
    border-bottom-left-radius: 50px;
    border-bottom-right-radius: 50px;
    position: relative;
    z-index: 1;
}

.brand-logo {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    display: inline-block;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 40px;
    color: var(--text-main);
    line-height: 1.3;
    word-break: keep-all; /* 단어 단위 줄바꿈 */
}
.hero-title span { color: var(--primary-light); }

/* 검색창 */
.search-wrapper {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(59, 130, 246, 0.15);
    border-radius: 100px;
}
.search-input {
    width: 100%;
    padding: 24px 70px 24px 32px;
    font-size: 1.15rem;
    border: 2px solid transparent;
    border-radius: 100px;
    outline: none;
    transition: all 0.3s;
    background: #fff;
    color: var(--text-main);
    font-weight: 500;
}
.search-input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.search-btn-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.search-btn-icon:hover { background: var(--primary-light); }

/* [Container] Bento Grid */
.bento-container {
    max-width: 1100px;
    margin: -70px auto 60px; /* Hero 위로 겹침 효과 */
    padding: 0 20px;
    display: grid;
    grid-template-columns: 320px 1fr; /* 좌측 고정, 우측 가변 */
    gap: 24px;
    position: relative;
    z-index: 10;
}

.bento-card {
    background: var(--surface);
    border-radius: var(--radius-l);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255,255,255,0.6);
}

.card-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 1.3rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
.card-title i { color: var(--primary-light); }

/* [Left] 인구 통계 카드 */
.population-card {
    grid-column: 1;
    /* sticky 옵션을 주면 스크롤 시 따라오게 할 수도 있음 (선택사항) */
    height: fit-content;
}
.pop-list { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.pop-item {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 18px;
    border-radius: var(--radius-m);
    transition: 0.2s;
    border: 1px solid transparent;
}
.pop-item:hover {
    background: #fff;
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transform: translateX(5px);
}
.pop-icon {
    width: 44px; height: 44px;
    background: #e0f2fe;
    color: #0284c7;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 16px;
    font-size: 1.2rem;
}
.pop-text strong { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.pop-text span { font-size: 0.85rem; color: var(--text-sub); }

/* [Right] 부동산 통합 카드 */
.realestate-card {
    grid-column: 2;
}

/* 탭 버튼 */
.region-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 14px;
    margin-bottom: 24px;
    gap: 4px; /* 버튼 사이 미세한 간격 추가 */
}
.tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.3s ease;
    border-bottom: 3px solid transparent; /* 하단 라인 미리 확보 */
}
.tab-btn.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}
.tab-btn:hover:not(.active) { color: var(--text-main); }

/* 부동산 그리드 (2x2) */
.estate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.estate-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: 0.2s;
}
.estate-box:hover {
    border-color: var(--primary-light);
    box-shadow: 0 10px 20px rgba(0,0,0,0.03);
    transform: translateY(-2px);
}

.box-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.box-title { font-size: 1.1rem; font-weight: 700; color: #334155; }
.box-icon { color: #cbd5e1; font-size: 1.5rem; }

/* 트레이드 버튼 (매매/전세/월세) */
.trade-links { display: flex; gap: 8px; margin-top: auto; }
.trade-btn {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 9px 0;
    border-radius: 8px;
    transition: 0.2s;
}
/* 색상 구분 (파스텔톤 배경 + 진한 텍스트) */
.trade-btn.sale { background: #fff1f2; color: #e11d48; }  /* Red */
.trade-btn.jeonse { background: #eff6ff; color: #2563eb; } /* Blue */
.trade-btn.wolse { background: #f0fdf4; color: #16a34a; } /* Green */

.trade-btn:hover { filter: brightness(0.95); transform: scale(1.02); }

/* [Feed Section] 블로그/리포트 */
.feed-section {
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 20px;
}
.feed-header { 
    margin-bottom: 24px; 
    font-size: 1.4rem; 
    font-weight: 800; 
    display: flex; 
    align-items: center; 
    gap: 10px;
    color: var(--text-main);
}
.feed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.feed-card {
    background: #fff;
    border-radius: var(--radius-m);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: 0.3s;
    cursor: pointer;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.feed-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.feed-img-placeholder {
    width: 100%;
    height: 160px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2.5rem;
}
.feed-content { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.feed-date { font-size: 0.8rem; color: #94a3b8; margin-bottom: 8px; display: block; }
.feed-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; line-height: 1.4; color: #334155; }
.feed-excerpt { font-size: 0.95rem; color: #64748b; line-height: 1.5; margin-bottom: 15px; }
.feed-more { margin-top: auto; font-size: 0.9rem; font-weight: 600; color: var(--primary); }

/* Footer */
footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 60px 0;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.9rem;
}

/* [Responsive] Mobile */
@media (max-width: 850px) {
    .hero-title { font-size: 1.8rem; }
    .bento-container { grid-template-columns: 1fr; margin-top: -40px; }
    .estate-grid { grid-template-columns: 1fr; } /* 모바일에서 1단 */
    .feed-grid { grid-template-columns: 1fr; }
    .trade-links { justify-content: space-between; }
    .population-card { margin-bottom: 0; }
}

/* News Section Styles */
.news-section {
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.news-header {
    margin-bottom: 24px;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

.news-list-container {
    background: var(--surface);
    border-radius: var(--radius-l);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    transition: 0.2s;
}

.news-item:last-child {
    border-bottom: none;
}

.news-item:hover {
    background-color: #f8fafc;
    transform: translateX(5px);
}

.news-item a {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
    margin-right: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-sub);
    white-space: nowrap;
}

/* Mobile Adjustment */
@media (max-width: 850px) {
    .news-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .news-item a {
        margin-right: 0;
        white-space: normal;
        line-height: 1.4;
    }
}