/**
 * Custom Additional Styles - Modern Enhancement
 */

/* ==========================================================================
   Advanced Animations
   ========================================================================== */

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(79, 70, 229, 0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==========================================================================
   Category Cards
   ========================================================================== */

.category-card {
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(6, 182, 212, 0.05));
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12) !important;
    border-color: var(--primary-color) !important;
}

.category-card:hover::before {
    opacity: 1;
}

.category-card > * {
    position: relative;
    z-index: 1;
}

/* Category Cards - 모바일 반응형 */
@media (max-width: 768px) {
    .category-cards > div {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
    }
}

/* ==========================================================================
   Page Header (Archive/Category)
   ========================================================================== */

.page-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
    padding: var(--spacing-3xl) var(--spacing-lg);
    background: #fafafa;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.page-title {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

.archive-description {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Comments Section
   ========================================================================== */

.comments-area {
    margin-top: var(--spacing-3xl);
    padding-top: var(--spacing-3xl);
    border-top: 2px solid var(--border-color);
}

.comments-title {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.comments-title::before {
    content: '💬';
    font-size: 1.5em;
}

.comment-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.comment-list li {
    list-style: none !important;
    list-style-type: none !important;
}

.comment-list .children {
    list-style: none !important;
    padding-left: 2rem !important;
    margin: 0 !important;
}

.comment-body {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.comment-body:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.comment-author img {
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
}

.comment-author .fn {
    font-weight: var(--fw-semibold);
    color: var(--text-color);
}

.comment-metadata {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.comment-content {
    margin-top: var(--spacing-md);
    color: var(--text-secondary);
    line-height: 1.7;
}

.reply {
    margin-top: var(--spacing-md);
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--bg-tertiary);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: var(--fw-medium);
    transition: all var(--transition-base);
}

.comment-reply-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

/* Comment Form */
.comment-form {
    background: var(--bg-color);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    margin-top: var(--spacing-xl);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-base);
    font-size: 1rem;
    transition: all var(--transition-base);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-form input[type="submit"] {
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.comment-form input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-3xl);
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: var(--fw-medium);
    transition: all var(--transition-base);
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.page-numbers.dots {
    border: none;
}

.page-numbers.prev,
.page-numbers.next {
    padding: 0 var(--spacing-md);
}

/* ==========================================================================
   Post Navigation - DEPRECATED (이제 사이드바로 이동됨)
   ========================================================================== */

/* 기존 WordPress post-navigation 숨김 */
.post-navigation {
    display: none;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.search-form {
    display: flex;
    gap: var(--spacing-sm);
    margin: var(--spacing-lg) 0;
}

.search-form input[type="search"] {
    flex: 1;
    padding: var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: var(--font-base);
    transition: all var(--transition-base);
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-form button {
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: all var(--transition-base);
}

.search-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Widgets
   ========================================================================== */

.widget {
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: var(--fw-bold);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: var(--text-secondary);
    display: block;
    transition: all var(--transition-base);
}

.widget ul li:hover {
    padding-left: var(--spacing-sm);
}

.widget ul li a:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Error 404 Page
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: var(--spacing-3xl) 0;
}

.error-404 .page-header {
    margin-bottom: var(--spacing-3xl);
}

.error-404 .page-title {
    font-size: clamp(3rem, 10vw, 6rem);
    margin-bottom: var(--spacing-lg);
}

.error-404 .page-content {
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   Post Tags
   ========================================================================== */

.post-tags {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.post-tags strong {
    color: var(--text-color);
    margin-right: var(--spacing-md);
}

.post-tags .tag {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    margin: 0.25rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.post-tags .tag:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */

.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    padding: var(--spacing-md) 0;
    font-size: 0.875rem;
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: color var(--transition-base);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span {
    margin: 0 var(--spacing-xs);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }

/* ==========================================================================
   Dark Mode Support (Optional - for future)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .main-navigation,
    .comments-area,
    .post-navigation {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .post-card,
    .entry-content {
        box-shadow: none;
        border: none;
    }
}

/* ==========================================================================
   Single Post Layout - 3 Column (TOC - Content - Nav)
   ========================================================================== */

.single-post-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 240px;
    gap: 2rem;
    align-items: start !important; /* sticky를 위해 start로 설정 */
    position: relative; /* sticky의 기준점 */
    overflow: visible !important; /* overflow 제거 */
}

/* 부모 컨테이너도 overflow 제거 */
.single-post-layout > * {
    overflow: visible !important;
}

/* Post Content Wrapper - No-Box 원칙: 답답한 박스 제거, 시원한 레이아웃 */
.post-content-wrapper {
    background: transparent;
    padding: 0;
    border-radius: 0;
    border: none;
    box-shadow: none;
    max-width: 900px; /* PC: 900px 중앙 배치 */
    margin: 0 auto;
}

.post-content-wrapper .post-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: var(--fw-bold);
}

.post-content-wrapper .post-categories {
    margin-bottom: 1rem;
}

.post-content-wrapper .post-meta {
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post-content-wrapper .post-featured-image {
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-content-wrapper .post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 본문 내용 스타일 - 큰 글씨 & 시원한 줄간격 */
.post-content-wrapper .entry-content {
    font-size: 19px; /* 가독성 향상을 위한 큰 글씨 */
    line-height: 1.8; /* 시원한 줄간격 */
    color: var(--text-secondary);
    background: transparent; /* No-Box: 배경 제거 */
    padding: 0; /* No-Box: 패딩 제거 */
    border-radius: 0;
    box-shadow: none;
}

.post-content-wrapper .entry-content h2 {
    font-size: 1.75rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
    font-weight: var(--fw-bold);
    scroll-margin-top: 120px; /* 스크롤시 헤더 아래 여백 */
}

.post-content-wrapper .entry-content h3 {
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    font-weight: var(--fw-semibold);
    scroll-margin-top: 120px;
}

.post-content-wrapper .entry-content p {
    margin-bottom: 1.5rem;
}

.post-content-wrapper .entry-content ul,
.post-content-wrapper .entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content-wrapper .entry-content li {
    margin-bottom: 0.5rem;
}

/* Table of Contents Sidebar - 스크롤 따라다니기 */
.toc-sidebar {
    position: -webkit-sticky !important; /* Safari */
    position: sticky !important;
    top: 140px !important; /* 헤더 높이 고려 */
    max-height: calc(100vh - 160px) !important;
    overflow-y: auto !important;
    z-index: 10 !important;
    align-self: flex-start !important; /* sticky가 작동하려면 필요 */
    will-change: transform; /* 성능 최적화 */
}

.toc-wrapper {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem 1.25rem 0.75rem;
    transition: box-shadow var(--transition-base);
}

/* 스크롤 시 살짝 강조 효과 */
.toc-wrapper:hover {
    box-shadow: var(--shadow-md);
}

.toc-title {
    font-size: 0.9375rem;
    font-weight: var(--fw-bold);
    margin: 0 0 0.875rem 0;
    color: var(--text-color);
    padding-bottom: 0.625rem;
    padding-left: 0;
    border-bottom: 2px solid var(--border-color);
}

.toc-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

/* 최상위 ul은 왼쪽에 딱 붙임 */
.toc-nav > ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 중첩된 ul만 들여쓰기 (H3 등) */
.toc-nav ul ul {
    list-style: none;
    padding-left: 0.75rem;
    margin: 0;
}

.toc-nav a {
    display: block;
    padding: 0.5rem 0.75rem 0.5rem 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    text-align: left;
    transition: all var(--transition-base);
    border-left: 3px solid transparent;
    border-radius: var(--radius-sm);
    margin-bottom: 0.125rem;
}

.toc-nav a:hover {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    border-left-color: var(--primary-color);
}

.toc-nav a.active {
    color: var(--primary-color);
    font-weight: var(--fw-semibold);
    background: rgba(79, 70, 229, 0.08);
    border-left-color: var(--primary-color);
}

/* Right Sidebar - Post Navigation - 스크롤 따라다니기 */
.post-nav-sidebar {
    position: -webkit-sticky !important; /* Safari */
    position: sticky !important;
    top: 140px !important; /* 헤더 높이 고려 */
    max-height: calc(100vh - 160px) !important;
    overflow-y: auto !important;
    z-index: 10 !important;
    align-self: flex-start !important; /* sticky가 작동하려면 필요 */
    will-change: transform; /* 성능 최적화 */
}

.post-nav-wrapper {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    transition: box-shadow var(--transition-base);
}

/* 스크롤 시 살짝 강조 효과 */
.post-nav-wrapper:hover {
    box-shadow: var(--shadow-md);
}

.post-nav-title {
    font-size: 0.9375rem;
    font-weight: var(--fw-bold);
    margin: 0 0 0.875rem 0;
    color: var(--text-color);
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--border-color);
}

.nav-item {
    display: block;
    padding: 0.875rem;
    margin-bottom: 0.625rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-base);
}

.nav-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    transform: translateX(-4px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.nav-item:hover .nav-label,
.nav-item:hover .nav-post-title {
    color: white;
}

.nav-label {
    display: block;
    font-size: 0.75rem;
    font-weight: var(--fw-semibold);
    color: var(--text-light);
    margin-bottom: 0.375rem;
}

.nav-post-title {
    display: block;
    font-size: 0.875rem;
    font-weight: var(--fw-medium);
    color: var(--text-color);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Tablet responsive - 화면의 92% 활용 */
@media (max-width: 1200px) and (min-width: 769px) {
    .single-post-layout {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 4%; /* 좌우 4%씩 총 8% 여백 = 92% 활용 */
    }

    .post-content-wrapper {
        max-width: 100%;
    }

    /* 태블릿에서도 sticky 유지 */
    .toc-sidebar,
    .post-nav-sidebar {
        position: sticky;
        top: 80px; /* 태블릿용 헤더 높이 */
        max-height: calc(100vh - 100px);
        margin-bottom: 2rem;
        overflow-y: auto;
    }

    .nav-item:hover {
        transform: translateY(-2px);
    }
}

/* Mobile responsive - 최소 여백으로 꽉 찬 레이아웃 */
@media (max-width: 768px) {
    .single-post-layout {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 12px; /* 좌우 최소 여백 12px */
        gap: 1rem;
    }

    .post-content-wrapper {
        max-width: 100%;
        padding: 0;
    }

    .post-content-wrapper .entry-content {
        font-size: 19px; /* 모바일에서도 큰 글씨 유지 */
        line-height: 1.8;
    }

    /* 모바일에서 목차(TOC) 완전히 숨김 */
    .toc-sidebar {
        display: none !important;
    }

    /* 모바일에서 포스트 네비게이션은 유지 */
    .post-nav-sidebar {
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 1.5rem;
    }

    .nav-item:hover {
        transform: translateY(-2px);
    }

    /* 모바일 상단 카테고리 메뉴 축소 */
    .category-nav {
        padding: 0.5rem 0;
    }

    .category-menu {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding: 0 0.5rem;
        gap: 0.25rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .category-menu::-webkit-scrollbar {
        display: none; /* Chrome, Safari */
    }

    .category-menu li a {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .category-nav .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* 모바일 헤더 축소 */
    .site-header {
        padding: 0.5rem 0;
    }

    .header-main {
        padding: 0.5rem 0;
    }

    .header-content {
        gap: 0.5rem;
    }

    .main-navigation ul {
        gap: 0.25rem;
    }

    .main-navigation a {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Related Posts Section (추천 글 섹션)
   ========================================================================== */

.related-posts-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.related-posts-title {
    font-size: 1.75rem;
    font-weight: var(--fw-bold);
    margin-bottom: 2rem;
    color: var(--text-color);
    text-align: center;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background: var(--bg-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
}

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

.related-post-thumbnail {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.related-post-card:hover .related-post-thumbnail img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-post-categories {
    margin-bottom: 0.75rem;
}

.related-post-title {
    font-size: 1.125rem;
    font-weight: var(--fw-semibold);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.related-post-title a {
    color: var(--text-color);
    transition: color var(--transition-base);
}

.related-post-title a:hover {
    color: var(--primary-color);
}

.related-post-excerpt {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.related-post-meta {
    font-size: 0.875rem;
    color: var(--text-light);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile responsive for related posts */
@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .related-posts-section {
        margin-top: 2.5rem;
        padding-top: 2rem;
    }

    .related-posts-title {
        font-size: 1.375rem;
        margin-bottom: 1.5rem;
    }
}

/* ==========================================================================
   Dark Mode - Custom Overrides
   ========================================================================== */

/* 다크모드: 페이지 헤더 (카테고리, 아카이브) */
body.dark-mode .page-header {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .page-title {
    color: var(--text-color);
}

body.dark-mode .archive-description {
    color: var(--text-secondary);
}

/* 다크모드: 사이드바와 블록 색상 조정 */
body.dark-mode .toc-wrapper,
body.dark-mode .post-nav-wrapper {
    background: rgba(30, 41, 59, 0.5); /* 더 어두운 반투명 */
    border-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .nav-item {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .nav-item:hover {
    background: rgba(79, 70, 229, 0.2); /* 보라색 반투명 */
    border-color: rgba(79, 70, 229, 0.4);
}

body.dark-mode .nav-item:hover .nav-label,
body.dark-mode .nav-item:hover .nav-post-title {
    color: var(--text-color); /* 밝은 텍스트 유지 */
}

/* 다크모드: 포스트 카드 */
body.dark-mode .post-card {
    background: var(--card-bg);
    border-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .post-card:hover {
    border-color: rgba(129, 140, 248, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 다크모드: 관련 글 카드 */
body.dark-mode .related-post-card {
    background: var(--card-bg);
    border-color: rgba(51, 65, 85, 0.5);
}

body.dark-mode .related-post-card:hover {
    border-color: rgba(129, 140, 248, 0.3);
}

/* ==========================================================================
   Background - Clean and Minimal
   ========================================================================== */

/* Clean white background - all effects removed for minimal look */

/* ── 헤더 레이아웃: 로고-카테고리 같은 줄 정렬 ── */
.site-header {
    display: flex !important;
    align-items: flex-end !important;
}
.header-main {
    flex-shrink: 0 !important;
}
.category-nav {
    flex: 1 !important;
    border-bottom: none !important;
    padding-bottom: 0.25rem !important;
}
