/* 1. 기본 초기화 및 공통 스타일 */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
    background: #f3f3f3;
    font-size: 14px;
    color: #222;
}

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0;
    background-color: #fff;
}

/* 2. 헤더 및 배너 영역 */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 10px 0;
    flex-wrap: wrap;
    gap: 8px;
    background-color: white;
}

.logo-area img { height: 48px; }

.top-util { display: flex; gap: 12px; flex-wrap: wrap; }
.top-util a {
    font-size: 12px;
    color: #555;
    text-decoration: none;
}
.top-util a.orange { color: #e07000; font-weight: 700; }
.top-util a:hover { color: #1a3a6b; }

.header-banner-container {
    grid-column: 1 / -1;
    line-height: 0;
    overflow: hidden;
    border-radius: 0 0 8px 8px;
    border: 0; 
    border-top: none;
}

.header-banner-container img {
    width: 100%;
    display: block;
    margin: 0;
    padding: 0;
}

/* 3. 내비게이션 */
.header-banner-group header {
    background: #26734d;
    margin-bottom: 12px;
    color: white;
    padding: 10px 0;
    font-weight: bold;
}

.main-nav {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.main-nav li a {
    display: block;
    padding: 10px 18px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 15px;
}

.main-nav li a:hover { color: #c8a951; }

/* 4. 콘텐츠 레이아웃 (PC 기준) */
.contents-wrap {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 14px;
    align-items: start;
    padding: 0 10px 10px 10px;
}

/* 5. 사이드바 */
.sidebar { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
    width: 200px; /* 명시적으로 200px 고정 */
}


.side-box, .side-menu-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.side-box {
    padding: 12px;
    font-size: 12px;
    color: #555;
    line-height: 1.8;
}

.side-menu-list, .side-submenu-list { list-style: none; }

.side-menu-list li a, .side-submenu-list li a {
    display: block;
    padding: 12px 15px; /* 확장된 패딩으로 통합 */
    font-size: 13px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.side-menu-list li:last-child a, .side-submenu-list li:last-child a { border-bottom: none; }

.side-menu-list li a:hover, .side-submenu-list li a:hover { 
    background: #f7f5f0; 
    color: #1a3a6b; 
}

/* 6. 메인 게시판 및 리스트 */
.board-section { min-width: 0; }

.board-item, .board-list {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.board-title {
    background: #1a3a6b;
    color: #fff;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
}

.post-header {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.post-subject {
    font-size: 14px;
    font-weight: 700;
    color: #1a3a6b;
    margin-bottom: 6px;
}

.post-info { 
    display: flex; 
    flex-direction: row; 
    flex-wrap: nowrap;     /* [수정] 절대 줄바꿈 하지 않음 */
    gap: 10px;            /* [조절] 간격을 살짝 줄여 공간 확보 */
    font-size: 12px;      /* [조절] 모바일 가독성을 위해 살짝 축소 */
    color: #666;
    white-space: nowrap;  /* [추가] 전체 행 줄바꿈 방지 */
}
.post-info span {
    display: flex;
    align-items: center;
    white-space: nowrap;  /* 글자가 중간에 끊겨서 줄바꿈되지 않도록 설정 */
    flex-shrink: 0;       /* [추가] 항목이 찌그러지지 않게 보호 */
}
.post-info b {
    margin-right: 4px;   /* 이모지와 텍스트 사이 간격 */
}

.post-read {
    padding: 14px;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}

.post-list { list-style: none; }

.post-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid #eee; /* 구분선 색상 통일 */
    gap: 8px;
}

/* 짝수 배경색 및 Active 상태 */
.post-list li:nth-child(even) { background-color: #f9fbfb; }
.post-list li.activeClass {
    border-left: 3px solid green !important;
    background-color: #ffffe6 !important;
    font-weight: bold;
}

.post-list li:last-child { border-bottom: none; }

.post-list .subject {
    font-size: 13px;
    color: #222;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-list a { text-decoration: none; flex: 1; min-width: 0; display: flex; }
.post-list a:hover .subject { color: #1a3a6b; text-decoration: underline; }

.post-list span:last-child {
    font-size: 13px;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 7. 기타 요소 (첨부파일, 페이지네이션, 푸터) */
.attached-file ul { list-style: none; margin-bottom: 10px; }
.attached-file ul li { padding: 3px 0; border-bottom: 1px dashed #e5e5e5; }
.attached-file a { text-decoration: none; color: #5211f7; font-size: 14px; font-weight: bold; }

.pagination { display: flex; justify-content: center; gap: 4px; margin-bottom: 16px; }
.pagination a { 
    display: inline-block; padding: 5px 10px; border: 1px solid #ddd; 
    border-radius: 4px; font-size: 13px; text-decoration: none; background: #fff; 
}
.pagination a.active { background: #1a3a6b; color: #fff; border-color: #1a3a6b; font-weight: 700; }

.footer {
    background: #1a3a6b;
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 16px;
    border-radius: 0 0 6px 6px;
    margin-top: 16px;
    font-size: 12px;
    line-height: 1.8;
}

/* 8. 모바일 인터페이스 (햄버거 메뉴 등) */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a3a6b;
    transition: all 0.3s ease;
}

.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 99;
}
.sidebar-overlay.open { display: block; }
.sidebar-close { display: none; width: 100%; margin-bottom: 10px; }

/* 9. 통합 반응형 미디어 쿼리 (768px 이하) */
@media (max-width: 768px) {
    .top-util { display: none; }
    .hamburger-btn { display: flex; }
    
    .contents-wrap {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 10px;
    }

    .sidebar {
        display: block !important;
        position: fixed;
        top: 0; left: -270px;
        width: 260px; height: 100%;
        background: #fff;
        z-index: 1000;
        padding: 15px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease;
    }
    .sidebar.open { left: 0 !important; }
    .sidebar-close { display: block; text-align: right; padding-right: 15px;}

    .board-item, .board-list { border-left: none; border-right: none; border-radius: 0; }
    .board-title { border-radius: 0; padding: 10px 15px; }
    .post-list li { padding: 8px 6px; }
    .main-nav li a { padding: 8px 12px; font-size: 13px; }
    .board-section { padding: 0px 10px; }
    .board-item { border:1px solid #ededed; }
}

/* 10. 소형 모바일 최적화 (480px 이하) */
@media (max-width: 480px) {
    .post-list li { flex-direction: row !important; }
    .board-list .subject { max-width: 36ch; }
    .post-list span:last-child { font-size: 12px; }
}

@media (max-width: 400px) {
    .board-list .subject { max-width: 36ch; } /* 아주 작은 화면 대응 */
}