/* ── 1. 기본 초기화 ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Malgun Gothic', '맑은 고딕', sans-serif; background: #f3f3f3; font-size: 14px; color: #222; line-height: 1.5; }

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── 2. 헤더 (로고 & 햄버거) ── */
.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    background-color: white;
    padding-right: 20px;
    position: relative;
}
.logo-area img { height: 48px; display: block; }

.top-util { display: flex; gap: 12px; }
.top-util a { font-size: 12px; color: #555; text-decoration: none; }
.top-util a.orange { color: #e07000; font-weight: 700; }

/* ── 3. 햄버거 버튼 & 애니메이션 ── */
.hamburger-btn {
    display: none; 
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 30px; height: 30px;
    background: none; border: none;
    cursor: pointer; padding: 0;
    z-index: 1001;
}
.hamburger-btn span {
    display: block;
    width: 24px; height: 2px;
    background: #1a3a6b;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── 4. 그린 메뉴바 & 내비 ── */
.header-banner-group { margin-bottom: 10px; }
header { 
    background: #26734d; 
    color: white; 
    padding: 5px 0; 
    font-weight: bold; 
}
.main-nav {
    display: flex;
    width: 100%;
    justify-content: flex-start; /* [수정] 왼쪽 정렬 고정 */
    list-style: none;
    gap: 25px; /* 항목 간 간격 - PC 기준 */
    padding-left: 25px;
}

.main-nav li {
    flex-shrink: 0;
    white-space: nowrap;
}

.main-nav li a {
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    padding: 10px 0;
    display: block;
}

/* ── 5. 콘텐츠 레이아웃 & 사이드바 (수정됨) ── */
.contents-wrap { 
    display: grid; 
    grid-template-columns: 200px 1fr; 
    gap: 15px; 
    padding: 0 10px; 
    align-items: start; 
}

.sidebar { display: flex; flex-direction: column; gap: 10px; }
.sidebar .sidebar-close { text-align: right; padding-right: 10px; display: none; margin-bottom: 10px; }
.side-box { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 12px; font-size: 12px; color: #555; line-height: 1.8; }

/* 사이드바 리스트 스타일 통합 */
.side-menu-box .side-menu-list, 
.side-menu-box .side-submenu-list { background: #fff; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.side-menu-box-tween { height: 0px; display: none; }

/* 두 리스트 모두 동일한 여백과 선이 적용되도록 수정 */
.side-menu-list li a,
.side-submenu-list li a { 
    display: block; padding: 7px 12px; font-size: 12px; 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; }

.board-title { background: #1a3a6b; color: #fff; padding: 8px 14px; font-size: 13px; font-weight: 700; border-radius: 10px 10px 0 0; }

/* ── 6. 게시판 목록 (통합 및 14px 수정) ── */
.post-list a { text-decoration: none; }

.post-list li { 
    display: flex !important;           /* 강제로 가로 배치 유지 */
    flex-direction: row !important;     /* 세로로 바뀌는 것 방지 */
    justify-content: space-between; 
    align-items: center; 
    padding: 10px 14px; 
    border-bottom: 1px solid #cdcdcd; 
    gap: 10px; 
    min-width: 0;
    transition: background-color 0.2s ease;
}

.post-list li:hover { 
    background-color: #f0f4f8 !important; /* 마우스 올렸을 때 바탕색 */
}

.post-list li:nth-child(even) { background-color: #e0ebeb; }

.post-list .subject { 
    font-size: 14px;         /* 요청하신 대로 14px로 고정 */
    color: #222; 
    flex: 1;                 /* 남은 공간 다 차지 */
    min-width: 0;            /* flex 공간 내에서 줄어들 수 있게 함 */
    white-space: nowrap;     /* 한 줄 유지 */
    overflow: hidden;        /* 넘치는 글자 숨김 */
    text-overflow: ellipsis; /* 끝부분 ... 처리 */
    display: block;
}

.post-list span:last-child { 
    font-size: 13px; color: #666; 
    white-space: nowrap;    /* 날짜 줄바꿈 방지 */
    flex-shrink: 0;         /* 날짜 영역이 작아지지 않게 고정 */
    text-align: right;
    min-width: 75px;        /* 날짜가 들어갈 최소 공간 확보 */
}

/* 게시물 본문 읽기 */
.post-header { padding: 15px; border-bottom: 0; background: #fcfcfc; }
.post-read { padding: 10px; line-height: 1.8; overflow-x: auto; word-break: break-word; border:1px solid #f1f1f1; }
.post-read img { max-width: 100% !important; height: auto !important; }

/* ── 페이지네이션 & 푸터 ── */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 16px 0; }
.pagination a { display: inline-block; padding: 5px 10px; border: 1px solid #ddd; border-radius: 4px; 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; margin-top: auto; font-size: 12px; }

/* ── 반응형 (모바일 최적화) ── */
@media (max-width: 768px) {
    .sidebar .sidebar-close { width: 100%; display: block; text-align: right; padding-right: 10px; }
    .hamburger-btn { display: flex; } 
    .top-util { display: none; } 
    .contents-wrap { grid-template-columns: 1fr; }
    .sidebar {
        display: block; position: fixed;
        top: 0; left: -270px;
        width: 260px; height: 100%;
        background: #fff; z-index: 1000; padding: 20px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        transition: left 0.3s ease-in-out;
    }
    .sidebar.open { left: 0; }
    .side-menu-box-tween { height: 10px; display: block; }

    /* 모바일 메인 내비 왼쪽 정렬 유지 및 간격 조정 */
    .main-nav {
        justify-content: flex-start;
        gap: 15px; /* 모바일에서는 간격을 조금 좁힘 */
        padding: 0 5px;
        font-size: 12px;
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .main-nav li a { font-size: 12px; }

    .side-menu-box {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    header { padding-left: 25px; }
    .header-top-row { padding: 10px; }
    .logo-area img { height: 36px; }
    /* 모바일 가로 공간 부족 대비 */
    .post-list .subject { width: 28ch; } 
}