/* 그누보드5 블로그 플랫폼 스타일 */

#blog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 블로그 헤더 */
.blog-header {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 40px;
    border-bottom: 2px solid #e1e4e8;
}

.blog-header h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #24292e;
}

.blog-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    background-color: #f6f8fa;
    color: #24292e;
}

.btn:hover {
    background-color: #e1e4e8;
    text-decoration: none;
}

.btn-primary {
    background-color: #0366d6;
    color: #fff;
    border-color: #0366d6;
}

.btn-primary:hover {
    background-color: #0256c7;
}

.btn-secondary {
    background-color: #6a737d;
    color: #fff;
    border-color: #6a737d;
}

.btn-secondary:hover {
    background-color: #586069;
}

.btn-danger {
    background-color: #d73a49;
    color: #fff;
    border-color: #d73a49;
}

.btn-danger:hover {
    background-color: #cb2431;
}

.btn-default {
    background-color: #fff;
    border-color: #d1d5da;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-link {
    background: none;
    border: none;
    color: #0366d6;
    padding: 0;
    font-size: 12px;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

/* 레이아웃 */
.blog-sidebar-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* 사이드바 */
.blog-sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-widget {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.sidebar-widget h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #24292e;
}

.search-form {
    display: flex;
    gap: 5px;
}

.search-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
}

.category-list,
.author-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li,
.author-list li {
    margin-bottom: 8px;
}

.category-list a,
.author-list a {
    display: block;
    padding: 8px 12px;
    color: #586069;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.category-list a:hover,
.author-list a:hover,
.category-list a.active {
    background-color: #f6f8fa;
    color: #0366d6;
}

.author-list .count {
    float: right;
    color: #6a737d;
    font-size: 12px;
}

/* 게시글 그리드 */
.post-grid {
    display: grid;
    gap: 30px;
}

.post-card {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 30px;
    transition: box-shadow 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.post-category {
    display: inline-block;
    padding: 4px 12px;
    background-color: #f1f8ff;
    color: #0366d6;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 10px;
    text-decoration: none;
}

.post-title {
    font-size: 24px;
    margin-bottom: 15px;
}

.post-title a {
    color: #24292e;
    text-decoration: none;
}

.post-title a:hover {
    color: #0366d6;
}

.badge-draft {
    display: inline-block;
    padding: 2px 8px;
    background-color: #ffeaa7;
    color: #6a5d00;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.post-excerpt {
    color: #586069;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #6a737d;
    flex-wrap: wrap;
}

.post-meta a {
    color: #586069;
    text-decoration: none;
}

.post-meta a:hover {
    color: #0366d6;
}

/* 게시글 상세 */
.post-view {
    max-width: 900px;
    margin: 0 auto;
}

.post-detail {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 40px;
    margin-bottom: 30px;
}

.post-header {
    border-bottom: 2px solid #e1e4e8;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.post-meta-top {
    margin-bottom: 15px;
}

.post-info {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #6a737d;
    margin-top: 15px;
}

.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #24292e;
    margin-bottom: 30px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 20px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-content p {
    margin-bottom: 16px;
}

.post-content p img {
    margin: 20px auto;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
}

.post-content h1 {
    font-size: 2em;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 8px;
}

.post-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #e1e4e8;
    padding-bottom: 8px;
}

.post-content h3 {
    font-size: 1.25em;
}

.post-content ul,
.post-content ol {
    padding-left: 2em;
    margin-bottom: 16px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content blockquote {
    padding: 0 1em;
    color: #6a737d;
    border-left: 4px solid #dfe2e5;
    margin: 16px 0;
}

.post-content code {
    background-color: #f6f8fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 85%;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background-color: #f6f8fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content a {
    color: #0366d6;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
}

.post-content table th,
.post-content table td {
    border: 1px solid #e1e4e8;
    padding: 8px 12px;
}

.post-content table th {
    background-color: #f6f8fa;
    font-weight: 600;
}

.post-footer {
    border-top: 1px solid #e1e4e8;
    padding-top: 20px;
}

.post-actions {
    display: flex;
    gap: 10px;
}

/* 댓글 */
.comments-section {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 40px;
}

.comments-section h2 {
    margin-bottom: 20px;
}

.comment-count {
    color: #0366d6;
}

.comments-list {
    margin-bottom: 30px;
}

.comment-item {
    padding: 20px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author {
    color: #24292e;
}

.comment-date {
    color: #6a737d;
    font-size: 14px;
}

.comment-delete-form {
    display: inline;
}

.comment-content {
    color: #24292e;
    line-height: 1.6;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: #6a737d;
}

.comment-form {
    border-top: 1px solid #e1e4e8;
    padding-top: 30px;
}

.comment-form h3 {
    margin-bottom: 15px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 10px;
}

.login-required {
    text-align: center;
    padding: 40px;
    background-color: #f6f8fa;
    border-radius: 6px;
}

/* 글쓰기 */
.write-container {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 40px;
}

.write-form .form-group {
    margin-bottom: 20px;
}

.write-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #24292e;
}

.write-form .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
}

.write-form textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.write-form small {
    display: block;
    margin-top: 5px;
    color: #6a737d;
    font-size: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

/* 카테고리 관리 */
.categories-container {
    max-width: 1000px;
    margin: 0 auto;
}

.categories-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-bottom: 30px;
}

.categories-list,
.category-form-wrapper {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 30px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e1e4e8;
}

.table th {
    background-color: #f6f8fa;
    font-weight: 500;
    color: #24292e;
}

.table code {
    background-color: #f6f8fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.category-form .form-group {
    margin-bottom: 20px;
}

.back-link {
    text-align: center;
}

/* 페이징 */
.blog-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.blog-pagination ul {
    display: flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-pagination li a,
.blog-pagination li span {
    display: block;
    padding: 8px 12px;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    color: #586069;
    text-decoration: none;
}

.blog-pagination li a:hover {
    background-color: #f6f8fa;
}

.blog-pagination li.active span {
    background-color: #0366d6;
    color: #fff;
    border-color: #0366d6;
}

/* 빈 상태 */
.no-posts,
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6a737d;
}

/* 반응형 */
@media (max-width: 1024px) {
    .blog-sidebar-layout {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .categories-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    #blog-container {
        padding: 10px;
    }
    
    .blog-header {
        padding: 20px 0;
    }
    
    .blog-header h1 {
        font-size: 28px;
    }
    
    .post-card,
    .post-detail,
    .comments-section,
    .write-container,
    .categories-list,
    .category-form-wrapper {
        padding: 20px;
    }
    
    .post-title {
        font-size: 20px;
    }
    
    .post-meta {
        font-size: 12px;
    }
    
    .blog-sidebar {
        grid-template-columns: 1fr;
    }
}
