/* 블로그/커뮤니티 템플릿 스타일 */

/* 블로그 메인 레이아웃 */
.blog-main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

.blog-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
}

.blog-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.blog-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    margin-top: 40px;
}

/* 블로그 콘텐츠 */
.blog-content {
    min-height: 400px;
}

.posts-grid {
    display: grid;
    gap: 30px;
}

.post-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.post-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-content {
    padding: 25px;
}

.post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.post-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.post-title {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    line-height: 1.4;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #667eea;
}

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

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #888;
}

.post-stats {
    display: flex;
    gap: 15px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f5f5f5;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.tag:hover {
    background: #e0e0e0;
    color: #333;
}

/* 사이드바 */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.sidebar-widget h3 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* 검색 폼 */
.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

.search-form button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.search-form button:hover {
    background: #5a6fd8;
}

/* 카테고리 리스트 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.category-list a {
    color: #666;
    text-decoration: none;
    padding: 5px 0;
    display: block;
    transition: color 0.3s ease;
}

.category-list a:hover {
    color: #667eea;
}

/* 태그 클라우드 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* RSS 링크 */
.rss-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ff6600;
    text-decoration: none;
    font-weight: 500;
}

.rss-link:hover {
    color: #e55a00;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 포스트가 없을 때 */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-posts h2 {
    margin-bottom: 20px;
    color: #333;
}

/* 버튼 스타일 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    color: white;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .blog-header h1 {
        font-size: 2rem;
    }
    
    .post-content {
        padding: 20px;
    }
    
    .post-footer {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

/* 블로그 포스트 상세 페이지 */
.post-detail {
    max-width: var(--site-width);
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.post-detail-header {
    padding: 40px 40px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.post-detail-title {
    font-size: 2.2rem;
    margin: 0 0 15px 0;
    line-height: 1.3;
    color: #333;
}

.post-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

.post-detail-content {
    padding: 40px;
    line-height: 1.8;
    font-size: 1.1rem;
}

.post-detail-content h1,
.post-detail-content h2,
.post-detail-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

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

.post-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 20px 0;
}

.post-detail-footer {
    padding: 20px 40px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.like-btn,
.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    color: #666;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.like-btn:hover,
.share-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.like-btn.liked {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

/* 댓글 시스템 */
.comments-section {
    max-width: var(--site-width);
    margin: 40px auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
}

.comments-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-form {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
}

.comment-form button {
    margin-top: 10px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment {
    padding: 20px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
}

.comment.reply {
    margin-left: 40px;
    background: white;
}

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

.comment-author {
    font-weight: 500;
    color: #333;
}

.comment-date {
    font-size: 0.8rem;
    color: #666;
}

.comment-content {
    line-height: 1.6;
    margin-bottom: 10px;
}

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

.comment-reply {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.8rem;
}

/* 로딩 애니메이션 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
