/* --- [스타일 정의] --- */
:root {
    --primary: #0056b3;
    --text: #333;
    --bg: #f9f9f9;
    --white: #fff;
    --border: #e1e1e1;
    --card-excerpt: #555;
    --article-meta: #888;
    --article-h2: #111;
    --article-p: #444;
    --footer-text: #777;
    --logo-color: #000;
}

body.dark-mode {
    --primary: #4dabf7;
    --text: #c9d1d9;
    --bg: #0d1117;
    --white: #161b22;
    --border: #30363d;
    --card-excerpt: #8b949e;
    --article-meta: #8b949e;
    --article-h2: #c9d1d9;
    --article-p: #c9d1d9;
    --footer-text: #8b949e;
    --logo-color: #c9d1d9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 17px; line-height: 1.7; color: var(--text); background: var(--bg); word-break: keep-all; transition: background-color 0.3s, color 0.3s; }

/* 레이아웃 */
.container { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 2.5fr 1fr; gap: 40px; align-items: start; }
header { background: var(--white); border-bottom: 1px solid var(--border); padding: 15px 0; margin-bottom: 30px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: background-color 0.3s; }
header .inner { max-width: 1100px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }

.logo { font-size: 24px; font-weight: 800; cursor: pointer; color: var(--logo-color); }
.nav-menu ul { display: flex; gap: 20px; list-style: none; font-weight: 600; font-size: 15px; }
.nav-item { cursor: pointer; }
.nav-item:hover { color: var(--primary); }

/* 게시글 카드 (목록 화면) */
.post-card { background: var(--white); padding: 30px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 25px; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background-color 0.3s; cursor: pointer; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); border-color: var(--primary); }
.category-badge { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; margin-bottom: 8px; display: block; }
.card-title { font-size: 22px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.card-excerpt { font-size: 16px; color: var(--card-excerpt); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 게시글 상세 (읽기 화면) */
.article-view { background: var(--white); padding: 40px; border: 1px solid var(--border); border-radius: 8px; transition: background-color 0.3s; }
.article-header { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 30px; }
.article-title { font-size: 32px; font-weight: 800; margin-bottom: 15px; line-height: 1.3; }
.article-meta { color: var(--article-meta); font-size: 14px; }
.article-body h2 { margin-top: 40px; margin-bottom: 15px; font-size: 24px; border-bottom: 2px solid var(--border); padding-bottom: 10px; color: var(--article-h2); }
.article-body p { margin-bottom: 20px; color: var(--article-p); }
.article-body ul { margin-bottom: 20px; padding-left: 20px; }
.article-body li { margin-bottom: 8px; }
.back-btn { display: inline-block; margin-bottom: 20px; color: var(--primary); font-weight: 600; cursor: pointer; }

/* 사이드바 & 푸터 */
.sidebar-widget { background: var(--white); padding: 25px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 20px; transition: background-color 0.3s; }
.widget-title { font-size: 18px; font-weight: 700; margin-bottom: 15px; border-bottom: 2px solid var(--text); padding-bottom: 8px; display: inline-block; }
footer { background: var(--white); border-top: 1px solid var(--border); margin-top: 60px; padding: 40px 0; text-align: center; font-size: 14px; color: var(--footer-text); transition: background-color 0.3s; }
.footer-links span { margin: 0 10px; cursor: pointer; transition: color 0.2s; }
.footer-links span:hover { color: var(--primary); text-decoration: underline; }

#theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

#theme-toggle:hover {
    background: var(--bg);
}

@media (max-width: 768px) { 
    .container { grid-template-columns: 1fr; } 
    header .inner { flex-direction: row; gap: 15px; align-items: center; } /* Mobile header alignment */
    .article-title { font-size: 24px; } 
    .article-view { padding: 20px; }
    .nav-menu ul {
        display: none; /* Hide nav links on mobile for simplicity, can be a toggle menu */
    }
}
