* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; background: #f3f3f3; color: #222; font-size: 14px; line-height: 1.6; }

.container { max-width: 1160px; margin: 0 auto; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,0.1); }

/* 헤더 */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}
.logo-area img { height: 45px; }
.top-util { display: flex; gap: 12px; font-size: 12px; color: #555; flex-wrap: wrap; align-items: center; }
.top-util a { text-decoration: none; color: inherit; }
.top-util a.orange { color: #e07000; font-weight: 700; }
.top-util a:hover { color: #1a3a6b; }

.header-banner-group header { background: #769741; color: white; padding: 12px 20px; font-weight: bold; margin-bottom: 0; }
.header-banner-container { line-height: 0; border-bottom: 1px solid #ddd; margin-bottom: 10px; }
.header-banner-container img { width: 100%; height: auto; display: block; }

/* 레이아웃 */
.contents-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 20px; align-items: start; }

/* 사이드바 */
.sidebar { display: flex; flex-direction: column; gap: 15px; }
.side-box { border: 1px solid #ddd; padding: 15px; text-align: center; border-radius: 5px; background: #fff; }
.side-menu-box { border: 1px solid #ddd; border-top: 3px solid #769741; border-radius: 0 0 5px 5px; overflow: hidden; }
.side-menu-list { list-style: none; }
.side-menu-list li a { display: block; padding: 10px 15px; text-decoration: none; color: #333; border-bottom: 1px solid #eee; font-size: 13px; }
.side-menu-list li a:hover { background: #f0f4f0; color: #769741; }

/* 닫기 버튼 (PC 숨김) */
.sidebar-close {
    display: none;
    width: 100%;
    padding: 10px 12px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 13px;
    text-align: right;
    color: #555;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* 햄버거 버튼 (PC 숨김) */
.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;
    border-radius: 2px;
    transition: all 0.3s;
}
.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; }

/* 게시판 본문 */
.board-section { min-width: 0; }
.board-item { border: 1px solid #ddd; border-radius: 8px; margin-bottom: 20px; overflow: hidden; background: #fff; }
.board-title { background: #769741; color: #fff; padding: 8px 14px; font-size: 13px; font-weight: 700; }
.post-header { padding: 15px; border-bottom: 1px solid #eee; background: #fcfcfc; }
.post-subject { font-size: 16px; font-weight: bold; color: #1a3a6b; margin-bottom: 8px; word-break: break-word; }
.post-info { display: flex; gap: 15px; font-size: 12px; color: #777; flex-wrap: wrap; }
.post-read { padding: 20px; line-height: 1.8; overflow-x: auto; word-break: break-word; }
.post-read img { max-width: 100% !important; height: auto !important; }

/* 첨부파일 */
.attached-file { background: #f4f4f4; padding: 10px 15px; font-size: 0.9em; margin-bottom: 12px; border-radius: 4px; }
.attached-file ul { list-style: none; margin-top: 6px; }
.attached-file ul li { padding: 3px 0; }
.attached-file a { color: #1a3a6b; text-decoration: none; }
.attached-file a:hover { text-decoration: underline; }

/* 댓글 */
.comment-list-container { background: #fff; border-top: 1px solid #769741; border-bottom: 1px solid #769741; margin-top: 10px; }
.comment-item { padding: 10px 15px; border-bottom: 1px solid #eee; font-size: 13px; }

/* 검색 */
.search-box { text-align: right; margin: 20px 0; }
.search-box form { display: flex; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.search-box input { padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.search-box button { padding: 6px 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }

/* 게시판 목록 */
.board-list { border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.post-list { list-style: none; }
.post-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 15px; border-bottom: 1px solid #eee; gap: 10px; }
.post-list li:last-child { border-bottom: none; }
.post-list li:nth-child(even) { background: #f8faf9; }
.post-list li:hover { background: #f0f4f0; }
.post-list a { flex: 1; text-decoration: none; color: #333; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.post-list a:hover { color: #769741; }
.post-list span { font-size: 12px; color: #888; white-space: nowrap; }

/* 페이지네이션 */
.pagination { display: flex; justify-content: center; gap: 5px; margin: 20px 0; flex-wrap: wrap; }
.pagination a { padding: 6px 12px; border: 1px solid #ddd; text-decoration: none; color: #333; border-radius: 4px; font-size: 13px; }
.pagination a:hover { background: #f0f4f0; color: #769741; }
.pagination a.active { background: #769741; color: #fff; border-color: #769741; }

/* 푸터 */
.footer { margin-top: 50px; border-top: 1px solid #eee; padding: 20px; text-align: center; color: #888; font-size: 0.85em; }

/* ── 반응형 ── */
@media (max-width: 768px) {
    .top-util { display: none; }
    .hamburger-btn { display: flex; }
    .sidebar-close { display: block; }
    .contents-wrap { grid-template-columns: 1fr; padding: 12px; gap: 12px; }

    .sidebar {
        display: block !important;
        position: fixed;
        top: 0; left: -270px;
        width: 260px;
        height: 100%;
        background: #fff;
        z-index: 100;
        overflow-y: auto;
        padding: 15px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease;
    }
    .sidebar.open { left: 0; }

    .post-subject { font-size: 15px; }
    .post-info { flex-direction: column; gap: 4px; }
    .post-read { padding: 14px; font-size: 13px; }
    .search-box form { justify-content: flex-start; }
    .search-box input { flex: 1; }
}

@media (max-width: 480px) {
    .header-top-row { padding: 10px; }
    .logo-area img { height: 36px; }
    .post-list li { flex-direction: column; align-items: flex-start; gap: 3px; }
    .post-list a { white-space: normal; word-break: break-word; }
    .pagination a { padding: 5px 9px; font-size: 12px; }
    .search-box button { width: 100%; }
}