/* ==================================== */
/* 0. 공통 레이아웃 및 배경 설정 */
/* ==================================== */
html, body { 
    height: 100%; 
    margin: 0;
    padding: 0;
}

.sub-page-body {
    background-image: url('../images/sub1_bg.png') !important; 
    background-repeat: no-repeat !important;
    background-position: center top !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    background-color: #f4f7fa !important; 
    font-family: 'S-CoreDream', 'Noto Sans KR', sans-serif;
    color: #333;
    line-height: 1.8;
}

#wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
}

/* ==================================== */
/* 1. 네비게이션 공통 스타일 */
/* ==================================== */
#sub-header { width: 100%; }
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 10px;
    padding: 25px 25px;
    display: flex;
    justify-content: space-between; 
    align-items: center;
}
.logo img { height: auto; display: block; }
.main-nav { flex-grow: 1; display: flex; justify-content: center; }
.main-nav ul { list-style: none; display: flex; gap: 60px; margin: 0; padding: 0; }
.main-nav a {
    color: #292929; font-size: 19px; font-weight: 800; text-decoration: none; letter-spacing: -1px;
    padding: 10px 0; position: relative;
}
.main-nav a:hover { color: #2c5ddb; }
.main-nav a::after {
    content: ''; position: absolute; left: 0; bottom: -25px; 
    width: 0; height: 3px; background-color: #2c5ddb; 
    transition: width 0.3s ease;
}
.main-nav a:hover::after { width: 100%; }
.nav-divider {
    width: 1200px; max-width: 100%; height: 1px;
    background-color: rgba(143, 152, 175, 0.4); margin: 0 auto;
}
.jump-menu { padding: 8px 10px; border: 1px solid #ccc; border-radius: 5px; cursor: pointer; }

/* ==================================== */
/* 2. 메인 콘텐츠 스타일 (레터 상세 페이지) */
/* ==================================== */
#sub-main-content {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 80px 20px;
}
.sub-content-area { max-width: 1200px; width: 100%; text-align: center; }

.campaign-message { 
    margin-top: -30px;
    margin-bottom: 50px;
    font-size: 17px;
    letter-spacing: -1px;
}

.detail-page .campaign-message h2 {
    font-size: 14pt !important;
    font-weight: 400 !important;
    margin-top: -35px;
    margin-bottom: 2px;
}
.detail-page .campaign-message p {
    font-size: 15pt !important;
    font-weight: 700 !important;
    line-height: 1.8;
    margin-top: 0px;
    margin-bottom: -20px;
}

/* ★ 핵심: 컨테이너 너비를 이미지 너비에 고정 ★ */
.campaign-content-wrapper {
    display: inline-block; 
    max-width: 100%;
    position: relative;
    text-align: center;
}

.campaign-detail-img { margin-bottom: 15px; }
.campaign-detail-img img { 
    display: block; 
    max-width: 100%; 
    height: auto; 
}

/* ★ 하단 버튼 레이아웃 ★ */
.btn-container { 
    width: 100%; 
    display: flex; 
    align-items: center; 
    position: relative; 
    margin-top: 20px;
    min-height: 40px;
}

.pagination-dots {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1;
}

.dot-btn {
    display: block;
    width: 30px;
    height: 10px;
    background-color: #d1d8e5;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.dot-btn:hover { background-color: #2c5ddb; opacity: 0.7; }
.dot-btn.active {
    width: 50px; 
    background-color: #2c5ddb;
}

.back-link {
    margin-left: auto; 
    display: inline-block;
    transition: opacity 0.2s ease;
    z-index: 5;
}

.back-link:hover { opacity: 0.8; }
.back-link img {
    display: block;
    max-width: 180px; 
    height: auto;
}

/* ==================================== */
/* 3. 푸터 스타일 */
/* ==================================== */
#footer { background-color: #dcdcdc; padding: 40px 0; width: 100%; }
.footer-content {
    max-width: 1200px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center; padding: 0 20px;
}
.footer-logo { height: 40px; }
.footer-text p { font-size: 14px; color: #555; margin: 5px 0; }
.footer-right { display: flex; gap: 15px; }

/* ==================================== */
/* 4. 모바일 반응형 수정 (수정됨) */
/* ==================================== */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 15px; }
    .main-nav ul { gap: 25px; }
    .jump-menu-container { display: none; }

    .campaign-content-wrapper { display: block; } 
    
    .btn-container {
        flex-direction: column; 
        gap: 20px;
    }
    
    .pagination-dots {
        position: static; 
        transform: none;
        order: 1;
    }
    
    /* [수정] 모바일에서 menu.png 버튼 숨김 */
    .back-link {
        display: none !important;
    }

    /* [추가] 페이지별 레터 이미지 모바일용으로 교체 */
    /* sub_2_1.html의 이미지가 sub2_letter01.png일 때 */
    .campaign-detail-img img[src*="sub2_letter01.png"] {
        content: url('../images/sub2_letter01_m.png');
    }
    /* sub_2_2.html의 이미지가 sub2_letter02.png일 때 */
    .campaign-detail-img img[src*="sub2_letter02.png"] {
        content: url('../images/sub2_letter02_m.png');
    }
    /* sub_2_3.html의 이미지가 sub2_letter03.png일 때 */
    .campaign-detail-img img[src*="sub2_letter03.png"] {
        content: url('../images/sub2_letter03_m.png');
    }

    .campaign-detail-img img[src*="sub2_letter04.png"] {
        content: url('../images/sub2_letter04_m.png');
    }

    .campaign-detail-img img[src*="sub2_letter05.png"] {
        content: url('../images/sub2_letter05_m.png');
    }
}