:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #eff6ff;
    --accent: #f59e0b;
    --bg: #f9fafb;
    --bg-card: #ffffff;
    --text: #111827;
    --text-mid: #374151;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

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

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

a { text-decoration: none; color: inherit; }

/* ─── Header ─── */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: 800;
}

.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.logo-text span {
    color: var(--primary);
}

/* Nav */
.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
    background: var(--primary-light);
}

.search-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-lighter);
    font-size: 13px;
    transition: all 0.2s;
}

.search-toggle:hover { border-color: var(--primary); color: var(--primary); }

.menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}

/* ─── Hero ─── */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #7c3aed 100%);
    color: white;
    padding: 48px 20px;
    text-align: center;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 15px;
    opacity: 0.85;
    max-width: 500px;
    margin: 0 auto 20px;
}

.hero-search {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    background: rgba(255,255,255,0.95);
    color: var(--text);
    outline: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero-search input:focus {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 0 3px rgba(255,255,255,0.3);
}

.hero-search svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-lighter);
}

/* ─── Layout ─── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

/* ─── Blog Post Cards ─── */
.posts { display: flex; flex-direction: column; gap: 24px; }

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: transparent;
}

.post-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
}

.post-body {
    padding: 20px 24px 24px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text-lighter);
}

.post-category {
    background: var(--primary-light);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 11px;
}

.post-body h3 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
    color: var(--text);
}

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

.post-excerpt {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--border-light);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.post-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.post-link-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    transition: gap 0.2s;
}

.read-more:hover { gap: 8px; }

/* ─── Sidebar ─── */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.widget-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Category widget */
.cat-list { list-style: none; }

.cat-list li {
    border-bottom: 1px solid var(--border-light);
}

.cat-list li:last-child { border-bottom: none; }

.cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    font-size: 14px;
    color: var(--text-mid);
    transition: all 0.2s;
}

.cat-list a:hover {
    color: var(--primary);
    padding-left: 8px;
}

.cat-count {
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 11px;
    color: var(--text-lighter);
    font-weight: 600;
}

/* Recent posts widget */
.recent-list { list-style: none; }

.recent-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.recent-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.recent-info h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 2px;
}

.recent-info h4:hover { color: var(--primary); }

.recent-date {
    font-size: 11px;
    color: var(--text-lighter);
}

/* Tags widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    padding: 5px 12px;
    background: var(--border-light);
    border-radius: 50px;
    font-size: 12px;
    color: var(--text-light);
    transition: all 0.2s;
}

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

/* ─── Blog Article Style ─── */
.blog-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

.blog-article .article-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.blog-article .article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 12px;
    color: var(--text-lighter);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.blog-article .article-img {
    width: 100%;
    height: 180px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 20px;
}

.blog-article p {
    font-size: 15px;
    color: var(--text-mid);
    line-height: 1.8;
    margin-bottom: 16px;
}

.blog-article h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin: 28px 0 12px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

.blog-article ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.blog-article ul li {
    font-size: 14px;
    color: var(--text-mid);
    margin-bottom: 6px;
    line-height: 1.7;
}

.blog-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.blog-table thead th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
}

.blog-table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-mid);
}

.blog-table tbody tr:hover {
    background: var(--primary-light);
}

.blog-table tbody tr:last-child td {
    border-bottom: none;
}

.blog-article .highlight-box {
    background: linear-gradient(135deg, var(--primary-light), #ede9fe);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-mid);
    line-height: 1.7;
    border-left: 4px solid var(--primary);
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: var(--border-light);
    border: none;
    padding: 14px 20px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.faq-question:hover { background: var(--primary-light); }

.faq-question::after {
    content: '+';
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
}

.faq-question.open::after { content: '\2212'; }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.open { max-height: 200px; }

.faq-answer p {
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0;
}

.blog-article:nth-child(9) { animation-delay: 0.45s; }
.blog-article:nth-child(10) { animation-delay: 0.5s; }
.blog-article:nth-child(11) { animation-delay: 0.55s; }
.blog-article:nth-child(12) { animation-delay: 0.6s; }

/* Notice widget */
.notice-widget {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-color: #fde68a;
}

.notice-widget p {
    font-size: 13px;
    color: #92400e;
    line-height: 1.6;
}

/* ─── Footer ─── */
footer {
    background: #111827;
    color: #9ca3af;
    margin-top: 48px;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 24px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #1f2937;
}

.footer-col h4 {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }

.footer-col a {
    color: #9ca3af;
    font-size: 13px;
    transition: color 0.2s;
}

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

.footer-bottom {
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
}

/* ─── Back to Top ─── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.back-to-top.visible { opacity: 1; visibility: visible; }

/* ─── Thumb colors ─── */
.thumb-blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.thumb-green { background: linear-gradient(135deg, #dcfce7, #bbf7d0); }
.thumb-purple { background: linear-gradient(135deg, #f3e8ff, #e9d5ff); }
.thumb-red { background: linear-gradient(135deg, #fef2f2, #fecaca); }
.thumb-orange { background: linear-gradient(135deg, #fff7ed, #fed7aa); }
.thumb-pink { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }
.thumb-cyan { background: linear-gradient(135deg, #cffafe, #a5f3fc); }
.thumb-yellow { background: linear-gradient(135deg, #fef9c3, #fde68a); }

/* ─── Search Modal ─── */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    backdrop-filter: blur(4px);
}

.search-overlay.open { display: flex; }

.search-modal {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
}

.search-modal input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.search-modal input:focus { border-color: var(--primary); }

.search-results {
    margin-top: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover { background: var(--primary-light); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }

    .nav-links { display: none; }
    .menu-btn { display: block; }
    .search-toggle { display: none; }

    .hero { padding: 36px 16px; }
    .hero-title { font-size: 22px; }
}

@media (max-width: 480px) {
    .post-body { padding: 16px; }
    .post-body h3 { font-size: 17px; }
    .footer-top { flex-direction: column; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* ─── Animation ─── */
.post-card {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }
.post-card:nth-child(7) { animation-delay: 0.35s; }
.post-card:nth-child(8) { animation-delay: 0.4s; }
