/* ===== 정비사업 - dysul 스타일 ===== */

/* 히어로 헤더 */
.jb-hero {
    background: #f5f5f5; text-align: center;
    padding: 48px 20px 40px;
}
.jb-hero-title {
    font-size: 32px; font-weight: 800; color: #222; margin: 0 0 10px;
}
.jb-hero-breadcrumb {
    font-size: 13px; color: #aaa; margin: 0;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.jb-hero-breadcrumb a { color: #999; text-decoration: none; }
.jb-hero-breadcrumb a:hover { color: #8b6f47; }

/* 시도 탭 네비게이션 */
.jb-nav {
    display: flex; justify-content: center; flex-wrap: wrap;
    gap: 0; border-bottom: 1px solid #e0e0e0;
    background: #fff; padding: 0 20px;
}
.jb-nav-item {
    padding: 14px 22px; font-size: 15px; font-weight: 500;
    color: #666; text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all .15s;
}
.jb-nav-item:hover { color: #333; }
.jb-nav-item.active {
    color: #8b6f47; font-weight: 700;
    border-bottom-color: #8b6f47;
}
@media (max-width: 768px) {
    .jb-nav { gap: 0; padding: 0 10px; }
    .jb-nav-item { padding: 10px 12px; font-size: 13px; }
}

/* 콘텐츠 영역 */
.jb-content {
    max-width: 1200px; margin: 0 auto; padding: 30px 20px 50px;
}

/* 시군구 필터 */
.jb-sg-area {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 6px 18px; padding: 20px 0 28px;
    border-bottom: 1px solid #eee; margin-bottom: 24px;
}
.jb-sg-item {
    font-size: 14px; color: #666; text-decoration: none;
    padding: 6px 14px; border-radius: 20px;
    transition: all .12s;
}
.jb-sg-item:hover { color: #333; background: #f5f5f5; }
.jb-sg-item.active {
    background: #a08b6c; color: #fff;
}

/* 시군구 그룹 구분자 */
.jb-sg-divider {
    width: 100%; text-align: left;
    font-size: 12px; font-weight: 700; color: #8b6f47;
    padding: 8px 0 2px; margin-top: 4px;
    border-top: 1px dashed #e0e0e0;
}
.jb-sg-divider:first-of-type { border-top: none; margin-top: 0; }

/* 검색 바 */
.jb-search-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.jb-count { font-size: 14px; color: #888; }
.jb-count strong { color: #333; font-weight: 700; }
.jb-search-form { display: flex; gap: 6px; }
.jb-search-input {
    padding: 7px 14px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 13px; width: 200px; outline: none;
}
.jb-search-input:focus { border-color: #8b6f47; }
.jb-search-btn {
    padding: 7px 16px; background: #8b6f47; color: #fff;
    border: none; border-radius: 6px; font-size: 13px;
    font-weight: 600; cursor: pointer;
}
.jb-search-btn:hover { background: #7a5f3a; }

/* 카드 그리드 */
.jb-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 900px) { .jb-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .jb-grid { grid-template-columns: 1fr; } }

/* 카드 */
.jb-card {
    background: #f8f8f8; border-radius: 10px;
    padding: 22px 20px; min-height: 80px;
    transition: box-shadow .15s, transform .15s;
    cursor: default;
}
.jb-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.07);
    transform: translateY(-2px);
}
.jb-card-name {
    font-size: 15px; font-weight: 700; color: #222;
    margin-bottom: 6px; line-height: 1.4;
}
.jb-card-meta {
    display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap;
}
.jb-card-type {
    font-size: 11px; font-weight: 600; color: #1a56db;
    background: #e8f0fe; padding: 2px 8px; border-radius: 3px;
}
.jb-card-step {
    font-size: 11px; font-weight: 600; color: #166534;
    background: #dcfce7; padding: 2px 8px; border-radius: 3px;
}
.jb-card-step.completed {
    color: #9a3412; background: #ffedd5;
}
.jb-card-brand {
    font-size: 13px; font-weight: 700; color: #8b6f47;
    margin-bottom: 4px;
}
.jb-card-contractor {
    font-size: 11px; color: #888; margin-top: 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 카드 하단 (위치+세대수+시도) */
.jb-card-bottom {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px; margin-top: 6px;
}
.jb-card-households {
    font-size: 12px; font-weight: 700; color: #8b6f47;
    background: #f5ede0; padding: 2px 8px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.jb-card-loc {
    font-size: 12px; color: #bbb; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; min-width: 0;
}
.jb-card-city {
    font-size: 11px; color: #ccc;
}

/* 진행단계 필터 */
.jb-step-filter {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 16px;
}
.jb-step-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 5px 12px; border-radius: 20px;
    font-size: 12px; color: #666; text-decoration: none;
    border: 1px solid #e0e0e0; background: #fff;
    transition: all .12s; white-space: nowrap;
}
.jb-step-btn:hover { border-color: #8b6f47; color: #8b6f47; }
.jb-step-btn.active { background: #8b6f47; color: #fff; border-color: #8b6f47; }
.jb-step-cnt {
    font-size: 11px; opacity: .75;
}

/* 빈 상태 */
.jb-empty {
    text-align: center; padding: 80px 20px; color: #aaa; font-size: 15px;
}
.jb-empty-sub { font-size: 13px; color: #ccc; margin-top: 8px; }

/* 카드 커서 */
.jb-card { cursor: pointer; }

/* 페이지네이션 */
.jb-content .paging_wrap { margin-top: 30px; }

/* ===== 정비사업 상세 팝업 ===== */
.jbd-overlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
    justify-content: center; align-items: flex-start;
    padding: 40px 16px; overflow-y: auto;
}
.jbd-overlay.show { display: flex; }

.jbd-popup {
    background: #fff; border-radius: 16px;
    width: 100%; max-width: 860px; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    animation: jbdSlideUp .25s ease;
}
@keyframes jbdSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.jbd-close {
    position: absolute; top: 16px; right: 16px; z-index: 1;
    width: 36px; height: 36px; border-radius: 50%;
    border: none; background: #f0f0f0; color: #666;
    font-size: 22px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.jbd-close:hover { background: #e0e0e0; color: #333; }

.jbd-loading {
    text-align: center; padding: 60px; color: #999; font-size: 14px;
}

.jbd-content { padding: 0; }

/* 상단 헤더 */
.jbd-header {
    padding: 32px 32px 20px;
    border-bottom: 3px solid #333;
}
.jbd-title {
    font-size: 22px; font-weight: 800; color: #222;
    margin: 0 0 6px; line-height: 1.3;
}
.jbd-city {
    font-size: 13px; color: #999;
}

/* 이미지 + 정보 레이아웃 */
.jbd-detail-layout {
    display: flex; gap: 24px;
    padding: 24px 32px;
    align-items: flex-start;
}
.jbd-img-wrap {
    flex-shrink: 0; width: 320px;
    border-radius: 10px; overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 4 / 3;
}
.jbd-img {
    width: 100%; height: 100%; display: block;
    object-fit: cover;
    transform-origin: center center;
    animation: jbdKenBurns 18s ease-in-out infinite alternate;
    will-change: transform;
}

/* Ken Burns 줌/팬 효과 (사진이 서서히 확대·이동) */
@keyframes jbdKenBurns {
    0%   { transform: scale(1.02) translate(0, 0); }
    25%  { transform: scale(1.10) translate(-2%, -1%); }
    50%  { transform: scale(1.15) translate(-3%, -2%); }
    75%  { transform: scale(1.10) translate(-1%, -3%); }
    100% { transform: scale(1.08) translate(1%, -1%); }
}

/* 모션 감소 환경(접근성) 존중 */
@media (prefers-reduced-motion: reduce) {
    .jbd-img { animation: none; transform: none; }
}

/* 기본 정보 그리드 */
.jbd-info-section {
    padding: 0; flex: 1;
}
.jbd-info-grid {
    display: flex; flex-direction: column; gap: 14px;
}
.jbd-info-item {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 14px; line-height: 1.5;
}
.jbd-info-dot {
    flex-shrink: 0; width: 8px; height: 8px;
    border-radius: 50%; background: #8b6f47;
    margin-top: 6px;
}
.jbd-info-label {
    color: #555; font-weight: 600; white-space: nowrap;
}
.jbd-info-value {
    color: #222; font-weight: 500;
}
.jbd-na {
    color: #aaa; font-weight: 400; font-style: normal;
    font-size: 13px;
}

/* 진행단계 섹션 */
.jbd-step-section {
    padding: 24px 32px; border-top: 1px solid #f0f0f0;
}
.jbd-section-title {
    font-size: 18px; font-weight: 800; color: #222;
    margin: 0 0 16px;
}

/* 프로그레스 바 */
.jbd-progress-bar {
    position: relative; height: 28px;
    background: #eee; border-radius: 14px;
    margin-bottom: 24px; overflow: hidden;
}
.jbd-progress-fill {
    height: 100%; border-radius: 14px;
    background: linear-gradient(90deg, #8b6f47, #c4a265);
    transition: width .6s ease;
}
.jbd-progress-text {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    font-size: 12px; font-weight: 700; color: #fff;
}

/* 단계 타임라인 */
.jbd-steps {
    display: flex; flex-wrap: wrap; gap: 0;
    position: relative;
}
.jbd-step-item {
    flex: 1; min-width: 70px; text-align: center;
    position: relative; padding-top: 20px;
}
.jbd-step-item::before {
    content: ''; position: absolute; top: 7px;
    left: 0; right: 0; height: 2px;
    background: #e0e0e0;
}
.jbd-step-item:first-child::before { left: 50%; }
.jbd-step-item:last-child::before { right: 50%; }
.jbd-step-item.done::before,
.jbd-step-item.current::before { background: #8b6f47; }

.jbd-step-dot {
    width: 16px; height: 16px; border-radius: 50%;
    background: #e0e0e0; border: 2px solid #e0e0e0;
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%); z-index: 1;
}
.jbd-step-item.done .jbd-step-dot {
    background: #8b6f47; border-color: #8b6f47;
}
.jbd-step-item.current .jbd-step-dot {
    background: #fff; border-color: #8b6f47;
    box-shadow: 0 0 0 3px rgba(139,111,71,.3);
}

.jbd-step-name {
    font-size: 10px; color: #bbb; margin-top: 4px;
    line-height: 1.2; word-break: keep-all;
}
.jbd-step-item.done .jbd-step-name { color: #8b6f47; font-weight: 600; }
.jbd-step-item.current .jbd-step-name { color: #8b6f47; font-weight: 700; }

/* 위치 정보 */
.jbd-location-section {
    padding: 24px 32px 32px; border-top: 1px solid #f0f0f0;
}
.jbd-loc-text {
    font-size: 14px; color: #555; margin: 0;
    background: #f9f9f9; padding: 14px 16px; border-radius: 8px;
}

/* 이미지 없을 때 정보 섹션 패딩 */
.jbd-detail-layout:not(:has(.jbd-img-wrap[style*="block"])) .jbd-info-section {
    padding-left: 0;
}

/* 반응형 */
@media (max-width: 600px) {
    .jbd-overlay { padding: 20px 10px; }
    .jbd-popup { border-radius: 12px; }
    .jbd-header { padding: 24px 20px 16px; }
    .jbd-title { font-size: 18px; }
    .jbd-detail-layout {
        flex-direction: column; padding: 20px;
    }
    .jbd-img-wrap { width: 100%; aspect-ratio: 16 / 9; }
    .jbd-img { width: 100%; height: 100%; object-fit: cover; }
    .jbd-info-section { padding: 16px 0 0 0; }
    .jbd-step-section,
    .jbd-location-section { padding-left: 20px; padding-right: 20px; }
    .jbd-step-item { min-width: 50px; }
    .jbd-step-name { font-size: 9px; }
}
