/* === 기본 스타일 === */

/* Pretendard 폰트 설정 */
@font-face {
    font-family: 'Pretendard';
    src: url('https://fastly.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;  /* 폰트 로딩 최적화 */
}

/* 색상 변수 설정 */
:root {
    --background-color: #ffffff;
    --text-color: #1d1d1f;
    --accent-color: #0071e3;
    --secondary-color: #86868b;
    --card-background: #f5f5f7;
    --header-background: rgba(255, 255, 255, 0.8);
    --link-color: #0071e3;
    --link-hover-color: #005bb5;
    --blockquote-border: #0071e3;
    --footer-background: #f5f5f7;
    --font-main: 'Pretendard';
}

body.dark-mode {
    --background-color: #1d1d1f;
    --text-color: #f5f5f7;
    --accent-color: #2997ff;
    --secondary-color: #a1a1a6;
    --card-background: #2c2c2e;
    --header-background: rgba(29, 29, 31, 0.8);
    --link-color: #2997ff;
    --link-hover-color: #1e6fd8;
    --blockquote-border: #2997ff;
    --footer-background: #2c2c2e;
}

/* 공통 스타일 초기화 */
/* 기본 타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* all 페이지 예외 처리 */
.all-posts-page * {
    margin: initial;
    padding: initial;
    box-sizing: initial;
}

/* all 페이지에서 필요한 특정 요소만 스타일 재정의 */
.all-posts-page .specific-element {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 기존 스타일 초기화 이후에 추가 */
p {
    margin-bottom: 1em;
    line-height: 1.6; /* 가독성을 위해 줄 간격 조절 */
}


/* 본문 스타일 */
body {
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.2s ease;
    will-change: background-color;
}

/* 컨테이너 설정 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 헤더 스타일 */
header {
    background-color: var(--header-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
    padding: 0 22px;
}

/* 헤더의 로고 (데스크톱) */
header .container .logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

/* 모바일 네비게이션 상단 로고 */
.mobile-nav-top .logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--accent-color);
    text-decoration: none;
}

/* 데스크톱 네비게이션 */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-menu li a {
    font-family: 'Pretendard';
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-color);
    text-decoration: none;
    padding: 8px 0;
    opacity: 0.8;
    transition: all 0.2s ease;
    position: relative;
}

.nav-menu li a:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* 현재 페이지 표시 */
.nav-menu li a.active {
    opacity: 1;
    color: var(--accent-color);
}

.dark-mode-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--text-color);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle svg {
    width: 20px;
    height: 20px;
}

/* 아이콘 표시/숨김 */
body:not(.dark-mode) .moon-icon,
body.dark-mode .sun-icon {
    display: none;
}

body:not(.dark-mode) .sun-icon,
body.dark-mode .moon-icon {
    display: block;
}

/* 햄버거 메뉴 버튼 완벽한 스타일링 */
.mobile-menu-toggle {
    position: relative;
    width: 18px;
    height: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--text-color);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
                opacity 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* 각 선의 위치 정확하게 설정 */
.mobile-menu-toggle span:nth-child(1) {
    top: 0;
}

.mobile-menu-toggle span:nth-child(2) {
    top: 5px;
}

.mobile-menu-toggle span:nth-child(3) {
    top: 10px;
}

/* X 모양으로 변환 시 완벽한 애니메이션 */
body.menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

body.menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
    transform: translateX(-4px);
}

body.menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* 호버 효과 추가 */
.mobile-menu-toggle:hover span {
    opacity: 0.7;
}

.mobile-nav-top {
    display: none;
    height: 44px;
    padding: 0 16px;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1002;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 모바일 네비게이션 */
.mobile-nav {
    display: block;
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: 999;
    padding: 80px 20px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* 메뉴 리스트 스타일 */
.mobile-nav .nav-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
    padding: 20px;
}

/* 메뉴 아이템 스타일 */
.mobile-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
    background-color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mobile-nav .nav-link:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 메뉴 아이콘 스타일 */
.menu-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
}

/* 다크모드 대응 */
body.dark-mode .mobile-nav {
    background-color: rgba(29, 29, 31, 0.85);
}

body.dark-mode .nav-link {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

/* 활성 메뉴 스타일 */
.nav-link.active {
    background-color: var(--accent-color);
    color: white;
}

/* 애니메이션 */
.mobile-nav .nav-menu li {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

body.menu-open .mobile-nav .nav-menu li {
    opacity: 1;
    transform: translateY(0);
}

/* 각 메뉴 아이템 지연 애니메이션 */
body.menu-open .mobile-nav .nav-menu li:nth-child(1) { transition-delay: 0.1s; }
body.menu-open .mobile-nav .nav-menu li:nth-child(2) { transition-delay: 0.15s; }
body.menu-open .mobile-nav .nav-menu li:nth-child(3) { transition-delay: 0.2s; }
body.menu-open .mobile-nav .nav-menu li:nth-child(4) { transition-delay: 0.25s; }
body.menu-open .mobile-nav .nav-menu li:nth-child(5) { transition-delay: 0.3s; }

/* 모바일 메뉴 열린 상태 */
body.menu-open .mobile-nav {
    top: 0;
}

/* 헤딩 스타일 */
h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(45deg, var(--accent-color), #00c6fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 30px;
}

h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 40px;
}

/* 히어로 섹션 */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

/* 최신 포스트 및 카테고리 그리드 */
.latest-posts, .category-grid {
    padding: 2rem 0;
    margin-bottom: 2rem;
}

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

/* 포스트 카드 및 카테고리 카드 */
.post-card, .category-card {
    background-color: var(--card-background);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
}

.post-card:hover, .category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-card picture, .category-card picture {
    flex-shrink: 0;
}

.post-card img, .category-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-card h3, .category-card h3 {
    font-size: 1.5rem;
    padding: 20px;
}

.post-card p, .category-card p {
    padding: 0 20px 20px;
    color: var(--secondary-color);
    flex-grow: 1;
}

/* 푸터 스타일 */
footer {
    background-color: var(--footer-background);
    color: var(--secondary-color);
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* === 추가된 스타일 === */

/* 포스트 메타 정보 스타일링 */
.post-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.post-meta .meta-item {
    display: flex;
    align-items: center;
}

.post-meta .icon {
    width: 16px;
    height: 16px;
    fill: var(--accent-color);
    margin-right: 5px;
}

.post-meta .meta-separator {
    margin: 0 10px;
    color: var(--secondary-color);
}

/* 포스트 내용의 최대 너비 및 중앙 정렬 */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* 포스트 내용 내 이미지 스타일 */
.post-content img {
    max-width: 100% !important;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 포스트 내 figure 요소 스타일 */
.post-content figure {
    margin: 20px 0;
    text-align: center;
}

/* 이미지 캡션 스타일 */
.post-content figcaption {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 8px;
}

/* 인용문 스타일 */
.post-content blockquote {
    margin: 20px 0;
    padding: 10px 20px;
    border-left: 4px solid var(--accent-color);
    background-color: rgba(0, 0, 0, 0.03);
    font-style: italic;
}

/* 링크 스타일 */
.post-content a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* 포스트 내 리스트 스타일 */
.post-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.post-content ul li {
    margin-bottom: 10px;
    list-style-type: disc;
}

/* 포스트 내 헤더 스타일 */
.post-content h1, .post-content h2, .post-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 700;
}

/* === 반응형 스타일 === */
@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .mobile-nav-top {
        display: flex;  /* 모바일에서만 표시 */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    .mobile-nav {
        display: block;  /* 모바일에서만 표시 */
    }

    header .container {
        display: none;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .hero {
        padding: 60px 0;
    }

    .latest-posts, .category-grid {
        padding: 30px 0;
    }

    .post-card img, .category-card img {
        height: 180px;
    }

    .post-content {
        max-width: 100%;
        padding: 10px;
    }

    .post-content p {
        font-size: 1rem;
    }

    .post-content h1 {
        font-size: 2rem;
    }

    .post-content h2 {
        font-size: 1.8rem;
    }

    .post-content h3 {
        font-size: 1.6rem;
    }

    .mobile-nav .nav-menu li a {
        width: 180px;
        font-size: 1rem;
    }
}

body.menu-open {
    overflow: hidden;
}

/* Daily 페이지 스타일 */
.daily-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
}

.daily-header {
    text-align: center;
    margin-bottom: 60px;
}

.daily-header h1 {
    font-size: 40px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.daily-header .subtitle {
    font-size: 19px;
    color: var(--secondary-color);
    line-height: 1.4;
}

/* 그리드 레이아웃 */
.daily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* 데일리 카드 스타일 */
.daily-card {
    background-color: var(--background-color);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.daily-card:hover {
    transform: translateY(-4px);
}

.daily-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.daily-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 데일리 카드 콘텐츠 */
.daily-content {
    padding: 20px;
    flex-grow: 1;
}

.daily-content h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
}

.daily-content h2 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.daily-content h2 a:hover {
    color: var(--accent-color);
}

.daily-content .summary {
    font-size: 14px;
    line-height: 1.5;
    color: var(--secondary-color);
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daily-meta {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

/* 더 보기 버튼 스타일 개선 */
.read-more {
    font-size: 14px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.read-more:hover {
    opacity: 0.7;
}

.read-more::after {
    content: '→';
    transition: transform 0.2s ease;
}

.read-more:hover::after {
    transform: translateX(4px);
}

.daily-meta {
    font-size: 14px;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.daily-content h2 {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.3;
}

.daily-content h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.daily-content p {
    font-size: 14px;
    line-height: 1.4;
    color: var(--secondary-color);
}

.daily-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tags {
    display: flex;
    gap: 8px;
}

.tag {
    font-size: 13px;
    color: var(--accent-color);
}

.read-more {
    font-size: 14px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
}

/* 페이지네이션 스타일 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a {
    padding: 8px 16px;
    border-radius: 6px;
    background-color: var(--card-background);
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.pagination a:hover {
    background-color: var(--accent-color);
    color: white;
}

/* 다크모드 대응 */
body.dark-mode .daily-card {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .daily-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .daily-container {
        padding: 60px 20px;
    }

    .daily-header h1 {
        font-size: 32px;
    }

    .daily-header .subtitle {
        font-size: 17px;
    }

    .daily-grid {
        grid-template-columns: 1fr;
    }
}

/* 포스트 태그 스타일 */
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

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

.post-tags .tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: var(--card-background);
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.post-tags .tag:hover {
    background-color: var(--accent-color);
    color: white;
}

/* 다크모드 대응 */
body.dark-mode .post-tags {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 이미지 링크 스타일 */
.daily-image-link {
    display: block;
    overflow: hidden;
}

.daily-image-link:hover img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

/* 포스트 메타 정보 스타일링 */
.post-meta {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-meta .icon {
    width: 16px;
    height: 16px;
    color: var(--accent-color);
}

.post-meta time {
    font-size: 14px;
}

/* 다크모드 대응 */
body.dark-mode .post-meta .icon {
    color: var(--accent-color);
}

/* 포스트 컨테이너 스타일 */
.post {
    max-width: 800px;
    margin: 80px auto;
    padding: 0 24px;
}

/* 포스트 제목 */
.post h1 {
    font-size: 36px;
    font-weight: 600;
    letter-spacing: -0.5px;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text-color);
}

/* 메타 정보 (날짜) */
.post-meta {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-meta .icon {
    width: 18px;
    height: 18px;
    color: var(--accent-color);
}

.post-meta time {
    font-size: 15px;
    color: var(--secondary-color);
}

/* 포스트 내용 */
.post-content {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-color);
}

.post-content p {
    margin-bottom: 24px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px 0;
}

/* 태그 스타일 */
.post-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

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

.post-tags .tag {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background-color: var(--card-background);
    color: var(--accent-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.post-tags .tag:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-1px);
}

/* 다크모드 대응 */
body.dark-mode .post-meta {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .post-tags {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 타이포그래피 개선 */
.post h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 48px 0 24px;
    letter-spacing: -0.5px;
}

.post h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 32px 0 16px;
    letter-spacing: -0.3px;
}

.post ul, .post ol {
    margin: 24px 0;
    padding-left: 24px;
}

.post li {
    margin-bottom: 12px;
}

/* 인용문 스타일 */
.post blockquote {
    margin: 20px 0;
    padding: 10px 20px;
    border-left: 4px solid var(--accent-color);
    background-color: rgba(0, 0, 0, 0.03);
    font-style: italic;
}

/* 반응형 조정 */
@media (max-width: 768px) {
    .post {
        margin: 60px auto;
        padding: 0 20px;
    }

    .post h1 {
        font-size: 28px;
    }

    .post-content {
        font-size: 16px;
    }

    .post h2 {
        font-size: 24px;
        margin: 36px 0 18px;
    }

    .post h3 {
        font-size: 20px;
        margin: 24px 0 12px;
    }
}


/* 맨 위로 버튼 스타일 */
#back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

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

#back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#back-to-top svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    #back-to-top {
        right: 20px;
        bottom: 20px;
        width: 35px;
        height: 35px;
    }

    #back-to-top svg {
        width: 16px;
        height: 16px;
    }
}

/* 포스트 메타 정보 스타일링 */
.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;  /* 양쪽 정렬 */
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 15px;
    color: var(--secondary-color);
}

.post-meta .meta-left {
    display: flex;
    align-items: center;
}

.post-meta .meta-right {
    display: flex;
    align-items: center;
}

.post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-meta .icon {
    width: 18px;
    height: 18px;
    color: var(--accent-color);
}

.post-meta .category {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.post-meta .category:hover {
    opacity: 0.7;
}

/* 다크모드 대응 */
body.dark-mode .post-meta {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .post-meta {
        font-size: 14px;
    }
    
    .post-meta .icon {
        width: 16px;
        height: 16px;
    }
}

/* 메인 페이지 스타일 */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
}

/* 최근 게시물 섹션 */
.recent-posts {
    padding: 2rem 0;
    background-color: var(--background-color);
    margin-bottom: 2rem;
}

.recent-posts h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 30px;
}

.post-list {
    list-style: none;
    padding: 0;
    max-width: 800px;
    margin: 0 auto;
}

.post-item {
    margin-bottom: 0.8rem;
}

.post-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.8rem 0;
    text-decoration: none;
    border-bottom: 1px solid #e5e5e5;  /* 라이트 모드에서의 밑줄 색상 */
    transition: all 0.2s ease;
}

/* 다크모드일 때 */
body.dark-mode .post-link {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);  /* 다크 모드에서의 밑줄 색상 */
}

.post-link:hover {
    transform: translateX(10px);
    border-bottom-color: var(--accent-color);
}

.post-link:hover .post-title {
    color: var(--accent-color);
}

.post-title {
    color: var(--text-color);
    font-size: 1rem;
    margin-right: 1rem;
    transition: color 0.2s ease;
}

.post-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-family: var(--mono-font);
}

/* 다크모드 대응 */
body.dark-mode .post-link {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .post-link:hover {
    border-bottom-color: var(--accent-color);
}

/* 반응형 */
@media (max-width: 768px) {
    .hero {
        padding: 80px 0 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .recent-posts {
        padding: 40px 0;
    }

    .recent-posts h2,
    .categories h2 {  /* 카테고리 제목 추가 */
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .post-link {
        padding: 0.6rem 0;
    }

    .post-title {
        font-size: 0.95rem;
    }

    .post-date {
        font-size: 0.85rem;
    }

    .post-link:hover {
        transform: none;
    }
    
}

/* 카테고리 섹션 스타일 */
.category-grid h2 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 30px;
}

/* 반응형 */
@media (max-width: 768px) {
    .category-grid h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* 모바일 네비게이션 상단 */
.mobile-nav-top {
    display: none;
    height: 44px;
    padding: 0 16px;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1002;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 모바일 대응 */
/* 모바일 네비게이션 상단 */
.mobile-nav-top {
    display: none;
    height: 44px;
    padding: 0 16px;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1002;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .mobile-nav-top {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background-color: var(--header-background);
        backdrop-filter: blur(10px); /* 블러 효과 감소 */
        -webkit-backdrop-filter: blur(10px);
        background-color: rgba(var(--header-background-rgb), 0.85); /* 배경 더 불투명하게 */
    }

    /* Safari에서의 블러 효과를 위한 추가 설정 */
    @supports (-webkit-backdrop-filter: none) {
        .mobile-nav-top {
            -webkit-backdrop-filter: blur(10px);
        }
    }

    /* Firefox에서의 블러 효과를 위한 대체 스타일 */
    @supports not (backdrop-filter: blur(10px)) {
        .mobile-nav-top {
            background-color: rgba(var(--header-background-rgb), 0.9);
        }
    }
}

/* 다크모드에서 약간 다르게 처리 */
[data-theme="dark"] .mobile-nav-top {
    @media (max-width: 768px) {
        background-color: rgba(var(--header-background-rgb), 0.9);
    }
}

/* 검색 페이지 스타일 */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.search-header {
    text-align: center;
    margin-bottom: 3rem;
}

.search-header h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

#searchInput {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.2);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-color);
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.search-results {
    margin-top: 2rem;
}

.search-result {
    display: block;
    text-decoration: none;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.2);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease;
    animation: fadeIn 0.3s ease forwards;
}

.search-result:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.search-result-header {
    margin-bottom: 1rem;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--secondary-color);
}

.section-icon {
    width: 1rem;
    height: 1rem;
    color: var(--secondary-color);
    flex-shrink: 0;
}

.search-result-category {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-right: 0.75rem;
    border-right: 1px solid var(--border-color);
}

.search-result time {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin: 0;
    padding: 0;
    line-height: 1;
}

.search-result h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--text-color);
    line-height: 1.4;
}

.search-result p {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--secondary-color);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.2);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* 검색 결과 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 다크모드 대응 */
[data-theme="dark"] #searchInput,
[data-theme="dark"] .search-result,
[data-theme="dark"] .no-results {
    background: rgba(20, 20, 20, 0.45);
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] #searchInput:focus,
[data-theme="dark"] .search-result:hover {
    background: rgba(30, 30, 30, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
}


/* Footer 하단 고정 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* Footer 스타일 */
footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 15px;  /* 패딩 조정 */
    text-align: center;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

footer p {
    font-size: 0.8rem;  /* 텍스트 크기 감소 */
    color: var(--secondary-color);
    margin: 0;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--text-color);
}

/* 다크모드 대응 */
[data-theme="dark"] footer {
    background: rgba(20, 20, 20, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 이전/다음 글 네비게이션 */
.post-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-previous,
.nav-next {
    padding: 0.5rem 0;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: color 0.2s ease;
    flex: 0 0 auto;  /* 크기 고정 */
}

.nav-previous {
    margin-right: auto;  /* 왼쪽 정렬 */
}

.nav-next {
    margin-left: auto;  /* 오른쪽 정렬 */
}

.nav-previous:hover,
.nav-next:hover {
    color: var(--accent-color);
}

/* 모바일에서도 동일한 레이아웃 유지 */
@media (max-width: 768px) {
    .nav-links {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    
    .nav-previous {
        text-align: left;
        margin-right: auto;
    }
    
    .nav-next {
        text-align: right;
        margin-left: auto;
    }
}

/* 전체 레이아웃 구조 */
body {
    padding-top: 44px; /* 헤더 높이만큼 body에 패딩 추가 */
}

/* 헤더 스타일 */
header {
    background-color: var(--header-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 44px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
/* Chrome에서 더보기 화살표 아이콘 제거 */
@media screen and (-webkit-min-device-pixel-ratio:0) {
    a.read-more svg.icon {
        display: none !important;
    }
}

/* 404 페이지 전용 스타일 */
.error-page-404 {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
}

.error-content-404 {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.error-code-404 {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-color) 0%, #5c6bc0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.error-message-404 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* h1, h2 스타일 초기화 및 크기 조정 */
.error-title-404 {
    all: unset;
    display: block;
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 500;
}

.error-desc-404 {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
}

.home-button-404 {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.home-button-404:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 홈 버튼 아이콘 스타일 */
.home-icon-404 {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    fill: currentColor !important;
}

.home-icon-404 path {
    fill: currentColor !important;
}

/* 다크모드 대응 */
body.dark-mode .home-button-404 {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .error-code-404 {
        font-size: 4rem;
    }
    
    .error-title-404 {
        font-size: 0.9rem;
    }
    
    .error-desc-404 {
        font-size: 0.8rem;
    }

    .home-button-404 {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .home-icon-404 {
        width: 12px !important;
        height: 12px !important;
        min-width: 12px !important;
        min-height: 12px !important;
    }
}

/* 404 페이지 스타일 */
.error-page {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    padding-top: 8rem;  /* 상단 여백 추가 */
    padding-bottom: 5rem;  /* 하단 여백 추가 */
}

.error-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;  /* 모바일에서 전체 너비 사용 */
    max-width: 500px;  /* 최대 너비 제한 */
    padding: 0 1rem;  /* 좌우 여백 */
}

.error-code {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-color) 0%, #5c6bc0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;  /* 모바일에서 전체 너비 사용 */
}

.error-title {
    all: unset;
    display: block;
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
    font-weight: 500;
    width: 100%;  /* 모바일에서 전체 너비 사용 */
}

.error-desc {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin: 0 0 1rem 0;
    width: 100%;  /* 모바일에서 전체 너비 사용 */
}

.error-page .home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;  /* 중앙 정렬 */
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    min-width: 140px;  /* 최소 너비 설정 */
}

.error-page .home-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.error-page .home-icon {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    fill: currentColor !important;
}

.error-page .home-icon path {
    fill: currentColor !important;
}

/* 다크모드 대응 */
body.dark-mode .error-page .home-button {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .error-page {
        padding-top: 4rem;  /* 모바일에서 상단 여백 더 추가 */
        min-height: calc(100vh - var(--header-height) - var(--footer-height) - 2rem);  /* 모바일에서 높이 조정 */
    }

    .error-code {
        font-size: 4rem;
    }
    
    .error-title {
        font-size: 0.9rem;
    }
    
    .error-desc {
        font-size: 0.8rem;
    }

    .error-page .home-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        width: 100%;  /* 모바일에서 버튼 전체 너비 */
        max-width: 200px;  /* 버튼 최대 너비 제한 */
    }

    .error-page .home-icon {
        width: 12px !important;
        height: 12px !important;
        min-width: 12px !important;
        min-height: 12px !important;
    }
}

/* 작은 모바일 화면 대응 */
@media (max-width: 360px) {
    .error-page {
        padding-top: 3rem;
    }

    .error-code {
        font-size: 3.5rem;
    }
}

/* 프로그레스 바 컨테이너 */
.progress-container {
    position: fixed;
    left: 0;
    z-index: 1001;
    width: 100%;
    height: 3px;
    background: transparent;
    top: 44px; /* 헤더 높이와 동일하게 설정 */
}

/* 프로그레스 바 */
.progress-bar {
    height: 100%;
    width: 0%;
    background: #0066FF;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.5);
    transition: width 0.1s ease;
}

/* 다크모드 대응 */
[data-theme="dark"] .progress-bar {
    background: #3385FF;
    box-shadow: 0 0 10px rgba(51, 133, 255, 0.5);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .progress-container {
        height: 2px;
        position: fixed;
        left: 0;
        right: 0;
        margin: 0;
        padding: 0;
    }
    
    /* 모바일 메뉴가 열려있을 때는 프로그레스 바 숨김 */
    body.menu-open .progress-container {
        display: none;
    }
}

/* 코드 블록 컨테이너 */
.code-container {
    position: relative;
    margin: 2rem 0;
}

/* 코드 블록 기본 스타일 */
pre {
    position: relative;
    background: var(--card-background);
    border-radius: 12px;
    padding: 3rem 1.5rem 1.5rem;
    margin: 0;
    overflow-x: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    counter-reset: line;
    max-height: 400px;
    overflow-y: hidden;
    transition: max-height 0.3s ease;
}

pre.expanded {
    max-height: none;
}

/* 코드 스타일 */
pre code {
    font-family: 'Fira Code', 'SFMono-Regular', Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    display: block;
    color: var(--text-color);
    tab-size: 2;
}

/* 라인 넘버 */
pre code > span {
    display: block;
    counter-increment: line;
}

pre code > span::before {
    content: counter(line);
    display: inline-block;
    width: 1.5rem;
    margin-right: 1.5rem;
    color: var(--secondary-color);
    text-align: right;
    opacity: 0.5;
}

/* 코드 복사 버튼 */
.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* 확장 버튼 */
.expand-btn {
    display: none;
    width: 100%;
    padding: 0.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0 0 12px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.9;
    transition: opacity 0.2s ease;
    margin-top: -12px;
}

.expand-btn:hover {
    opacity: 1;
}

/* 긴 코드 블록에만 확장 버튼 표시 */
pre.expandable + .expand-btn {
    display: block;
}

/* 언어 라벨 */
.lang-label {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    font-size: 0.8rem;
    color: var(--secondary-color);
    background: var(--background-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    opacity: 0.8;
}

/* 호버 효과 */
pre:hover .copy-btn {
    opacity: 0.9;
}

.copy-btn:hover {
    opacity: 1 !important;
}

/* 스크롤바 스타일 */
pre::-webkit-scrollbar {
    height: 8px;
    width: 8px;
    background-color: transparent;
}

pre::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

/* 다크모드 대응 */
[data-theme="dark"] pre {
    background: var(--card-background);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] pre::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] pre::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 모바일 대응 */
@media (max-width: 768px) {
    pre {
        padding: 2.5rem 1rem 1rem;
        border-radius: 8px;
        margin: 1.5rem -1rem;
        font-size: 0.85rem;
    }

    .copy-btn {
        opacity: 0.9;
    }

    .expand-btn {
        margin: -12px -1rem 0;
        border-radius: 0;
    }
}

.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 3rem 0;
    padding: 10px;
    border-radius: 8px;
}

.pagination-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 15px;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.pagination-button:hover {
    color: var(--accent-color);
}

.pagination-button.disabled {
    color: var(--border-color);
    cursor: not-allowed;
}

.pagination-text, .current-page, .total-pages {
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.pagination-text {
    color: var(--text-color);
    margin: 0 8px;
}

.current-page {
    font-weight: bold;
    color: var(--accent-color);
}

.total-pages {
    color: var(--text-color);
}

@media (max-width: 768px) {
    .pagination-container {
        padding: 15px 10px;
    }
    
    .pagination-button {
        padding: 5px 10px;
    }
}

@media (max-width: 768px) {
    .mobile-nav {
        max-height: calc(100vh - var(--header-height));
        height: calc(100vh - var(--header-height));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--background-color);
        z-index: 98; /* 메뉴의 z-index를 더 낮게 설정 */
        display: none;
        transition: all 0.3s ease;
    }

    /* 테마 토글 버튼 테이너 */
    .theme-toggle-wrapper {
        z-index: 100;
        position: relative;
    }

    /* 테마 토글 버튼 자체 */
    .theme-toggle {
        position: absolute; /* absolute로 변경 */
        transition: all 0.3s ease; /* 부드러운 전환 효과 */
    }

    /* 메뉴가 열렸을 때 표시 */
    body.menu-open .mobile-nav {
        display: block;
        opacity: 1;
    }

    /* 스크롤바 스타일링 */
    .mobile-nav::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .mobile-nav::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
}

/* 트랜지션 최적화 */
body {
    /* 중요한 속성만 지정하여 최적화 */
    transition: background-color 0.2s ease;
    will-change: background-color;
}

/* 다크모드 전환 최적화 */
[data-theme="dark"] {
    transition: background-color 0.2s ease;
    will-change: background-color;
}

/* 메인 페이지 성능 최적화 */
.hero {
    /* content-visibility: auto;
    contain-intrinsic-size: 0 300px; */
    padding: 4rem 0 2rem;
    text-align: center;
}

.recent-posts, .category-grid {
    /* content-visibility: auto;
    contain-intrinsic-size: 0 500px; */
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    /* contain: layout style; */
}

.category-card img {
    aspect-ratio: 16/9;
    object-fit: cover;
    background-color: #f5f5f5;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* 스켈레톤 효과 개선 */
.category-card {
    background-color: var(--card-background);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.2s ease;
    padding: 1rem;
}

/* 카테고리 카드 최적화 */
.category-card img {
    transition: transform 0.3s ease;
    transform: translateZ(0); /* 하드웨어 가속 */
    backface-visibility: hidden;
}

/* 카드 호버 최적화 */
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.category-card:hover img {
    transform: scale(1.03) translateZ(0);
}