/* /styles.css */
/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    padding-bottom: 30px;
}

/* 헤더 스타일 */
header {
    background-color: #333;
    color: white;
    padding: 1rem;
    text-align: center;
}

header h1 {
    margin-bottom: 0.5rem;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 a:hover {
    text-decoration: underline;
}

header nav a {
    color: white;
    margin: 0 1rem;
    text-decoration: none;
}

header nav a:hover {
    text-decoration: underline;
}

/* 컨트롤 컨테이너 스타일 */
.controls-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    place-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-container {
    display: flex;
    gap: 0.5rem;
}

#search-input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    width: 200px;
}

#search-btn {
    background-color: #2c3e50;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#search-btn:hover {
    background-color: #34495e;
}

.font-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.font-controls button {
    background-color: #2c3e50;
    color: white;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

.font-controls button:hover {
    background-color: #34495e;
}

.font-controls span {
    margin: 0 0.5rem;
}

/* 메인 콘텐츠 스타일 */
main {
    max-width: 1200px;
    padding: 0 1rem;
    justify-self: center;
}

/* 컨테이너 스타일 */
.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.latest-post, .post-list {
    padding: 20px;
}

.latest-post {
    background-color: #fffef0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 50%; /* 초기 너비 */
    min-width: 200px; /* 최소 너비 */
}

.resize-handle {
    width: 5px;
    background-color: #ff8800;
    cursor: col-resize;
    position: relative;
    z-index: 1;
}

.resize-handle:hover {
    background-color: #777;
}

.post-list {
    background-color: #fff;
    width: calc(50% - 5px); /* 초기 너비, 핸들 너비 제외 */
    min-width: 200px; /* 최소 너비 */
}

/* 좌측 최신 게시물 (신문 스타일) */
.latest-post .post {
    background: none;
    padding: 0;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
}

.latest-post .post h3 {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    font-weight: bold;
    color: #1a1a1a;
    margin-bottom: 1rem;
    line-height: 1.2;
    border-bottom: 3px double #333;
    padding-bottom: 0.5rem;
}

.latest-post .post p {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    column-count: 2;
    column-gap: 1.5rem;
    column-rule: 1px solid #ccc;
    text-align: justify;
    margin-bottom: 1rem;
}

.latest-post .post-meta {
    font-family: 'Arial', sans-serif;
    font-size: 0.9rem;
    color: #555;
    text-align: right;
    border-top: 1px dashed #777;
    padding-top: 0.5rem;
}

/* 우측 게시물 목록 */
.post-list h2 {
    margin-bottom: 1rem;
    color: #333;
}

.post-list .post {
    background: white;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post-list .post.selected {
    background-color: #e6f3ff;
    border-left: 4px solid #0089ff;
}

.post-list .post h3 {
    margin-bottom: 13px;
    color: #2c3e50;
}

.post-list .post h3 a {
    color: #2c3e50;
    text-decoration: none;
}

.post-list .post h3 a:hover {
    text-decoration: underline;
}

.post-list .post p {
    margin-bottom: 0.5rem;
}

.post-list .post-meta {
    font-size: 0.9rem;
    color: #777;
}

/* 상세 페이지 스타일 */
.post-detail {
    background: white;
    padding: 1.5rem;
    margin: 2rem auto;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post-detail h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.post-detail .post-meta {
    margin-bottom: 1rem;
}

.post-detail p {
    line-height: 1.8;
}

/* 푸터 스타일 */
footer {
    z-index: 1;
    text-align: center;
    padding: 1rem;
    background-color: #333;
    color: white;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* 반응형 디자인 */
@media (max-width: 800px) {
    .container {
        flex-direction: column;
    }
    .latest-post, .post-list {
        width: 100%;
    }
    .resize-handle {
        display: none; /* 모바일에서는 드래그 핸들 숨김 */
    }
    .latest-post .post p {
        column-count: 1;
    }
    .controls-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.5rem;
    }
    header nav a {
        display: block;
        margin: 0.5rem 0;
    }
    main {
        padding: 0 0.5rem;
    }
    .post-list .post {
        padding: 1rem;
    }
    .post-detail {
        padding: 1rem;
    }
    .latest-post .post h3 {
        font-size: 20px;
    }
}

/* 글쓰기 페이지 스타일 */
.post-write {
    background: white;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 800px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post-write h2 {
    color: #2c3e50;
}

/* JSON 업로드 섹션 스타일 */
.json-upload {
    background: white;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 800px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.json-upload h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
}

button[type="submit"],
button[id="upload-json-btn"],
button[id="download-sample-json-btn"] {
    background-color: #2c3e50;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-right: 0.5rem;
}

button[type="submit"]:hover,
button[id="upload-json-btn"]:hover,
button[id="download-sample-json-btn"]:hover {
    background-color: #34495e;
}

/* 예약 게시 날짜 스타일 */
.form-group input[type="datetime-local"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* 네비게이션 버튼 스타일 */
.navigation-buttons {
    margin: 1rem auto;
    max-width: 800px;
    text-align: center;
}

.navigation-buttons button {
    background-color: #2c3e50;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    margin: 0 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.navigation-buttons button:hover {
    background-color: #34495e;
}

.navigation-buttons button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}