/* 전체 공통 설정 및 텍스트 삐침 완벽 방어 */
*, *::before, *::after {
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: break-word;
}

body {
    font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f7f5f0;
    color: #3e3832;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.container {
    max-width: 1100px;
    margin: 20px auto;
    background: #ffffff;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(62, 56, 50, 0.04);
    width: 100%;
    overflow: hidden;
}

/* 헤더 & 브랜딩 (중앙정렬 원천 차단) */
header {
    border-bottom: 1px solid #eee9e0;
    padding-bottom: 18px;
    margin-bottom: 20px;
    text-align: left;
}

header h1 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 800;
    color: #2c2520;
    letter-spacing: -0.5px;
    text-align: left;
    white-space: normal; /* 한 줄 고정 풀어서 삐침 방지 */
}

header h1 a {
    text-decoration: none;
    color: #2c2520;
    display: inline-block;
    max-width: 100%;
}

/* 네비게이션 탭 */
nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f2eee3;
    padding: 8px;
    border-radius: 12px;
    margin-bottom: 25px;
}

nav a {
    text-decoration: none;
    color: #6e6358;
    font-weight: 600;
    font-size: 13.5px;
    padding: 9px 15px;
    border-radius: 8px;
    transition: all 0.2s ease;
    text-align: center;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.6);
    color: #2c2520;
}

nav a.active {
    background-color: #ffffff;
    color: #8c6d53;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* 광고 박스 */
.adz-box {
    background: #faf8f5;
    border: 1px dashed #dcd4cc;
    padding: 14px;
    text-align: left;
    font-size: 13px;
    color: #9c9084;
    margin: 15px 0;
    border-radius: 10px;
}

/* 메인 레이아웃 */
.main-layout {
    display: flex;
    gap: 25px;
    width: 100%;
}

.content {
    flex: 3;
    min-width: 0;
    overflow: hidden;
}

.sidebar {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* 게시판 헤더 & 버튼 */
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2c2520;
}

.board-header h2 {
    margin: 0;
    font-size: 17px;
    color: #2c2520;
    font-weight: 700;
    text-align: left;
}

.btn {
    display: inline-block;
    padding: 7px 14px;
    background: #5c4a3d;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #3e3328;
}

.btn-secondary {
    background: #b5aba1;
}
.btn-secondary:hover {
    background: #988e84;
}

/* 게시글 목록 */
.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.post-item {
    background: #fcfbf9;
    border: 1px solid #f0ece4;
    padding: 12px 14px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    width: 100%;
    transition: all 0.15s ease;
}

.post-item a {
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: #3e3832;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

.post-item a:hover {
    color: #8c6d53;
}

.post-date {
    color: #b5aba1;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 2px;
}

/* 사이드바 위젯 */
.sidebar > div {
    background: #fcfbf9 !important;
    border: 1px solid #f0ece4 !important;
    border-radius: 12px !important;
    padding: 18px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    width: 100% !important;
}

.sidebar ul li a {
    transition: color 0.15s;
    text-align: left;
}

.sidebar ul li a:hover {
    color: #8c6d53 !important;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 11px;
    border: 1px solid #dcd4cc;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fcfbf9;
    text-align: left;
}

.form-control:focus {
    border-color: #8c6d53;
    background-color: #fff;
    outline: none;
}

.editor {
    width: 100%;
    min-height: 350px;
    border: 1px solid #dcd4cc;
    border-radius: 8px;
    padding: 14px;
    background: #fcfbf9;
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
    text-align: left;
}

.editor:focus {
    border-color: #8c6d53;
    background-color: #fff;
    outline: none;
}

.editor img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 12px 0;
    border-radius: 6px;
}

/* 상세 페이지 헤더 및 타이틀 */
.post-view-header {
    border-bottom: 1px solid #f0ece4;
    padding-bottom: 18px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    text-align: left;
}

.post-view-header h1 {
    margin: 0 0 8px 0;
    font-size: 21px;
    color: #2c2520;
    font-weight: 700;
    text-align: left;
    width: 100%;
    max-width: 100%;
}

.post-view-info {
    text-align: left;
    color: #9c9084;
    font-size: 12.5px;
}

/* 본문 영역 */
.post-view-content {
    min-height: 200px;
    line-height: 1.8;
    font-size: 14.5px;
    color: #3e3832;
    text-align: left;
    width: 100%;
    max-width: 100%;
}

.post-view-content h1,
.post-view-content h2,
.post-view-content h3,
.post-view-content p,
.post-view-content li {
    text-align: left;
    max-width: 100%;
}

.post-view-content img {
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 8px;
}

.btn-group {
    margin-top: 25px;
    border-top: 1px solid #f0ece4;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
}

/* 푸터 스타일 */
footer {
    margin-top: 40px;
    border-top: 1px solid #eee9e0;
    padding-top: 20px;
    text-align: center;
    color: #9c9084;
    font-size: 12px;
    line-height: 1.5;
	
}

/* 페이징 버튼 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 30px 0 10px 0;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #e6e0d6;
    background-color: #fcfbf9;
    color: #6e6358;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
}

.pagination a:hover {
    border-color: #8c6d53;
    color: #8c6d53;
    background-color: #ffffff;
}

.pagination .active {
    background-color: #5c4a3d;
    border-color: #5c4a3d;
    color: #fff;
}

/* 모바일 반응형 설정 (중앙정렬 강제 설정 완전 삭제) */
@media screen and (max-width: 768px) {
    body {
        background-color: #ffffff;
        text-align: left;
    }

    .container {
        margin: 0;
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        width: 100%;
    }

    header {
        text-align: left;
    }

    header h1 {
        white-space: normal;
        font-size: 20px;
    }

    nav {
        border-radius: 10px;
        padding: 6px;
    }

    nav a {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 10px;
        font-size: 13px;
    }

    .main-layout {
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    .content, .sidebar {
        width: 100%;
        min-width: 0;
    }

    .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 #e6e0d6;
    padding: 10px;
    text-align: left;
}
.post-view-content th, .board-content th {
    background-color: #f2eee3;
    color: #2c2520;
}
.post-view-content ul, .post-view-content ol {
    padding-left: 20px;
    margin: 10px 0;
}
.post-view-content li {
    margin: 5px 0;
}