/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    background: #fff;
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* === Header === */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eee;
}
.header-inner {
    max-width: 1200px; margin: 0 auto;
    padding: 0 24px; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
}
.site-logo {
    font-size: 20px; font-weight: 700; color: #1a1a1a; display: flex; align-items: center;
}
.site-logo-img {
    height: 36px; width: auto;
}
/* === Header Left (logo + divider + Blog) === */
.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.header-left-divider {
    width: 2px;
    height: 20px;
    background: #1a1a1a;
    display: inline-block;
}
.blog-home-link {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav ul { list-style: none; display: flex; gap: 24px; }
.site-nav a { font-size: 14px; color: #666; transition: color .2s; }
.site-nav a:hover { color: #6A14FF; }

/* === Footer === */
.site-footer {
    border-top: 1px solid #eee;
    padding: 40px 24px;
    text-align: center; color: #999; font-size: 13px;
}
.site-footer a { color: #6A14FF; }

/* === Index / Grid === */
.index-container { max-width: 1100px; margin: 0 auto; padding: 60px 24px; }
.index-header { text-align: center; margin-bottom: 48px; }
.index-header h1 { font-size: 32px; font-weight: 700; }
.index-desc { color: #666; margin-top: 8px; font-size: 16px; }

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 32px;
}

/* === Post Card === */
.post-card { border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid #eee; transition: box-shadow .2s; }
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.post-card-link { display: block; color: inherit; }
.post-card-image {
    height: 200px; background-size: cover; background-position: center; background-color: #f0f0f0;
}
.post-card-body { padding: 20px; }
.post-card-title { font-size: 18px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.post-card-excerpt { font-size: 14px; color: #666; line-height: 1.6; margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-date { font-size: 12px; color: #999; }

/* === Pagination === */
.pagination { display: flex; justify-content: center; gap: 16px; margin-top: 48px; }
.pagination a { padding: 8px 20px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; color: #666; transition: all .2s; }
.pagination a:hover { border-color: #6A14FF; color: #6A14FF; }

/* === Post Layout (sidebar + content) === */
.post-layout {
    max-width: 1200px; margin: 0 auto; padding: 40px 24px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
}

/* === TOC Sidebar === */
.toc-sidebar { position: relative; }
.toc-sticky { position: sticky; top: 88px; }
.toc-heading { font-size: 13px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 16px; }
.toc-list { list-style: none; }
.toc-item { margin-bottom: 6px; }
.toc-item a {
    font-size: 13px; color: #888; display: block; padding: 4px 0;
    border-left: 2px solid transparent; padding-left: 12px;
    transition: all .2s; line-height: 1.5;
}
.toc-item a:hover, .toc-item a.active { color: #6A14FF; border-left-color: #6A14FF; }
.toc-h3 a { padding-left: 24px; font-size: 12px; }

/* === Post Content Area === */
.post-content-area { max-width: 720px; min-width: 0; }

.post-header { margin-bottom: 40px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag-pill {
    display: inline-block; padding: 4px 14px; border-radius: 20px;
    font-size: 12px; font-weight: 500; color: #6A14FF; background: #F0EAFF;
    transition: background .2s;
}
.tag-pill:hover { background: #e0d4ff; }
.post-title { font-size: 36px; font-weight: 700; line-height: 1.3; margin-bottom: 12px; }
.post-subtitle { font-size: 18px; color: #666; line-height: 1.6; margin-bottom: 20px; }
.post-meta { display: flex; align-items: center; justify-content: space-between; color: #999; font-size: 14px; }

/* Share buttons */
.share-buttons { display: flex; gap: 8px; }
.share-btn {
    width: 36px; height: 36px; border: 1px solid #ddd; border-radius: 50%;
    background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: #666; transition: all .2s;
}
.share-btn:hover { border-color: #6A14FF; color: #6A14FF; }
.share-btn.copied { border-color: #27ae60; color: #27ae60; }

/* === Ghost Content (article body) === */
.gh-content { font-size: 17px; line-height: 1.85; color: #333; }
.gh-content h2 { font-size: 26px; font-weight: 700; margin: 48px 0 16px; }
.gh-content h3 { font-size: 21px; font-weight: 600; margin: 36px 0 12px; }
.gh-content p { margin-bottom: 20px; }
.gh-content ul, .gh-content ol { margin-bottom: 20px; padding-left: 24px; }
.gh-content li { margin-bottom: 8px; }
.gh-content blockquote {
    border-left: 3px solid #6A14FF; padding: 12px 20px; margin: 24px 0;
    color: #555; background: #f9fafb; border-radius: 0 8px 8px 0;
}
.gh-content img { border-radius: 8px; margin: 24px 0; }
.gh-content a { color: #6A14FF; text-decoration: underline; }
.gh-content pre { background: #f5f5f5; padding: 20px; border-radius: 8px; overflow-x: auto; margin: 24px 0; font-size: 14px; }
.gh-content code { font-family: 'SF Mono', Menlo, monospace; font-size: 0.9em; }
.gh-content figure { margin: 24px 0; }
.gh-content .kg-width-wide { margin-left: -80px; margin-right: -80px; max-width: calc(100% + 160px); }
.gh-content .kg-width-full { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); max-width: 100vw; width: 100vw; }
@media (max-width: 900px) {
    .gh-content .kg-width-wide { margin-left: 0; margin-right: 0; max-width: 100%; }
}
.gh-content figcaption { text-align: center; font-size: 13px; color: #999; margin-top: 8px; }

/* === CTA Section === */
.cta-section {

    background: #F5F7FA; border-radius: 16px; padding: 24px 20px; margin: 48px 0;
}
.cta-card { max-width: 480px; margin: 0 auto; }
.cta-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.cta-desc { text-align: center; color: #666; font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: #555; margin-bottom: 6px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px;
    font-size: 14px; font-family: inherit; transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #6A14FF; }
.cta-submit {
    width: 100%; padding: 14px; background: linear-gradient(90deg, #6A14FF 0%, #00A0FF 100%); color: #fff; border: none;
    border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer;
    font-family: inherit; transition: background .2s; margin-top: 8px;
}
.cta-submit:hover { background: linear-gradient(90deg, #5A0FE0 0%, #0080DD 100%); }

/* === Related Posts === */
.related-posts { margin-top: 60px; }
.related-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.related-header h3 { font-size: 20px; font-weight: 700; }
.related-header a { font-size: 14px; color: #6A14FF; font-weight: 500; }

/* === Error Page === */
.error-page { text-align: center; padding: 120px 24px; }
.error-code { font-size: 96px; font-weight: 700; color: #ddd; }
.error-message { font-size: 18px; color: #666; margin: 16px 0 32px; }
.error-link { color: #6A14FF; font-weight: 500; }

/* === Page Layout === */
.page-layout { max-width: 720px; margin: 0 auto; padding: 60px 24px; }
.page-title { font-size: 36px; font-weight: 700; margin-bottom: 32px; }

/* === Responsive === */
@media (max-width: 900px) {
    .post-layout { grid-template-columns: 1fr; gap: 0; }
    .toc-sidebar { display: none; }
    .post-title { font-size: 28px; }
    .post-content-area { max-width: 100%; }
    .cta-section {
 padding: 32px 24px; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-meta { flex-direction: column; align-items: flex-start; gap: 12px; }
    .index-header h1 { font-size: 24px; }
}

/* === Mobile Navigation (hamburger menu) === */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #1a1a1a;
}
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: flex;
    }
    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .site-logo-img {
        height: 28px;
    }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        z-index: 999;
        padding: 16px 24px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
        border-top: 1px solid #eee;
    }
    .site-nav.is-open {
        display: block;
    }
    .site-nav .nav {
        flex-direction: column;
        gap: 0;
    }
    .site-nav .nav li {
        border-bottom: 1px solid #f0f0f0;
    }
    .site-nav .nav li:last-child {
        border-bottom: none;
    }
    .site-nav .nav li a {
        display: block;
        padding: 12px 0;
        font-size: 15px;
    }
    .header-inner {
        position: relative;
    }
}
@media (min-width: 768px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}
