/**
 * style.css - 프론트 스타일시트
 * 역할: 블로그 공개 페이지 디자인 (다크모드, 반응형)
 * 폰트: Noto Sans KR (Google Fonts)
 */

/* ================================================
   CSS 변수 (라이트/다크 모드)
   ================================================ */
:root {
    --color-primary:     #6366f1;
    --color-primary-dark:#4f46e5;
    --color-secondary:   #8b5cf6;
    --color-accent:      #06b6d4;

    --bg-body:           #f8fafc;
    --bg-card:           #ffffff;
    --bg-code:           #f1f5f9;
    --bg-header:         #ffffff;
    --bg-footer:         #1e1b4b;

    --text-primary:      #0f172a;
    --text-secondary:    #475569;
    --text-muted:        #94a3b8;
    --text-on-primary:   #ffffff;

    --border-color:      #e2e8f0;
    --border-radius:     10px;
    --border-radius-lg:  16px;

    --shadow-sm:         0 1px 3px rgba(0,0,0,.08);
    --shadow-md:         0 4px 16px rgba(0,0,0,.1);
    --shadow-lg:         0 8px 32px rgba(0,0,0,.12);

    --font-sans:         'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:         'Fira Code', 'Cascadia Code', Consolas, monospace;
    --font-size-base:    1rem;
    --line-height:       1.75;

    --max-width:         1200px;
    --sidebar-width:     300px;
    --header-height:     64px;

    --transition:        .2s ease;
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    :root { --is-dark: 1; }
}
[data-theme="dark"] {
    --bg-body:       #0f172a;
    --bg-card:       #1e293b;
    --bg-code:       #0f172a;
    --bg-header:     #1e293b;
    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;
    --border-color:  #334155;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
    --shadow-md:     0 4px 16px rgba(0,0,0,.4);
    --shadow-lg:     0 8px 32px rgba(0,0,0,.5);
}

/* ================================================
   리셋 & 베이스
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height);
    color: var(--text-primary);
    background: var(--bg-body);
    transition: background var(--transition), color var(--transition);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ================================================
   레이아웃
   ================================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-area {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: 32px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px;
    width: 100%;
    flex: 1;
}

.content-area.full-width {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.main-content { min-width: 0; }
.sidebar { min-width: 0; }

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 20px;
}

.site-logo a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}
.site-logo .logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}
.site-logo .logo-slogan {
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* 주 내비게이션 */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}
.main-nav a:hover, .main-nav a.active {
    background: rgba(99,102,241,.1);
    color: var(--color-primary);
}

/* 검색 + 다크모드 버튼 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-toggle-btn,
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition);
}
.search-toggle-btn:hover,
.theme-toggle-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(99,102,241,.08);
}

/* 햄버거 메뉴 (모바일) */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    cursor: pointer;
    background: none;
    border: none;
}
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

/* 검색 오버레이 */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.7);
    z-index: 200;
    backdrop-filter: blur(4px);
    align-items: flex-start;
    padding-top: 80px;
}
.search-overlay.open { display: flex; }

.search-box {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}
.search-box input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1.1rem;
    border: 2px solid var(--color-primary);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
}
.search-results-live {
    margin-top: 12px;
    max-height: 400px;
    overflow-y: auto;
}
.search-result-item {
    padding: 10px 12px;
    border-radius: 6px;
    display: block;
    color: var(--text-primary);
    transition: background var(--transition);
}
.search-result-item:hover { background: rgba(99,102,241,.08); }
.search-result-item .title { font-weight: 600; font-size: .95rem; }
.search-result-item .meta { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* ================================================
   카드 & 글 목록
   ================================================ */
.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.post-card-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.post-card:hover .post-card-thumb img { transform: scale(1.04); }

.post-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-category {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    color: var(--color-primary);
    background: rgba(99,102,241,.1);
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--color-primary); }

.post-card-excerpt {
    font-size: .9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-bottom: 16px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .8rem;
    color: var(--text-muted);
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}
.post-card-meta span { display: flex; align-items: center; gap: 4px; }

/* 글 목록 그리드 */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* 피처드 글 (첫 번째) */
.post-card.featured {
    grid-column: 1 / -1;
    flex-direction: row;
    max-height: 280px;
}
.post-card.featured .post-card-thumb {
    width: 400px;
    min-width: 400px;
    aspect-ratio: auto;
}
.post-card.featured .post-card-title { font-size: 1.4rem; }
.post-card.featured .post-card-excerpt { -webkit-line-clamp: 4; }

/* ================================================
   글 상세 페이지
   ================================================ */
.post-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

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

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    font-size: .875rem;
    color: var(--text-muted);
}
.post-meta span { display: flex; align-items: center; gap: 5px; }
.post-meta .reading-time { 
    background: rgba(99,102,241,.1); 
    color: var(--color-primary); 
    padding: 2px 10px; 
    border-radius: 20px;
    font-weight: 600;
}

/* 대표 이미지 */
.post-featured-image {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
}
.post-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* 목차 */
.toc-box {
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-primary);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 32px;
}
.toc-box h3 {
    font-size: .875rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 4px; }
.toc-list a { font-size: .9rem; color: var(--text-secondary); transition: color var(--transition); }
.toc-list a:hover { color: var(--color-primary); }
.toc-list .toc-h3 { padding-left: 16px; font-size: .85rem; }

/* 글 본문 */
.post-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
}
.post-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2em 0 .75em;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}
.post-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.5em 0 .5em;
    color: var(--text-primary);
}
.post-body p { margin-bottom: 1.2em; }
.post-body ul, .post-body ol { margin: 1em 0 1em 1.5em; }
.post-body li { margin-bottom: .4em; }
.post-body blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 12px 20px;
    margin: 1.5em 0;
    background: rgba(99,102,241,.06);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}
.post-body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.post-body img {
    border-radius: var(--border-radius);
    display: block;
    margin: 1em auto;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
    height: auto;
}

/* CKEditor 5 이미지 정렬 스타일 지원 */
.post-body figure.image {
    margin: 1em auto;
    display: table;
    clear: both;
}

.post-body figure.image-style-align-left,
.post-body figure.image-style-left,
.post-body figure.image-style-side {
    float: left;
    margin: 0.5em 1.5em 0.5em 0;
    max-width: 50%;
}

.post-body figure.image-style-align-left img,
.post-body figure.image-style-left img,
.post-body figure.image-style-side img {
    margin: 0;
}

.post-body figure.image-style-align-right,
.post-body figure.image-style-right {
    float: right;
    margin: 0.5em 0 0.5em 1.5em;
    max-width: 50%;
}

.post-body figure.image-style-align-right img,
.post-body figure.image-style-right img {
    margin: 0;
}

.post-body figure.image-style-align-center,
.post-body figure.image-style-center {
    float: none;
    margin-left: auto;
    margin-right: auto;
}

.post-body img.image-style-align-left,
.post-body img.image-style-left,
.post-body img.align-left {
    float: left;
    margin: 0.5em 1.5em 0.5em 0;
    display: inline-block;
}

.post-body img.image-style-align-right,
.post-body img.image-style-right,
.post-body img.align-right {
    float: right;
    margin: 0.5em 0 0.5em 1.5em;
    display: inline-block;
}

.post-body img.image-style-align-center,
.post-body img.image-style-center,
.post-body img.align-center {
    float: none;
    margin: 1em auto;
    display: block;
}

.post-body::after {
    content: "";
    display: table;
    clear: both;
}

/* 이미지 캡션 스타일 */
.post-body figcaption {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.3em;
    line-height: 1.4;
    word-break: break-all;
}
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: .9rem;
}
.post-body th {
    background: var(--color-primary);
    color: #fff;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
}
.post-body td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
}
.post-body tr:nth-child(even) td { background: var(--bg-code); }

/* 인라인 코드 */
.post-body code {
    font-family: var(--font-mono);
    font-size: .875em;
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    color: #e11d48;
}

/* 코드 블록 (highlight.js) */
.post-body pre {
    background: #1e1b4b;
    border-radius: var(--border-radius);
    padding: 20px;
    overflow-x: auto;
    margin: 1.5em 0;
    box-shadow: var(--shadow-md);
}
.post-body pre code {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: .9em;
    padding: 0;
}

/* 태그 목록 */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 24px 0;
}
.tag-chip {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: .8rem;
    color: var(--text-secondary);
    transition: all var(--transition);
}
.tag-chip:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* 공유 버튼 */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}
.share-buttons .label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}
.share-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: .85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition);
}
.share-btn.kakao   { background: #FEE500; color: #3C1E1E; }
.share-btn.twitter { background: #1DA1F2; color: #fff; }
.share-btn.copy    { background: var(--bg-code); border: 1px solid var(--border-color); color: var(--text-primary); }
.share-btn:hover { opacity: .85; transform: translateY(-1px); }

/* 이전글/다음글 */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}
.post-nav-link {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: block;
    transition: all var(--transition);
}
.post-nav-link:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}
.post-nav-link .nav-label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    display: block;
}
.post-nav-link .nav-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: .9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-nav-link.next { text-align: right; }

/* ================================================
   댓글
   ================================================ */
.comments-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--border-color);
}
.comments-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.comment-item:last-child { border-bottom: none; }

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
}

.comment-body { flex: 1; }
.comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.comment-author { font-weight: 700; font-size: .9rem; }
.comment-date { font-size: .8rem; color: var(--text-muted); }
.comment-content { font-size: .95rem; line-height: 1.7; color: var(--text-primary); }

.reply-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: .8rem;
    cursor: pointer;
    padding: 4px 0;
    font-family: var(--font-sans);
    margin-top: 6px;
}

/* 댓글 답글 들여쓰기 */
.comment-replies {
    margin-left: 54px;
    border-left: 2px solid var(--border-color);
    padding-left: 16px;
    margin-top: 8px;
}

/* 댓글 작성 폼 */
.comment-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-top: 24px;
}
.comment-form h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: .95rem;
    transition: border-color var(--transition);
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-group textarea { resize: vertical; min-height: 120px; }

/* ================================================
   사이드바
   ================================================ */
.sidebar-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}
.sidebar-widget h3 {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-post-list { list-style: none; }
.sidebar-post-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-post-list li:last-child { border-bottom: none; }
.sidebar-post-list a {
    color: var(--text-primary);
    font-size: .9rem;
    font-weight: 500;
    transition: color var(--transition);
    display: block;
}
.sidebar-post-list a:hover { color: var(--color-primary); }
.sidebar-post-list .view-count {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.category-list { list-style: none; }
.category-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}
.category-list li:last-child { border-bottom: none; }
.category-list a { color: var(--text-secondary); font-size: .9rem; }
.category-list a:hover { color: var(--color-primary); }
.category-list .count {
    background: var(--bg-code);
    color: var(--text-muted);
    font-size: .75rem;
    padding: 1px 8px;
    border-radius: 12px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ================================================
   빵부스러기
   ================================================ */
.breadcrumb {
    padding: 12px 0;
    margin-bottom: 8px;
}
.breadcrumb-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: .85rem;
    color: var(--text-muted);
}
.breadcrumb-item a { color: var(--color-primary); }
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    margin-right: 4px;
    color: var(--text-muted);
}

/* ================================================
   페이지네이션
   ================================================ */
.pagination {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}
.pagination-list {
    list-style: none;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
    transition: all var(--transition);
    background: var(--bg-card);
}
.page-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(99,102,241,.06);
}
.page-link.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.page-ellipsis {
    display: flex;
    align-items: center;
    height: 38px;
    color: var(--text-muted);
}

/* ================================================
   버튼 공통
   ================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: .9rem;
    font-weight: 600;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--color-primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,.3);
}
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ================================================
   알림 메시지
   ================================================ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: .9rem;
}
.alert-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #16a34a;
}
.alert-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}
.alert-warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #d97706;
}
.alert-info {
    background: #eff6ff;
    border: 1px solid #93c5fd;
    color: #2563eb;
}

/* ================================================
   푸터
   ================================================ */
.site-footer {
    background: var(--bg-footer);
    color: #94a3b8;
    padding: 48px 0 24px;
    margin-top: auto;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-brand .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    display: block;
    margin-bottom: 8px;
}
.footer-brand p {
    font-size: .875rem;
    line-height: 1.7;
    max-width: 280px;
}
.footer-section h4 {
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 8px; }
.footer-section a {
    color: #94a3b8;
    font-size: .875rem;
    transition: color var(--transition);
}
.footer-section a:hover { color: #fff; }
.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .8rem;
}

/* ================================================
   404 페이지
   ================================================ */
.error-page {
    text-align: center;
    padding: 80px 20px;
}
.error-page .error-code {
    font-size: 8rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
    opacity: .15;
}
.error-page h1 {
    font-size: 2rem;
    margin: -40px 0 16px;
    color: var(--text-primary);
}
.error-page p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ================================================
   반응형
   ================================================ */
@media (max-width: 1024px) {
    .content-area {
        grid-template-columns: 1fr;
        --sidebar-width: 100%;
    }
    .sidebar { order: 1; }
    .main-content { order: 0; }

    .post-card.featured {
        flex-direction: column;
        max-height: none;
    }
    .post-card.featured .post-card-thumb {
        width: 100%;
        min-width: auto;
        aspect-ratio: 16/9;
    }

    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    :root { --header-height: 56px; }

    .main-nav { display: none; }
    .main-nav.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-header);
        padding: 24px;
        gap: 8px;
        z-index: 99;
        overflow-y: auto;
    }
    .main-nav.open a { padding: 14px; font-size: 1rem; }
    .menu-toggle { display: flex; }

    .post-title { font-size: 1.5rem; }
    .posts-grid { grid-template-columns: 1fr; }
    .post-navigation { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    .share-buttons { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .content-area { padding: 16px; }
    .post-body { font-size: 1rem; }
    .post-card-body { padding: 14px; }
}

/* ================================================
   스크롤바 커스텀 (웹킷)
   ================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ================================================
   선택 색상
   ================================================ */
::selection { background: rgba(99,102,241,.2); color: var(--text-primary); }

/* ================================================
   이미지 lazy loading 페이드인
   ================================================ */
img[loading="lazy"] { opacity: 0; transition: opacity .4s ease; }
img.loaded { opacity: 1; }

/* ================================================
   알림창 (Alerts)
   ================================================ */
.alert {
    padding: 14px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInDown 0.3s ease-out;
}
.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}
.alert-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}
.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}
.alert-info {
    background-color: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #6366f1;
}
@keyframes slideInDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
