/* 링크모음 사이트 - 메인 스타일시트 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

/* 헤더 */
.header {
    background-color: var(--bg-white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.logo:hover {
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* 모바일 메뉴 토글 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* 검색바 */
.search-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-section h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.search-section p {
    margin-bottom: 2rem;
    opacity: 0.9;
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
}

.search-btn {
    padding: 0.75rem 2rem;
    background-color: var(--bg-white);
    color: var(--primary-color);
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s;
}

.search-btn:hover {
    transform: scale(1.05);
}

/* 메인 컨텐츠 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 카테고리 그리드 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.category-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--text-color);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.category-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.category-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 게시글 그리드 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.post-content {
    padding: 1.5rem;
}

.post-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.post-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.post-card h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.post-card h3 a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    color: #fbbf24;
}

/* 게시글 상세 페이지 */
.post-detail {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 3rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-info {
    display: flex;
    gap: 2rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.post-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-body h2 {
    margin: 2rem 0 1rem;
    color: var(--text-color);
    font-size: 1.75rem;
}

.post-body h3 {
    margin: 1.5rem 0 0.75rem;
    color: var(--text-color);
    font-size: 1.4rem;
}

.post-body p {
    margin-bottom: 1.25rem;
}

.post-body ul, .post-body ol {
    margin: 1rem 0 1.5rem 2rem;
}

.post-body li {
    margin-bottom: 0.5rem;
}

/* 댓글 섹션 */
.comments-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.comment-form {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.rating-input {
    display: flex;
    gap: 0.5rem;
}

.rating-input input[type="radio"] {
    display: none;
}

.rating-input label {
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s;
}

.rating-input input[type="radio"]:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
    color: #fbbf24;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.comment-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: bold;
    color: var(--text-color);
}

.comment-rating {
    color: #fbbf24;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.comment-body {
    color: var(--text-color);
    line-height: 1.6;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 푸터 */
.footer {
    background-color: var(--text-color);
    color: white;
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section p,
.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .search-section h1 {
        font-size: 1.5rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .category-grid,
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1rem;
    }
    
    .post-detail {
        padding: 1.5rem;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.25rem;
    }
    
    .search-section {
        padding: 2rem 1rem;
    }
    
    .post-body {
        font-size: 1rem;
    }
}
