/* =========================
   기본 설정
========================= */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
}

/* =========================
   공통 레이아웃
========================= */
.board-wrap {
    width: 100%;
    max-width: 960px;
    margin: 30px auto 60px;
    background: #fff;
    padding: 24px 24px 32px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

/* 카드형 섹션 (보기/댓글 등) */
.board-card {
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* 제목/설명 */
.board-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.board-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

/* 상단 바 (코드/글쓰기 버튼 등) */
.board-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

/* =========================
   버튼 공통
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

/* 파란 버튼 */
.btn-primary {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
}
.btn-primary:hover {
    background: #1d4ed8;
}

/* 회색 기본 버튼 */
.btn-default {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #374151;
}
.btn-default:hover {
    background: #e5e7eb;
}

/* 위험(삭제) 버튼 */
.btn-danger {
    background: #dc2626;
    border-color: #b91c1c;
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
}

/* 리스트 상단 “글쓰기” 전용 (단독으로도 사용 가능) */
.btn-write {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    text-decoration: none;
}
.btn-write:hover {
    background: #1d4ed8;
}

/* =========================
   테이블 (목록)
========================= */
.board-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.board-table th,
.board-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
}

.board-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #4b5563;
    text-align: left;
}

.board-table tr:hover {
    background: #f9fafb;
}

/* 빈 목록 표시 */
.board-list-empty,
.board-empty {
    text-align: center;
    padding: 16px 10px;
    color: #9ca3af;
}

/* =========================
   페이지네이션
========================= */
.pagination {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
}

.pagination a,
.pagination span {
    display: inline-block;
    margin: 0 3px;
    padding: 3px 7px;
    border-radius: 4px;
    text-decoration: none;
}

.pagination .current {
    background: #2563eb;
    color: #fff;
}

/* =========================
   글 보기
========================= */
.post-title {
    font-size: 23px;
    font-weight: 700;
    margin-bottom: 6px;
}

.post-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-content {
    font-size: 15px;
    line-height: 1.7;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 보기 하단 버튼 */
.view-actions {
    margin-top: 26px;
    display: flex;
    gap: 8px;
}

/* =========================
   글쓰기 / 수정 폼
========================= */
.post-form {
    margin-top: 10px;
}

.post-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.post-form input[type="text"],
.post-form input[type="password"],
.post-form textarea,
.post-form select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 12px;
}

.post-form textarea {
    min-height: 260px;
}

/* 글쓰기 하단 버튼 영역 */
.write-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* board_post.write.php 에서 쓰는 폼용 클래스 */
.form-row {
    margin-bottom: 10px;
}
.form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}
.form-row input[type="text"],
.form-row textarea {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}
.form-row textarea {
    min-height: 200px;
    resize: vertical;
}
.form-actions {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =========================
   댓글 영역
========================= */
.comment-wrap {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
}

.comment-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
}

.comment-list {
    font-size: 13px;
}

.comment-item {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
}

/* 메타/본문 - 두 방식 모두 대응 */
.comment-meta,
.comment-item .meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 6px;
}

.comment-body,
.comment-item .text {
    font-size: 14px;
    line-height: 1.5;
}

.comment-form textarea,
.comment-form input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}
.comment-form textarea {
    min-height: 80px;
    resize: vertical;
}

/* =========================
   반응형
========================= */
@media (max-width: 700px) {
    .board-wrap {
        padding: 18px 16px 24px;
    }

    .board-table th,
    .board-table td {
        padding: 6px 6px;
        font-size: 13px;
    }

    .write-actions,
    .view-actions {
        flex-direction: column;
    }
}

.attach-list {
    margin: 6px 0 10px;
    padding: 8px;
    border-radius: 4px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}
.attach-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 2px 0;
}
.attach-item a {
    color: #2563eb;
    text-decoration: none;
}
.attach-item a:hover {
    text-decoration: underline;
}
.attach-delete-label {
    font-size: 12px;
    color: #6b7280;
}
.file-input-row {
    margin-bottom: 4px;
}

.post-attach-images img {
    max-width: 100%;
}

.board-category-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4f46e5;
}

.menu-btn-danger {
    background: #f87171;
    border: 1px solid #ef4444;
    color: #fff !important;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all .15s ease;
}