/* =====================================================
   Korean Learning Blog - Premium Stylesheet
   외국인 한국어 학습자를 위한 프리미엄 디자인
   ===================================================== */

/* CSS Variables - Korean Traditional Color Palette */
:root {
    /* Background Colors - 한지색 (Traditional Paper) */
    --bg-primary: #fffef9;
    --bg-secondary: #fef9e7;
    --bg-tertiary: #fff8e1;

    /* Brand Colors - 한복색 (Hanbok Colors) */
    --brand-primary: #2563eb;
    /* 청색 - Royal Blue */
    --brand-secondary: #1e1b4b;
    /* 짙은 남색 - Deep Navy */
    --brand-accent: #e11d48;
    /* 단청 빨강 - Traditional Red */
    --brand-gold: #f59e0b;
    /* 황금색 - Gold */

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* UI Colors */
    --border-color: #e8e4d9;
    --accent-color: var(--brand-primary);
    --accent-hover: #1d4ed8;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(37, 99, 235, 0.08);
    --shadow-lg: 0 12px 28px rgba(37, 99, 235, 0.12);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Layout */
    --header-height: 180px;
    --nav-height: 64px;
}

/* Dark Mode - 야간 학습 모드 */
[data-theme="dark"] {
    --bg-primary: #0c0a1d;
    --bg-secondary: #1a1744;
    --bg-tertiary: #241f5a;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #312e81;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

img {
    max-width: 100%;
    height: auto;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =====================================================
   Header - 한국어 학습 블로그 헤더
   ===================================================== */
.site-header {
    background: linear-gradient(135deg, var(--brand-secondary) 0%, #312e81 40%, var(--brand-primary) 100%);
    padding: 50px 20px;
    text-align: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

/* Decorative Korean Pattern Background */
.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 10% 20%, rgba(225, 29, 72, 0.15) 0%, transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(37, 99, 235, 0.2) 0%, transparent 30%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Floating Korean Characters Decoration */
.site-header::after {
    content: '한 글';
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 6rem;
    font-weight: 900;
    opacity: 0.06;
    letter-spacing: 0.5rem;
    pointer-events: none;
    font-family: 'Nanum Myeongjo', serif;
}

.header-content {
    position: relative;
    z-index: 1;
}

.site-logo {
    display: inline-block;
}

.site-logo h1 {
    font-family: 'Nanum Myeongjo', 'Noto Sans KR', serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.site-logo .subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Badge for learning blog */
.site-logo .subtitle::before {
    content: '🇰🇷 ';
}

/* =====================================================
   Navigation
   ===================================================== */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    margin: 4px 0;
    transition: 0.3s;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    display: block;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle,
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.theme-toggle:hover,
.search-toggle:hover {
    background: var(--bg-secondary);
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

.admin-link {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-sm);
    transition: background 0.2s, color 0.2s;
}

.admin-link:hover {
    background: var(--accent-color);
    color: white;
}

/* =====================================================
   Search Modal
   ===================================================== */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    backdrop-filter: blur(4px);
}

.search-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.search-modal-content {
    background: var(--bg-primary);
    width: 100%;
    max-width: 600px;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.search-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-form input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.search-form button {
    padding: 12px 24px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.search-form button:hover {
    opacity: 0.9;
}

/* =====================================================
   Main Content
   ===================================================== */
.main-content {
    min-height: calc(100vh - var(--header-height) - var(--nav-height) - 100px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    align-items: start;
}

.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* =====================================================
   Post Cards - Korean Learning Lesson Style
   ===================================================== */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 50px;
}

.post-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    border-left: 5px solid var(--brand-primary);
    overflow: hidden;
}

/* Decorative corner accent */
.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, transparent 50%, var(--bg-secondary) 50%);
    opacity: 0.5;
    transition: opacity 0.3s;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--brand-accent);
}

.post-card:hover::before {
    opacity: 1;
    background: linear-gradient(135deg, transparent 50%, rgba(225, 29, 72, 0.1) 50%);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.post-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 14px;
    background: linear-gradient(135deg, var(--brand-primary), #3b82f6);
    color: #ffffff;
    border-radius: 20px;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-title {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.post-title a {
    transition: color 0.3s;
}

.post-title a:hover {
    color: var(--brand-primary);
}

.post-excerpt {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.7;
}

.read-more {
    margin-top: auto;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand-primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    transition: gap 0.3s, color 0.3s;
}

.read-more::after {
    content: '→';
    font-size: 1.1rem;
    transition: transform 0.2s;
}

.read-more:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

/* =====================================================
   Sidebar
   ===================================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.widget-list {
    list-style: none;
}

.widget-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.widget-list li:last-child {
    border-bottom: none;
}

.widget-list a {
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: block;
}

.widget-list a:hover {
    color: var(--accent-color);
}

.comments-list .comment-author {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.sidebar-search {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sidebar-search input {
    flex: 1;
    min-width: 140px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.sidebar-search button {
    padding: 10px 16px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* =====================================================
   Single Post
   ===================================================== */
.post-single {
    background: var(--bg-primary);
    margin-bottom: 40px;
}

.post-header {
    margin-bottom: 24px;
}

.post-header .post-meta {
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.post-header .post-meta svg {
    vertical-align: middle;
    margin-right: 4px;
}

.post-single .post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-featured-image {
    margin-bottom: 30px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--text-primary);
    margin: 32px 0 16px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content img {
    border-radius: var(--radius-sm);
    margin: 20px 0;
}

.post-content a {
    color: var(--accent-color);
    text-decoration: underline;
}

.post-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 20px 0;
}

.post-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 20px;
    margin: 20px 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.post-navigation a {
    display: block;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.post-navigation a:hover {
    background: var(--border-color);
}

.nav-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.nav-title {
    font-weight: 500;
    color: var(--text-primary);
}

.nav-next {
    text-align: right;
}

/* =====================================================
   Comments
   ===================================================== */
.comments-section {
    background: var(--bg-primary);
    margin-bottom: 40px;
}

.comments-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.comments-list {
    margin-bottom: 40px;
}

.comment {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.comment-body {
    flex: 1;
    min-width: 0;
}

/* Replies container should take full width on new line */
.replies {
    flex-basis: 100%;
    margin-top: 16px;
    margin-left: 40px;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

/* Nested replies (depth 2+) should not indent further */
.replies .replies {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

.comment:last-child {
    border-bottom: none;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-website {
    color: var(--accent-color);
}

.comment-date {
    color: var(--text-muted);
}

.comment-content {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Reply button */
.reply-btn {
    font-size: 0.85rem;
    color: var(--accent-color);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    font-weight: 500;
}

.reply-btn:hover {
    text-decoration: underline;
}

/* @Mention highlighting */
.comment-content .mention {
    color: var(--accent-color);
    font-weight: 500;
    background: rgba(139, 69, 19, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Dynamic reply form */
.reply-form-dynamic {
    margin-top: 16px;
    margin-bottom: 16px;
}

.reply-form-dynamic .form-title {
    font-size: 1rem;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Comment Form */
.comment-form-wrapper {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--radius-md);
}

.form-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.form-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.form-group.checkbox input {
    width: auto;
    margin-top: 3px;
}

.form-group.checkbox label {
    margin-bottom: 0;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* =====================================================
   Buttons
   ===================================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* =====================================================
   Pagination
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s;
}

.page-link:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
}

.page-link.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.page-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--text-muted);
}

/* =====================================================
   Flash Messages
   ===================================================== */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    margin-left: auto;
}

/* =====================================================
   Footer - Korean Learning Blog Theme
   ===================================================== */
.site-footer {
    background: linear-gradient(135deg, var(--brand-secondary) 0%, #312e81 100%);
    color: #ffffff;
    padding: 40px 20px;
    text-align: center;
    position: relative;
}

.site-footer::before {
    content: '가 나 다';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    font-weight: 900;
    opacity: 0.03;
    letter-spacing: 2rem;
    pointer-events: none;
    font-family: 'Nanum Myeongjo', serif;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-tagline {
    font-family: 'Nanum Myeongjo', serif;
    font-size: 1.1rem;
    margin-bottom: 12px;
    opacity: 0.9;
    letter-spacing: 1px;
}

.footer-content p {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* =====================================================
   Back to Top - Korean Theme
   ===================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--brand-primary), #3b82f6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 100;
}

.back-to-top.visible {
    display: flex;
}

.back-to-top:hover {
    background: #6b3410;
    transform: translateY(-2px);
}

/* =====================================================
   Korean Lesson Components (Premium Edition)
   ===================================================== */
.korean-lesson {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
}

.lesson-header {
    text-align: center;
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--brand-secondary) 0%, #16213e 50%, var(--brand-primary) 100%);
    border-radius: var(--radius-lg);
    color: #ffffff;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 4rem 0 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--brand-accent);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.vocab-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.vocab-table th {
    background: var(--bg-secondary);
    padding: 1.25rem;
    font-weight: 600;
    text-align: left;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.vocab-table td {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.vocab-table tr:hover td {
    background: #fdfaf3;
}

.korean-word {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--brand-primary);
}

.text-block {
    background: #ffffff;
    padding: 2rem;
    border-radius: var(--radius-md);
    border-left: 5px solid var(--brand-primary);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.text-block .korean {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--brand-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.text-block .english {
    color: var(--text-secondary);
    font-style: italic;
}

.cultural-notes {
    background: #fcf8e8;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid #f2e7c3;
    margin: 4rem 0;
}

.cultural-notes h3 {
    color: #856404;
    margin-top: 0;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 900px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .site-logo h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 600px) {
    .site-logo h1 {
        font-size: 2rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    .nav-links.active {
        display: flex;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-single .post-title {
        font-size: 1.5rem;
    }

    .sidebar-widget {
        margin-bottom: 30px;
    }
}

/* =====================================================
   Pagination
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: background 0.2s, border-color 0.2s;
}

.page-link:hover {
    background: var(--bg-secondary);
    border-color: var(--text-muted);
}

.page-link.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.page-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--text-muted);
}

/* =====================================================
   Flash Messages
   ===================================================== */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 150;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flash-message {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
}

.flash-error {
    background: #fee2e2;
    color: #991b1b;
}

.flash-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    margin-left: auto;
}

/* =====================================================
   Footer
   ===================================================== */
.site-footer {
    background: var(--text-primary);
    color: var(--bg-secondary);
    padding: 30px 20px;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* =====================================================
   Back to Top
   ===================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #8b4513;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s, background 0.2s;
    z-index: 100;
}

.back-to-top.visible {
    display: flex;
}

.back-to-top:hover {
    background: #6b3410;
    transform: translateY(-2px);
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 900px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .site-logo h1 {
        font-size: 2rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    .nav-links.active {
        display: flex;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .post-single .post-title {
        font-size: 1.5rem;
    }

    .post-single .sidebar-widget {
        margin-bottom: 30px;
    }
}

/* =====================================================
   Mobile Post Layout Ordering
   ===================================================== */
@media (max-width: 768px) {

    /* content-wrapper를 flexbox로 변경 */
    .content-wrapper {
        display: flex;
        flex-direction: column;
    }

    /* 1. 포스트 내용 - 제일 위 */
    .post-single {
        order: 1;
    }

    /* 2. 댓글 섹션 - 두 번째 */
    .comments-section {
        order: 2;
        margin-top: 40px;
        margin-bottom: 40px;
    }

    /* 3. 사이드바 - 세 번째 */
    .sidebar {
        order: 3;
        width: 100%;
        max-width: 100%;
    }
}

/* Honeypot spam prevention - hidden field */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}