/* 공통 스타일 */
body {
    font-family: 'Malgun Gothic', 'Dotum', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    font-size: 14px;
}

.container {
    max-width: 1100px;
    margin: 15px auto;
    background: #fff;
    padding: 20px;
    border: 1px solid #dcdcdc;
}

/* 헤더 & 네비게이션 */
header {
    border-bottom: 2px solid #222;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

header h1 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #111;
    font-weight: bold;
}

nav {
    display: flex;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: 2px solid #0056b3;
}

nav a {
    text-decoration: none;
    color: #444;
    font-weight: bold;
    font-size: 14px;
    padding: 10px 18px;
    border-right: 1px solid #ddd;
    transition: background 0.1s;
}

nav a:hover, nav a.active {
    background-color: #0056b3;
    color: #fff;
}

/* 광고 박스 */
.adz-box {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    color: #777;
    margin: 15px 0;
}

/* 메인 레이아웃 (본문 + 사이드바) */
.main-layout {
    display: flex;
    gap: 20px;
}

.content {
    flex: 3;
}

.sidebar {
    flex: 1;
}

/* 게시판 헤더 & 글쓰기 버튼 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #333;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.board-header h2 {
    margin: 0;
    font-size: 16px;
    color: #222;
    font-weight: bold;
}

.btn {
    display: inline-block;
    padding: 5px 12px;
    background: #333;
    color: #fff;
    text-decoration: none;
    border-radius: 2px;
    font-size: 13px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #000;
}

.btn-secondary {
    background: #6c757d;
}
.btn-secondary:hover {
    background: #5a6268;
}

/* 게시글 목록 스타일 (밀도감 있는 리스트) */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid #ddd;
}

.post-item {
    border-bottom: 1px solid #eaeaea;
    padding: 10px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-item:hover {
    background-color: #fdfdfd;
}

.post-item a {
    text-decoration: none;
    color: #222;
    font-size: 14px;
}

.post-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.post-date {
    color: #888;
    font-size: 12px;
}

/* 글쓰기 및 상세 페이지 폼 스타일 */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 2px;
    box-sizing: border-box;
    font-size: 14px;
}

.form-control:focus {
    border-color: #0056b3;
    outline: none;
}

.editor {
    width: 100%;
    min-height: 350px;
    border: 1px solid #ccc;
    border-radius: 2px;
    padding: 12px;
    box-sizing: border-box;
    background: #fff;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
}

.editor:focus {
    border-color: #0056b3;
    outline: none;
}

.editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
}

/* 상세 페이지 */
.post-view-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.post-view-header h1 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #111;
}

.post-view-info {
    color: #666;
    font-size: 12px;
}

.post-view-content {
    min-height: 200px;
    line-height: 1.6;
    font-size: 14px;
    word-break: break-all;
}

.post-view-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
}

.btn-group {
    margin-top: 25px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
}

/* 푸터 스타일 */
footer {
    margin-top: 40px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
    text-align: center;
    color: #777;
    font-size: 12px;
    line-height: 1.5;
}

/* 페이징 네비게이션 (깔끔한 버튼 스타일) */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 30px 0 10px 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #dcdcdc;
    background-color: #fff;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 3px;
    box-sizing: border-box;
    transition: all 0.15s ease-in-out;
}

.pagination a:hover {
    border-color: #0056b3;
    color: #0056b3;
    background-color: #f0f7ff;
}

.pagination .active {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #fff;
    font-weight: bold;
    cursor: default;
}

/* 모바일 반응형 설정 (화면 너비 768px 이하일 때) */
@media screen and (max-width: 768px) {
    body {
        background-color: #fff; /* 모바일에선 배경을 깔끔하게 흰색으로 */
    }

    .container {
        margin: 0;
        padding: 10px;
        border: none;
        box-shadow: none;
    }

    header h1 {
        font-size: 20px;
        text-align: center;
    }

    /* 네비게이션 메뉴가 모바일에서 자연스럽게 줄바꿈되도록 */
    nav {
        flex-wrap: wrap;
    }

    nav a {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 10px;
        font-size: 13px;
    }

    /* 본문과 사이드바를 세로로 쌓기 (사이드바를 아래로 내림) */
    .main-layout {
        flex-direction: column;
        gap: 15px;
    }

    .sidebar {
        width: 100%;
    }

    /* 글쓰기/수정 폼 모바일 맞춤 */
    .editor {
        min-height: 250px;
    }
}


/* 게시판 본문 내부 테이블 및 리스트 디자인 살리기 */
.post-view-content table, .board-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}
.post-view-content th, .post-view-content td,
.board-content th, .board-content td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}
.post-view-content th, .board-content th {
    background-color: #f8f9fa;
}
.post-view-content ul, .post-view-content ol {
    padding-left: 20px;
    margin: 10px 0;
}
.post-view-content li {
    margin: 5px 0;
}