/*
Theme Name: Food Research Archive
Description: 식품 연구 아카이브를 위한 심플하고 세련된 테마
Author: My Custom Theme
Version: 2.0
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: #f0f7ff;
    color: #1a2533;
    font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;
    font-size: 15px;
    line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #2d7dd2; }

/* ===== HEADER ===== */
.site-header {
    background: #ffffff;
    border-bottom: 2px solid #2d7dd2;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(45,125,210,0.08);
}

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

.header-logo a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    line-height: 1.1;
}

.header-logo img {
    height: 50px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.header-logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.35em;
    font-weight: 800;
    color: #2d7dd2;
    letter-spacing: 0.08em;
}

.logo-sub {
    font-size: 0.75em;
    font-weight: 500;
    color: #7aafdd;
    letter-spacing: 0.18em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-switcher {
    display: flex;
    gap: 4px;
}

.lang-btn {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    color: #7aafdd;
    border: 1px solid #c8e0f5;
    transition: all 0.2s;
}

.lang-btn:hover, .lang-btn.active {
    background: #2d7dd2;
    color: #fff;
    border-color: #2d7dd2;
}

.header-search form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-search input[type="search"] {
    border: 1px solid #c8e0f5;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.85em;
    outline: none;
    width: 180px;
    background: #f0f7ff;
    transition: border 0.2s;
}

.header-search input[type="search"]:focus {
    border-color: #2d7dd2;
    background: #fff;
}

.header-search input[type="submit"] {
    background: #2d7dd2;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s;
}

.header-search input[type="submit"]:hover {
    background: #1a5fa8;
}

/* ===== TOP NAV ===== */
.top-nav {
    background: #f0f7ff;
    border-top: 1px solid #dbeeff;
    display: flex;
    gap: 0;
    max-width: 100%;
    padding: 0 24px;
    justify-content: center;
}

.nav-link {
    display: inline-block;
    padding: 8px 20px;
    font-size: 0.88em;
    font-weight: 600;
    color: #4a6fa5;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #2d7dd2;
    border-bottom-color: #2d7dd2;
}

/* ===== LAYOUT ===== */
.site-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 24px;
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 220px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}

.sidebar-widget {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #dbeeff;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(45,125,210,0.06);
}

.widget-title {
    background: #2d7dd2;
    color: #ffffff;
    font-size: 0.9em;
    font-weight: 700;
    padding: 12px 18px;
    letter-spacing: 0.05em;
}

.cat-list {
    list-style: none;
    padding: 8px 0;
}

.cat-item a {
    display: block;
    padding: 8px 18px;
    font-size: 0.88em;
    color: #3a5a8a;
    transition: all 0.18s;
    border-left: 3px solid transparent;
}

.cat-item a:hover {
    background: #eaf4ff;
    color: #2d7dd2;
    border-left-color: #7aafdd;
}

.cat-item.active a {
    background: #e0f0ff;
    color: #2d7dd2;
    font-weight: 700;
    border-left-color: #2d7dd2;
}

.cat-count {
    color: #9ab8d8;
    font-size: 0.85em;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #2d7dd2;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dbeeff;
}

/* ===== POST CARD ===== */
.post-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #dbeeff;
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(45,125,210,0.05);
    transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
    box-shadow: 0 6px 20px rgba(45,125,210,0.13);
    transform: translateY(-2px);
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.post-category a {
    font-size: 0.78em;
    font-weight: 700;
    color: #2d7dd2;
    background: #e0f0ff;
    padding: 2px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.post-date {
    font-size: 0.8em;
    color: #9ab8d8;
}

.post-title {
    font-size: 1.18em;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.45;
}

.post-title a {
    color: #1a2533;
    transition: color 0.18s;
}

.post-title a:hover {
    color: #2d7dd2;
}

.post-excerpt {
    font-size: 0.88em;
    color: #5a7a9a;
    line-height: 1.7;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-block;
    font-size: 0.83em;
    font-weight: 600;
    color: #2d7dd2;
    border: 1px solid #c8e0f5;
    border-radius: 20px;
    padding: 4px 14px;
    transition: all 0.2s;
}

.read-more:hover {
    background: #2d7dd2;
    color: #fff;
    border-color: #2d7dd2;
}

/* ===== SINGLE POST ===== */
.single-post {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #dbeeff;
    padding: 36px 40px;
    box-shadow: 0 2px 8px rgba(45,125,210,0.05);
}

.single-title {
    font-size: 1.7em;
    font-weight: 800;
    color: #1a2533;
    margin: 14px 0 24px;
    line-height: 1.4;
    border-bottom: 2px solid #dbeeff;
    padding-bottom: 20px;
}

.post-body {
    color: #2a3a4a;
    line-height: 1.9;
    font-size: 0.97em;
}

.post-body h1, .post-body h2, .post-body h3 {
    margin: 28px 0 12px;
    color: #1a3a5a;
}

.post-body p { margin-bottom: 16px; }
.post-body ul, .post-body ol { margin: 12px 0 12px 24px; }
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9em;
}
.post-body table th, .post-body table td {
    border: 1px solid #dbeeff;
    padding: 8px 12px;
}
.post-body table th { background: #e0f0ff; font-weight: 700; }

.back-link {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid #dbeeff;
}

.back-link a {
    font-size: 0.88em;
    color: #2d7dd2;
    font-weight: 600;
}

.back-link a:hover { text-decoration: underline; }

/* ===== PAGINATION ===== */
.pagination {
    margin-top: 24px;
    text-align: center;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.88em;
    font-weight: 600;
    color: #2d7dd2;
    border: 1px solid #c8e0f5;
    transition: all 0.2s;
    background: #fff;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: #2d7dd2;
    color: #fff;
    border-color: #2d7dd2;
}

/* ===== NO POSTS ===== */
.no-posts {
    text-align: center;
    color: #9ab8d8;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #dbeeff;
}

/* ===== FOOTER ===== */
.site-footer {
    background: #ffffff;
    border-top: 1px solid #dbeeff;
    margin-top: 48px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.83em;
    color: #9ab8d8;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-inner a {
    color: #2d7dd2;
}

.footer-inner a:hover { text-decoration: underline; }

/* ===== SEARCH RESULTS ===== */
.search-form {
    display: flex;
    gap: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .site-wrapper { flex-direction: column; padding: 0 12px; }
    .sidebar { width: 100%; position: static; }
    .header-inner { padding: 0 12px; }
    .logo-main { font-size: 1.1em; }
    .header-search input[type="search"] { width: 120px; }
    .single-post { padding: 20px 16px; }
    .post-card { padding: 18px 16px; }
    .footer-inner { flex-direction: column; text-align: center; }
}

/* ===== POST TAGS ===== */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 24px 0 16px 0;
    padding: 16px 0;
    border-top: 1px solid #e0e7ef;
}
.post-tags .tags-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7a8d;
    margin-right: 4px;
    white-space: nowrap;
}
.post-tags .tag-item a {
    display: inline-block;
    background: #e8f4fd;
    color: #2d7dd2;
    border: 1px solid #b8d9f5;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 2px 0;
}
.post-tags .tag-item a:hover {
    background: #2d7dd2;
    color: #ffffff;
    border-color: #2d7dd2;
}