/* ========================================
   기본 리셋 및 변수
   ======================================== */
:root {
    --color-primary: #2c3e50;
    --color-secondary: #3498db;
    --color-text: #333;
    --color-text-light: #666;
    --color-bg: #fff;
    --color-bg-alt: #f8f9fa;
    --color-border: #e9ecef;
    --max-width: 768px;
    --header-height: 60px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans KR', sans-serif;
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* ========================================
   헤더
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    color: var(--color-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--color-secondary);
}

/* ========================================
   메인 콘텐츠
   ======================================== */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
}

/* ========================================
   포스트 스타일
   ======================================== */
.post-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.post-meta {
    color: var(--color-text-light);
    font-size: 0.9rem;
    display: flex;
    gap: 16px;
}

.post-meta .category {
    color: var(--color-secondary);
}

/* 목차 (TOC) */
.toc {
    background: var(--color-bg-alt);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 32px;
}

.toc summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--color-primary);
}

.toc ul {
    margin-top: 12px;
    padding-left: 20px;
}

.toc li {
    margin: 8px 0;
}

.toc a {
    color: var(--color-text-light);
    text-decoration: none;
}

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

/* 본문 */
.post-content {
    font-size: 1.05rem;
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 48px 0 20px;
    padding-top: 16px;
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 32px 0 16px;
}

.post-content p {
    margin-bottom: 20px;
    color: var(--color-text);
}

.post-content ul,
.post-content ol {
    margin: 20px 0;
    padding-left: 24px;
}

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

.post-content blockquote {
    border-left: 4px solid var(--color-secondary);
    padding: 16px 20px;
    margin: 24px 0;
    background: var(--color-bg-alt);
    color: var(--color-text-light);
}

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

.post-content a {
    color: var(--color-secondary);
    text-decoration: underline;
}

.post-content code {
    background: var(--color-bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
}

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

/* ========================================
   광고 영역 (승인 후 활성화)
   ======================================== */
.ad-container {
    margin: 32px 0;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    border-radius: 8px;
}

/* ========================================
   관련 글
   ======================================== */
.related-posts {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--color-border);
}

.related-posts h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--color-primary);
}

.related-posts ul {
    list-style: none;
}

.related-posts li {
    margin: 12px 0;
}

.related-posts a {
    color: var(--color-text);
    text-decoration: none;
}

.related-posts a:hover {
    color: var(--color-secondary);
}

/* ========================================
   푸터
   ======================================== */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.footer-nav {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    color: var(--color-text-light);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--color-secondary);
}

/* ========================================
   홈페이지 - 글 목록
   ======================================== */
.post-list {
    list-style: none;
}

.post-list-item {
    padding: 24px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.post-list-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.post-list-title a {
    color: var(--color-primary);
    text-decoration: none;
}

.post-list-title a:hover {
    color: var(--color-secondary);
}

.post-list-excerpt {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.post-list-meta {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* ========================================
   반응형
   ======================================== */
@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        height: auto;
        padding: 16px 20px;
        gap: 12px;
    }

    .main-nav {
        gap: 16px;
        font-size: 0.9rem;
    }

    .post-title {
        font-size: 1.5rem;
    }

    .post-content h2 {
        font-size: 1.3rem;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}
