@import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Caveat:wght@400;700&display=swap');

/* Base Styles */
:root {
    --background: #ffffff;
    --foreground: #333333;
    --muted-foreground: #666666;
    --primary: #8B5CF6;
    --primary-foreground: #ffffff;
    --accent: #f8f9fa;
    --accent-foreground: #333333;
    --border: #e2e8f0;
    --card: #ffffff;
    --card-foreground: #333333;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Playfair Display', Georgia, Cambria, serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 0.5rem;
}

.dark {
    --background: #121212;
    --foreground: #f8f9fa;
    --muted-foreground: #a7a7a7;
    --primary: #9b87f5;
    --primary-foreground: #ffffff;
    --accent: #1e1e1e;
    --accent-foreground: #f8f9fa;
    --border: #2e2e2e;
    --card: #1e1e1e;
    --card-foreground: #f8f9fa;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.26);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--foreground);
    background-color: var(--background);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Prevent bottom space */
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--muted-foreground);
    max-width: 600px;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.btn-primary:hover {
    background-color: rgba(139, 92, 246, 0.9);
    /* slightly dimmed primary */
}

.btn-secondary {
    background-color: var(--background);
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--accent);
}

.btn-lg {
    font-size: 1.125rem;
    padding: 0.875rem 1.75rem;
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: background-color 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
    /* backdrop-filter transition 추가 */
    background-color: rgba(255, 255, 255, 0);
    /* 초기 투명 */
}

.site-header.scrolled {
    background-color: rgba(var(--background-rgb, 255, 255, 255), 0.85);
    /* 스크롤 시 약간 투명한 배경 */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* Safari support */
    box-shadow: var(--shadow-sm);
}

/* .dark 모드일 때 스크롤 시 배경색 조정 */
.dark .site-header.scrolled {
    background-color: rgba(var(--background-rgb, 18, 18, 18), 0.85);
}

/* body 태그에 RGB 값을 위한 변수 추가 (JS에서 설정) */
body {
    /* ... 기존 스타일 ... */
    --background-rgb: 255, 255, 255;
}

.dark body {
    --background-rgb: 18, 18, 18;
}


.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #8B5CF6, #D946EF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.desktop-nav {
    display: flex;
    align-items: center;
}

.desktop-nav ul {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    position: relative;
    color: var(--foreground);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.nav-link:hover {
    opacity: 1;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: transparent;
    color: var(--foreground);
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--accent);
}

.mobile-nav-controls {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: transparent;
    transition: background-color 0.3s;
    color: var(--foreground);
    /* 아이콘 색상 추가 */
}

.menu-toggle:hover {
    background-color: var(--accent);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
}

.mobile-menu.open {
    display: block;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.mobile-menu.open .mobile-menu-overlay {
    opacity: 1;
}


.mobile-menu-container {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 300px;
    max-width: 100vw;
    background-color: var(--background);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open .mobile-menu-container {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.mobile-menu-header h2 {
    font-size: 1.25rem;
}

#mobile-menu-close {
    /* 닫기 버튼 색상 */
    color: var(--foreground);
}

.mobile-nav {
    padding: 1.25rem;
}

.mobile-nav ul li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.mobile-nav ul li:last-child {
    border-bottom: none;
    /* 마지막 항목 밑줄 제거 */
}

.mobile-nav ul li a {
    display: block;
    font-size: 1.125rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1rem 4rem;
    /* 헤더 높이 고려하여 패딩 조정 */
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to bottom right, rgba(139, 92, 246, 0.1), rgba(217, 70, 239, 0.1));
}

.bg-shape {
    position: absolute;
    width: 15rem;
    height: 15rem;
    border-radius: 50%;
    background: linear-gradient(to bottom right, rgba(139, 92, 246, 0.15), rgba(217, 70, 239, 0.15));
    /* 약간 진하게 */
    filter: blur(60px);
    /* 블러 효과 증가 */
}

.bg-shape:nth-child(1) {
    top: 10%;
    left: 10%;
    animation: float 30s infinite ease-in-out;
}

.bg-shape:nth-child(2) {
    top: 60%;
    right: 15%;
    animation: float 25s infinite ease-in-out reverse;
}

.bg-shape:nth-child(3) {
    bottom: 15%;
    left: 25%;
    animation: float 35s infinite ease-in-out;
}

.bg-shape:nth-child(4) {
    top: 25%;
    left: 65%;
    animation: float 28s infinite ease-in-out reverse;
}

.bg-shape:nth-child(5) {
    bottom: 5%;
    right: 5%;
    animation: float 32s infinite ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(10px, -15px) scale(1.05);
    }

    50% {
        transform: translate(-5px, 10px) scale(0.95);
    }

    75% {
        transform: translate(15px, 5px) scale(1.02);
    }
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1s forwards 0.3s;
}

.hero-title {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    /* 크기 약간 조정 */
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #8B5CF6, #D946EF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    /* 크기 약간 조정 */
    color: var(--muted-foreground);
    margin-bottom: 2.5rem;
    /* 간격 조정 */
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.hero-buttons .btn {
    /* 버튼 호버 효과 추가 */
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.hero-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}


.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fadeIn 1s forwards 1s, bounce 2s infinite 1.5s;
    /* 딜레이 조정 */
    z-index: 5;
    /* 다른 요소 위에 보이도록 */
}


.scroll-indicator a {
    color: var(--foreground);
    opacity: 0.7;
    transition: opacity 0.3s;
    font-size: 1.5rem;
    /* 아이콘 크기 */
}

.scroll-indicator a:hover {
    opacity: 1;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-10px) translateX(-50%);
    }

    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Featured Blog Section */
.featured-blog-section {
    padding: 5rem 0;
    background-color: rgba(139, 92, 246, 0.03);
    /* 배경색 약간 연하게 */
}

.featured-card {
    display: block;
    background-color: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    /* transition timing function 조정 */
    border: 1px solid var(--border);
    /* 테두리 추가 */
}

.featured-card:hover {
    transform: translateY(-6px) scale(1.01);
    /* 호버 효과 약간 강화 */
    box-shadow: var(--shadow-lg);
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr;
}

.image-container {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* 이미지 줌 효과 transition 조정 */
}

.featured-card:hover .image-container img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--primary);
    color: var(--primary-foreground);
    padding: 0.3rem 0.8rem;
    /* 패딩 조정 */
    border-radius: 9999px;
    font-size: 0.8rem;
    /* 폰트 크기 조정 */
    font-weight: 500;
    z-index: 1;
    text-transform: uppercase;
    /* 대문자 변환 */
    letter-spacing: 0.5px;
    /* 자간 조정 */
}

.mobile-badge {
    display: none;
    position: static;
    margin-bottom: 0.75rem;
    /* 간격 조정 */
    /* 모바일 뱃지 스타일을 기본 뱃지와 통일 */
    background-color: var(--primary);
    color: var(--primary-foreground);
    padding: 0.3rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
    /* 내용에 맞게 너비 조절 */
}

.content-container {
    padding: 2rem;
}

.content-container h3 {
    margin-bottom: 1rem;
    font-size: 1.75rem;
    /* 제목 크기 증가 */
    position: relative;
    /* display: inline-block; 제거하여 전체 너비 사용 */
}

/* 제목 밑줄 제거 (호버 효과로 대체 또는 다른 스타일 적용 가능) */
/*
.content-container h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 50px;
    height: 3px;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease-out;
}

.featured-card:hover .content-container h3::after {
    transform: scaleX(1);
}
*/

.content-container p {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    /* 본문 폰트 크기 약간 증가 */
}

.post-meta {
    display: flex;
    /* justify-content: space-between; 제거 */
    gap: 1.5rem;
    /* 요소 사이 간격 추가 */
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin-top: 1.5rem;
    /* 위쪽 여백 추가 */
    border-top: 1px solid var(--border);
    /* 구분선 추가 */
    padding-top: 1rem;
    /* 구분선 위 여백 */
}

/* Posts Section */
.posts-section {
    padding: 5rem 0;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    /* 버튼 간격 조정 */
    margin-bottom: 3rem;
    /* 아래쪽 여백 증가 */
    justify-content: center;
    padding-bottom: 0.5rem;
    /* 스크롤바 공간 */
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    /* 버튼 크기 조정 */
    border-radius: var(--radius);
    font-size: 0.9rem;
    /* 폰트 크기 조정 */
    font-weight: 500;
    border: 1px solid var(--border);
    background-color: var(--background);
    color: var(--foreground);
    transition: all 0.2s ease-in-out;
}

.filter-btn:hover {
    background-color: var(--accent);
    border-color: var(--primary);
    /* 호버 시 테두리 색 변경 */
    color: var(--primary);
    /* 호버 시 텍스트 색 변경 */
}

.filter-btn.active {
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
    /* 활성 버튼 그림자 */
}

/* ==== Pagination Styles Start ==== */
.posts-navigation {
    position: relative;
    padding: 0 3rem;
    /* 좌우 버튼 공간 확보 */
    margin-top: 2rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    min-height: 400px;
}

/* Animation helper classes */
.posts-grid.fade-out {
    opacity: 0;
}

.posts-grid.fade-in-next {
    opacity: 0;
    transform: translateX(30px);
}

.posts-grid.fade-in-prev {
    opacity: 0;
    transform: translateX(-30px);
}

/* === 수정된 pagination-btn 스타일 === */
@keyframes pulse-bounce {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-50%) scale(1.08);
    }
}

.pagination-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--foreground);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    animation: pulse-bounce 2s infinite ease-in-out;
    transition: all 0.3s ease, top 0.3s ease, left 0.3s ease, right 0.3s ease;
}

/* 호버 및 액티브 상태 (비활성화 아닐 때만 적용) */
.pagination-btn:not(:disabled):hover,
.pagination-btn:not(:disabled):active {
    animation-play-state: paused;
    /* 애니메이션 중지 */
    background-color: var(--primary);
    color: var(--primary-foreground);
    transform: translateY(-50%) scale(1.15);
    box-shadow: var(--shadow);
}

/* 비활성화 스타일 */
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: var(--accent);
    transform: translateY(-50%) scale(1);
    box-shadow: none;
    color: var(--muted-foreground);
    animation: none;
}

/* 비활성화 시 호버/액티브 효과 방지 (중복이지만 명확성을 위해) */
.pagination-btn:disabled:hover,
.pagination-btn:disabled:active {
    background-color: var(--accent);
    color: var(--muted-foreground);
    transform: translateY(-50%) scale(1);
    box-shadow: none;
}


#prev-page-btn {
    left: 0;
}

#next-page-btn {
    right: 0;
}

/* 모바일 고정 스타일 */
@media (max-width: 768px) {
    .posts-navigation {
        padding: 0 2.5rem;
    }

    .pagination-btn {
        width: 2.8rem;
        height: 2.8rem;
        transform: translateY(-50%);
    }

    #prev-page-btn {
        left: -0.5rem;
    }

    #next-page-btn {
        right: -0.5rem;
    }

    /* 고정 상태 스타일 */
    .pagination-btn.fixed {
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
        background-color: rgba(var(--background-rgb, 255, 255, 255), 0.85);
        /* 투명도 약간 높임 */
        backdrop-filter: blur(5px);
        /* 블러 약간 증가 */
        -webkit-backdrop-filter: blur(5px);
        box-shadow: var(--shadow);
        /* 고정 상태에서도 호버/액티브 스타일 적용 가능 */
    }

    .dark .pagination-btn.fixed {
        background-color: rgba(var(--background-rgb, 18, 18, 18), 0.85);
    }

    #prev-page-btn.fixed {
        left: 0.5rem;
    }

    #next-page-btn.fixed {
        right: 0.5rem;
    }
}

@media (max-width: 500px) {

    /* ... 기존 500px 미만 스타일 ... */
    .pagination-btn {
        width: 2.5rem;
        height: 2.5rem;
    }

    #prev-page-btn {
        left: -0.8rem;
    }

    #next-page-btn {
        right: -0.8rem;
    }

    #prev-page-btn.fixed {
        left: 0.3rem;
    }

    #next-page-btn.fixed {
        right: 0.3rem;
    }
}

/* ==== Pagination Styles End ==== */


.post-card {
    background-color: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    /* 테두리 추가 */
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    opacity: 0;
    /* Initial state for intersection observer */
    transform: translateY(20px);
    /* Initial state */
    display: flex;
    /* Flexbox 레이아웃으로 변경 */
    flex-direction: column;
    /* 세로 방향 배치 */
}

.post-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    /* 등장 애니메이션 */
}

/* 각 카드별 딜레이는 JS에서 Intersection Observer와 함께 관리됨 */


.post-card:hover {
    transform: translateY(-5px) scale(1.02);
    /* 호버 효과 조정 */
    box-shadow: var(--shadow-lg);
}

.post-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
    /* 이미지 크기 고정 */
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-card:hover .post-card-image img {
    transform: scale(1.1);
}

/* Post card badge 조정 */
.post-card-image .badge {
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
}


.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* 남은 공간 채우도록 */
}

.post-card-title {
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
    /* 제목 크기 조정 */
    line-height: 1.3;
    /* 줄 간격 조정 */
    /* position: relative; */
    /* 밑줄 사용 안 함 */
    /* display: inline-block; */
    color: var(--foreground);
    /* 제목 색상 명시 */
    transition: color 0.3s;
}

.post-card:hover .post-card-title {
    color: var(--primary);
    /* 호버 시 제목 색상 변경 */
}

/* 카드 제목 밑줄 제거 */
/* .post-card-title::after { ... } */


.post-card-excerpt {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    /* 본문 발췌 폰트 크기 조정 */
    line-height: 1.5;
    /* 줄 간격 조정 */
    flex-grow: 1;
    /* 제목과 메타 사이 공간 채움 */
    /* 텍스트 줄 수 제한 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* 3줄 제한 */
    /* 표준 속성 (반드시 -webkit-line-clamp 뒤에 와야 함) */
    line-clamp: 3;
    /* 표준 브라우저용: 3줄 제한 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.5em * 3);
    /* 3줄 높이 확보 */
}

.post-card-meta {
    display: flex;
    /* justify-content: space-between; 제거 */
    gap: 1rem;
    /* 간격 조정 */
    font-size: 0.8rem;
    /* 폰트 크기 조정 */
    color: var(--muted-foreground);
    margin-top: auto;
    /* 하단에 배치 */
    padding-top: 0.75rem;
    /* 위쪽 여백 추가 */
    border-top: 1px solid var(--border);
    /* 구분선 추가 */
}

/* Load more button removed */

/* Newsletter Section */
.newsletter-section {
    padding: 5rem 1rem;
    /* 패딩 조정 */
    background-color: var(--accent);
}

.newsletter-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 2rem;
    /* 내부 패딩 추가 */
    background-color: var(--card);
    /* 카드 배경 적용 */
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.newsletter-container h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
    /* 제목 크기 */
}

.newsletter-container p {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 450px;
    /* 폼 너비 제한 */
    margin: 0 auto 1.5rem;
    /* 가운데 정렬 및 아래 여백 */
}

.newsletter-form input {
    flex: 1;
    padding: 0.85rem 1rem;
    /* 입력 필드 크기 조정 */
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    font-size: 1rem;
    color: var(--foreground);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    /* 포커스 효과 강화 */
}

.newsletter-form .btn {
    /* 구독 버튼 스타일 */
    padding: 0.85rem 1.5rem;
    transition: background-color 0.2s, transform 0.2s;
}

.newsletter-form .btn:hover {
    background-color: rgba(139, 92, 246, 0.8);
    transform: scale(1.03);
}

.disclaimer {
    font-size: 0.8rem;
    /* 폰트 크기 조정 */
    margin-top: 1rem;
    color: var(--muted-foreground);
}

/* Footer */
.site-footer {
    padding: 5rem 1rem 2rem;
    /* 패딩 조정 */
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    background-color: var(--accent);
    /* 푸터 배경색 추가 */
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    /* 반응형 그리드 */
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    /* 가운데 정렬 */
}

.footer-column h3 {
    background: linear-gradient(to right, #8B5CF6, #D946EF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
    /* 간격 증가 */
    font-size: 1.5rem;
    /* 로고/제목 크기 */
}

.footer-column p {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.footer-column h4 {
    margin-bottom: 1.5rem;
    /* 간격 증가 */
    font-size: 1.2rem;
    /* 소제목 크기 */
    color: var(--foreground);
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-column ul li a {
    color: var(--muted-foreground);
    transition: color 0.3s, padding-left 0.3s;
    /* 패딩 전환 추가 */
    display: inline-block;
    /* 패딩 적용 위해 */
    position: relative;
}

.footer-column ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
    /* 호버 시 약간 이동 */
}

/* 소셜 링크 */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    /* 위쪽 여백 */
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    /* 크기 증가 */
    height: 2.8rem;
    /* 크기 증가 */
    border-radius: 50%;
    background-color: var(--background);
    /* 배경색 변경 */
    color: var(--muted-foreground);
    border: 1px solid var(--border);
    /* 테두리 추가 */
    font-size: 1.1rem;
    /* 아이콘 크기 */
    transition: all 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px) scale(1.05);
    /* 호버 효과 */
    color: var(--primary);
    background-color: var(--accent);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary);
}

/* 푸터 구독 폼 */
.footer-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    /* 위쪽 여백 */
}

.footer-form input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    font-size: 0.9rem;
    /* 폰트 크기 */
    color: var(--foreground);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.footer-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.footer-form .btn {
    /* 푸터 구독 버튼 */
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    /* 위쪽 여백 */
}

.footer-form .btn:hover {
    background-color: rgba(139, 92, 246, 0.8);
}


.footer-bottom {
    margin-top: 4rem;
    /* 간격 증가 */
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    max-width: 1200px;
    /* 최대 너비 */
    margin-left: auto;
    /* 가운데 정렬 */
    margin-right: auto;
}

.heart-text {
    display: flex;
    align-items: center;
}

.heart-text i {
    color: #ea384d;
    margin: 0 0.3rem;
    /* 간격 조정 */
    animation: pulse 1.5s infinite ease-in-out;
    /* 하트 애니메이션 */
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}


/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 6rem;
    /* FAB 위로 이동 */
    right: 1.5rem;
    /* 오른쪽으로 이동 */
    left: auto;
    /* 왼쪽 위치 제거 */
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    /* 크기 증가 */
    height: 3rem;
    /* 크기 증가 */
    border-radius: 50%;
    background-color: rgba(var(--primary-rgb, 139, 92, 246), 0.8);
    /* RGB 사용 */
    color: white;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    /* 초기 상태 변경 */
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    /* 바운스 효과 transition */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    /* Safari support */
}

/* primary 색상 RGB 값 설정 (JS에서도 필요할 수 있음) */
:root {
    --primary-rgb: 139, 92, 246;
}

.dark {
    --primary-rgb: 155, 135, 245;
    /* 다크모드 시 primary RGB 값 */
    --primary: #9b87f5;
    /* 다크모드 primary 확인 */
}


.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    background-color: var(--primary);
    transform: scale(1.1);
    /* 호버 시 크기 증가 */
    box-shadow: var(--shadow-lg);
}

/* Floating Action Button */
.floating-action-button {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 101;
    /* Back to top 보다 위에 */
}

.fab-main {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.8rem;
    /* 크기 증가 */
    height: 3.8rem;
    /* 크기 증가 */
    border-radius: 50%;
    background: linear-gradient(45deg, #8B5CF6, #c084fc);
    /* 그라데이션 배경 */
    color: white;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
    /* 바운스 효과 및 배경 전환 */
}

.fab-main:hover {
    transform: scale(1.05);
    background: linear-gradient(45deg, #7c4ff5, #a963f8);
    /* 호버 시 색상 변경 */
}

.fab-main i {
    transition: transform 0.3s ease-in-out;
    font-size: 1.2rem;
    /* 아이콘 크기 */
}

.fab-main.open i {
    transform: rotate(135deg);
    /* 45도 -> 135도로 변경 */
}

.fab-menu {
    position: absolute;
    bottom: 4.8rem;
    /* 메인 버튼 크기 고려 */
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
    /* 아이템 간격 증가 */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
    /* visibility 지연 */
}

.fab-menu.open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-in-out, visibility 0s 0s;
}

.fab-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    /* 아이템 크기 */
    height: 3.2rem;
    /* 아이템 크기 */
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--foreground);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: scale(0) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s, color 0.3s;
}

.fab-item:hover {
    background-color: var(--primary);
    color: var(--primary-foreground);
}


.fab-menu.open .fab-item {
    transform: scale(1) translateY(0);
}

/* 메뉴 아이템 등장 딜레이 */
.fab-menu.open .fab-item:nth-child(1) {
    transition-delay: 0.1s;
}

.fab-menu.open .fab-item:nth-child(2) {
    transition-delay: 0.05s;
}

.fab-menu.open .fab-item:nth-child(3) {
    transition-delay: 0s;
}

.fab-label {
    position: absolute;
    right: 4rem;
    /* 위치 조정 */
    background-color: var(--card);
    /* 카드 배경 사용 */
    color: var(--card-foreground);
    padding: 0.4rem 0.8rem;
    /* 패딩 조정 */
    border-radius: var(--radius);
    font-size: 0.875rem;
    box-shadow: var(--shadow);
    white-space: nowrap;
    visibility: hidden;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* 바운스 효과 */
    border: 1px solid var(--border);
    pointer-events: none;
    /* 라벨이 클릭 방해하지 않도록 */
}

.fab-item:hover .fab-label {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}

/* Media Queries */
@media (min-width: 640px) {
    .newsletter-form {
        flex-direction: row;
    }

    .footer-form {
        flex-direction: row;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: 1.2fr 1fr;
        gap: 2rem;
    }

    /* 이미지 비율 조정 */
    .image-container {
        height: auto;
    }

    /* 높이 자동 조정 */
    /* .footer-grid { grid-template-columns: repeat(3, 1fr); } 이미 auto-fit 사용 중 */
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }

    .mobile-nav-controls {
        display: flex;
    }

    .mobile-badge {
        display: inline-block;
    }

    .image-container .badge {
        display: none;
    }

    .featured-blog-section .grid-container {
        grid-template-columns: 1fr;
    }

    /* 모바일에서는 1열 */
    .featured-blog-section .image-container {
        height: 300px;
    }

    /* 모바일 이미지 높이 고정 */

    /* Pagination button adjustments for mobile */
    .posts-navigation {
        padding: 0 2.5rem;
        /* 모바일 패딩 */
    }

    .pagination-btn {
        width: 2.5rem;
        /* 모바일 버튼 크기 */
        height: 2.5rem;
    }

    #prev-page-btn {
        left: -0.5rem;
    }

    /* 약간 겹치게 */
    #next-page-btn {
        right: -0.5rem;
    }
}

@media (max-width: 500px) {
    .posts-grid {
        grid-template-columns: 1fr;
        /* Very small screens: 1 column */
    }

    .posts-navigation {
        padding: 0 2rem;
    }

    .pagination-btn {
        width: 2.2rem;
        height: 2.2rem;
    }

    #prev-page-btn {
        left: -0.8rem;
    }

    #next-page-btn {
        right: -0.8rem;
    }

    .featured-card .content-container h3 {
        font-size: 1.5rem;
    }

    /* 모바일 제목 크기 */
    .post-card-title {
        font-size: 1.2rem;
    }

    /* 모바일 카드 제목 크기 */
    .back-to-top {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 5.5rem;
        right: 1rem;
    }

    /* 모바일 버튼 위치/크기 */
    .floating-action-button {
        right: 1rem;
        bottom: 1rem;
    }

    .fab-main {
        width: 3.2rem;
        height: 3.2rem;
    }

    .fab-menu {
        bottom: 4.2rem;
    }

    .fab-item {
        width: 2.8rem;
        height: 2.8rem;
    }

    .fab-label {
        right: 3.5rem;
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}


/* Base Article Header Container */
.article-header {
    position: relative;
    margin-top: 5rem;
    padding: 6rem 0 4rem;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.03) 0%, 
        rgba(217, 70, 239, 0.03) 50%,
        rgba(139, 92, 246, 0.03) 100%);
    background-size: 200% 200%;
    animation: gradient-flow 15s ease infinite;
}

/* Dark mode adjustment */
.dark .article-header {
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.08) 0%, 
        rgba(217, 70, 239, 0.08) 50%,
        rgba(139, 92, 246, 0.08) 100%);
    background-size: 200% 200%;
}

/* Animated background gradient */
@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Decorative background elements */
.article-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
    animation: float-slow 20s ease-in-out infinite;
    pointer-events: none;
}

.article-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 40%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(217, 70, 239, 0.1) 0%, transparent 70%);
    animation: float-slow 20s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

/* Article Category Badge */
.article-category {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 9999px;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    animation: slide-in-top 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    animation-delay: 0.1s;
}

/* Shine effect on category */
.article-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 100%; }
    100% { left: 100%; }
}

.dark .article-category::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* Category hover effect */
.article-category:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.15);
    transition: all 0.3s ease;
}

/* Article Title */
.article-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--foreground);
    margin-bottom: 1.5rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    animation: slide-in-bottom 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    animation-delay: 0.2s;
    position: relative;
}

/* Gradient text variant for special titles */
.article-title.gradient-text {
    background: linear-gradient(135deg, #8B5CF6 0%, #D946EF 50%, #8B5CF6 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}

/* Title underline decoration */
.article-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #8B5CF6, #D946EF);
    margin: 1.5rem auto 0;
    border-radius: 2px;
    animation: scale-in-x 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    animation-delay: 0.5s;
    transform-origin: center;
}

@keyframes scale-in-x {
    0% { transform: scaleX(0); opacity: 0; }
    100% { transform: scaleX(1); opacity: 1; }
}

/* Article Meta Information */
.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--muted-foreground);
    animation: fade-in 0.8s ease both;
    animation-delay: 0.4s;
    flex-wrap: wrap;
}

/* Individual meta items */
.article-date,
.article-read-time {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

/* Icons before meta text */
.article-date::before {
    content: '📅';
    font-size: 1rem;
}

.article-read-time::before {
    content: '⏱️';
    font-size: 1rem;
}

/* Separator between meta items */
.article-meta > span:not(:last-child)::after {
    content: '•';
    margin-left: 1.5rem;
    color: var(--border);
    opacity: 0.5;
}

/* Hover effect on meta items */
.article-date:hover,
.article-read-time:hover {
    color: var(--primary);
    transition: color 0.3s ease;
}

/* Animations */
@keyframes slide-in-top {
    0% {
        transform: translateY(-30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slide-in-bottom {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Scroll reveal initial state */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .article-header {
        margin-top: 4rem;
        padding: 4rem 1rem 3rem;
    }
    
    .article-category {
        font-size: 0.8rem;
        padding: 0.4rem 1rem;
    }
    
    .article-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    
    .article-meta {
        gap: 1rem;
        font-size: 0.875rem;
    }
    
    .article-meta > span:not(:last-child)::after {
        margin-left: 1rem;
    }
    
    /* Hide decorative elements on mobile */
    .article-header::before,
    .article-header::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .article-header {
        padding: 3rem 1rem 2rem;
    }
    
    .article-title::after {
        width: 60px;
        height: 3px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-meta > span:not(:last-child)::after {
        display: none;
    }
}

/* Dark mode specific enhancements */
.dark .article-category {
    background: rgba(155, 135, 245, 0.15);
    border-color: rgba(155, 135, 245, 0.3);
    color: #9b87f5;
}

.dark .article-category:hover {
    background: rgba(155, 135, 245, 0.25);
    box-shadow: 0 4px 12px rgba(155, 135, 245, 0.2);
}

.dark .article-title::after {
    background: linear-gradient(90deg, #9b87f5, #c084fc);
}

/* Print styles */
@media print {
    .article-header {
        background: none !important;
        animation: none !important;
        margin-top: 0;
        padding: 2rem 0;
    }
    
    .article-header::before,
    .article-header::after {
        display: none !important;
    }
    
    .article-category {
        border: 1px solid #ccc;
        background: none !important;
    }
}

/* === Article Image Style Fixed (짤림 방지) === */
.article-image-wrapper {
    margin: 3rem auto;     /* 상하 여백 3rem, 가운데 정렬 */
    width: 100%;
    max-width: 800px;      /* 너비는 본문 크기(800px)를 넘지 않게 제한 */
    height: auto;          /* [핵심] 높이를 고정하지 않고 이미지 비율에 맡김 */
    
    /* 아래 속성들은 디자인을 위해 유지 */
    border-radius: var(--radius);
    overflow: hidden; 
    box-shadow: var(--shadow);
    background-color: transparent; /* 이미지가 꽉 차지 않을 때 배경색이 보이지 않게 투명 처리 */
}

.article-image {
    width: 100%;
    height: auto;          /* [핵심] 이미지 원본 비율대로 높이 조절 */
    display: block;        /* 이미지 하단 미세한 공백 제거 */
    object-fit: contain;   /* 이미지가 잘리지 않고 전체가 다 보이도록 설정 */
}
/* === End of Modification === */


/* ... rest of the article, categories, about styles ... */

/* Example: Placeholder for article content styles if not provided */
.article-content {
    max-width: 800px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.8rem;
}

.article-content h3 {
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.article-content img {
    margin: 2rem 0;
    border-radius: var(--radius);
    display: block;
    max-width: 100%;
    height: auto;
}

.article-content ul,
.article-content ol {
    margin: 1.5rem 0 1.5rem 1.5rem;
}

.article-content ul {
    list-style-type: disc;
}

.article-content ol {
    list-style-type: decimal;
}

.article-content li {
    margin-bottom: 0.75rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background-color: var(--accent);
    color: var(--muted-foreground);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* Example: Article actions */
.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.article-share {
    display: flex;
    gap: 1rem;
}

.article-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--muted-foreground);
    transition: all 0.3s;
    font-size: 1rem;
}

.article-share a:hover {
    transform: scale(1.1);
    color: var(--primary);
}

.like-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    background-color: var(--accent);
    transition: all 0.3s;
    border: 1px solid var(--border);
}

.like-button:hover {
    background-color: rgba(var(--primary-rgb, 139, 92, 246), 0.1);
    border-color: var(--primary);
}

.like-button.liked {
    color: #ea384d;
    border-color: #ea384d;
}

.like-button i {
    margin-right: 0.3rem;
}

/* Related Posts */
.related-posts {
    padding: 4rem 0;
    background-color: var(--accent);
}

.related-posts .section-header {
    margin-bottom: 3rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* Categories Page Specific (Example) */
.categories-header {
    padding: 8rem 1rem 4rem;
    text-align: center;
    background: linear-gradient(to right, rgba(139, 92, 246, 0.05), rgba(217, 70, 239, 0.05));
}

.categories-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 4rem 0;
}

.category-card {
    position: relative; /* 자식 요소의 absolute 포지셔닝 기준점 */
    display: block; /* a 태그를 블록 요소로 */
    height: 250px; /* 높이 조정 */
    border-radius: var(--radius);
    overflow: hidden; /* 내부 요소가 넘치지 않도록 */
    box-shadow: var(--shadow);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.category-card:hover {
    transform: translateY(-8px); /* 호버 시 약간 위로 이동 */
    box-shadow: var(--shadow-lg); /* 그림자 강조 */
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 이미지가 왜곡 없이 카드를 꽉 채우도록 */
    transition: transform 0.4s ease-out; /* 줌 효과를 위한 transition */
}

.category-card:hover img {
    transform: scale(1.05); /* 호버 시 이미지 확대 */
}

.category-overlay {
    position: absolute; /* 부모(.category-card) 기준으로 위치 */
    inset: 0; /* top, right, bottom, left를 0으로 설정하여 부모를 꽉 채움 */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 내용을 아래쪽으로 정렬 */
    padding: 1.5rem;
    color: white; /* 텍스트 색상을 흰색으로 */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 60%); /* 아래에서 위로 어두워지는 그라데이션 */
    text-align: left; /* 텍스트 왼쪽 정렬 */
    transition: background 0.3s ease;
}

.category-card:hover .category-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.1) 70%); /* 호버 시 그라데이션을 더 진하게 */
}

.category-title {
    font-size: 1.5rem; /* 제목 폰트 크기 */
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* 텍스트 뒤에 그림자 추가하여 가독성 향상 */
}

.category-count {
    font-size: 0.9rem;
    font-family: var(--font-sans); /* 본문 폰트 적용 */
    opacity: 0.9;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); /* 가독성을 위한 그림자 */
}

/* About Page Specific (Example) */
.about-header {
    padding: 8rem 1rem 4rem;
    text-align: center;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.about-image {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 2rem 0;
}

.team-section {
    padding: 4rem 0;
    background-color: var(--accent);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Search Overlay Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent background */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000; /* Higher than mobile menu */
    display: flex;
    align-items: flex-start; /* Align to top */
    justify-content: center;
    padding-top: 15vh; /* Position from top */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s;
}

.search-overlay.open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0s 0s;
}

.search-container {
    position: relative;
    width: 90%;
    max-width: 600px;
    background-color: var(--card);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px) scale(0.95);
    transition: transform 0.3s ease-out;
}

.search-overlay.open .search-container {
    transform: translateY(0) scale(1);
}

#search-input {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--background);
    color: var(--foreground);
    box-sizing: border-box; /* Ensure padding doesn't expand width */
}

#search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.2);
}

.search-close-btn {
    position: absolute;
    top: -15px; /* Position outside the container for better clickability */
    right: -15px;
    width: 3rem;
    height: 3rem;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, background-color 0.2s;
}

.search-close-btn:hover {
    transform: scale(1.1);
    background-color: rgba(var(--primary-rgb), 0.85);
}

/* Style for the dynamically added search filter button */
.filter-btn[data-category="search"] {
    /* Add any specific styles if needed, otherwise it inherits .filter-btn styles */
    /* Example: border-style: dashed; */
}

.lang-toggle {
    /* theme-toggle 스타일을 이미 일부 상속받음 */
    /* 필요시 추가 스타일링 */
    font-size: 0.9em; /* 텍스트 크기 조절 */
    padding: 0 0.5rem; /* 좌우 패딩 추가 */
    min-width: 2.5rem; /* 최소 너비 확보 */
    font-weight: bold;
}

/* 모바일 컨트롤 내의 언어 토글 버튼 간격 조정 */
.mobile-nav-controls .lang-toggle {
    margin-left: 0; /* 테마 토글과 메뉴 토글 사이에 있도록 조정 */
    margin-right: 0.5rem; /* 메뉴 토글과의 간격 */
}

/* 데스크톱 네비게이션 내 언어 토글 버튼 간격 조정 */
.desktop-nav .lang-toggle {
    margin-left: 0.5rem; /* 테마 토글과의 간격 */
}

/* Toast Notification */
.toast-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    background-color: rgba(18, 18, 18, 0.9); /* 어두운 배경 */
    color: #ffffff; /* 흰색 텍스트 */
    padding: 12px 24px;
    border-radius: 9999px; /* 둥근 모양 */
    font-size: 0.9rem;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s 0.3s;
    transform: translate(-50%, 20px);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.dark .toast-popup {
    background-color: rgba(248, 249, 250, 0.9); /* 다크모드에서는 밝은 배경 */
    color: #121212; /* 어두운 텍스트 */
}

.toast-popup.show {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
    transform: translate(-50%, 0);
}

/* ==== Promo Playground Section Styles ==== */
.promo-playground-section {
    padding: 4rem 0;
    background-color: var(--background);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.promo-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.promo-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #8B5CF6, #D946EF);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.promo-header p {
    color: var(--muted-foreground);
    font-size: 1rem;
}

.promo-grid {
    display: grid;
    /* 카드가 너무 작아지지 않도록 최소 너비 설정 (모바일 대응) */
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.promo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

/* 카드 배경에 은은한 그라데이션 효과 추가 (선택사항) */
.promo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(217, 70, 239, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.promo-card:hover::before {
    opacity: 1;
}

.promo-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.promo-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    transition: transform 0.3s ease;
}

.promo-card:hover .promo-icon {
    transform: scale(1.2) rotate(5deg);
}

.promo-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
    text-align: center;
    z-index: 1;
}

.promo-card:hover .promo-text {
    color: var(--primary);
}

/* 모바일 환경 최적화 */
@media (max-width: 640px) {
    .promo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.8rem;
    }
    
    .promo-card {
        padding: 1.2rem 0.8rem;
    }

    .promo-icon {
        font-size: 2rem;
    }
    
    .promo-text {
        font-size: 0.85rem;
    }
}


/* ========================================= */
/* 스케치 감성 디자인 */
/* ========================================= */

/* 2. 스케치 느낌으로 전역 변수(Theme) 덮어쓰기 */
:root {
    --font-sans: 'Gowun Dodum', 'Caveat', sans-serif;
    --font-serif: 'Gowun Dodum', 'Caveat', sans-serif;
    
    /* 종이와 연필 색상 */
    --background: #fdfbf7;
    --foreground: #2a2a2a;
    --muted-foreground: #666666;
    --primary: #2a2a2a;
    --primary-foreground: #fdfbf7; /* [추가] 뱃지 안의 글자색 (밝은 색) */
    --border: #2a2a2a;
    --card: #fdfbf7;
    
    /* 그림자 */
    --shadow-sm: 2px 2px 0px rgba(42, 42, 42, 1);
    --shadow: 4px 4px 0px rgba(42, 42, 42, 1);
    --shadow-lg: 6px 6px 0px rgba(42, 42, 42, 1);
    
    /* 모서리 */
    --radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

/* 다크모드 무효화 혹은 반전 연필 스케치 효과 */
.dark {
    --background: #2a2a2a;
    --foreground: #fdfbf7;
    --muted-foreground: #a7a7a7;
    --primary: #fdfbf7;
    --primary-foreground: #2a2a2a; /* [추가/핵심] 다크모드 뱃지 글자색 (어두운 색) */
    --border: #fdfbf7;
    --card: #2a2a2a;
    --shadow: 4px 4px 0px #fdfbf7;
    --shadow-lg: 6px 6px 0px #fdfbf7;
}

/* 3. 공통 테두리 스타일 강제 적용 */
* {
    letter-spacing: 0.5px;
}

/* 버튼을 제외한 카드, 검색창 등에만 배경색 및 테두리 적용 */
.post-card, .featured-card, .search-container, .newsletter-container {
    border: 2px solid var(--border) !important;
    background-color: var(--card) !important;
}

/* 버튼 전용 스케치 스타일 재정의 */
.btn {
    border: 2px solid var(--border) !important;
}

.btn-primary {
    background-color: var(--foreground) !important;
    color: var(--background) !important;
}

.btn-secondary {
    background-color: transparent !important;
    color: var(--foreground) !important;
}

/* 4. 그라데이션 텍스트 및 배경 효과 제거 */
.logo span, .hero-title, .promo-header h3, .footer-column h3 {
    background: none !important;
    color: var(--foreground) !important;
    -webkit-text-fill-color: var(--foreground) !important;
}

.hero-bg, .bg-shape, .article-header::before, .article-header::after {
    display: none !important;
}

/* 5. 호버(Hover) 시 부드러운 효과 대신 살짝 비틀어지는 애니메이션 */
.post-card:hover, .btn:hover, .category-card:hover {
    transform: translate(-2px, -2px) rotate(-1deg) !important;
    box-shadow: 6px 6px 0px var(--border) !important;
}

/* ========================================= */
/* [추가] 좋아요 버튼 & 뱃지 (다크모드 오류 수정) */
/* ========================================= */

/* 좋아요 버튼 스케치 감성 동기화 */
.like-button {
    border: 2px solid var(--border) !important;
    background-color: transparent !important;
    color: var(--foreground) !important;
    box-shadow: 2px 2px 0px var(--border);
}

.like-button:hover {
    transform: translate(-2px, -2px) rotate(-1deg);
    box-shadow: 4px 4px 0px var(--border) !important;
}

/* 좋아요 활성화 되었을 때 */
.like-button.liked {
    color: #ea384d !important;
    border-color: #ea384d !important;
    box-shadow: 2px 2px 0px #ea384d;
}

/* 카드 뱃지(Category) 디자인 통일 */
.badge, .mobile-badge, .article-category {
    color: var(--primary-foreground) !important;
    border: 2px solid var(--border) !important;
    box-shadow: 2px 2px 0px var(--border);
}

/* ========================================= */
/* [추가 수정] 카테고리 뱃지 & 대표 이미지 픽스 */
/* ========================================= */

/* 1. 카테고리 뱃지 가독성 및 스케치 감성 강화 */
.article-category {
    background-color: var(--card) !important;
    color: var(--foreground) !important;
    border: 2px solid var(--border) !important;
    box-shadow: 2px 2px 0px var(--border) !important;
    border-radius: var(--radius) !important;
    font-weight: bold;
    padding: 0.5rem 1.5rem !important;
}

/* 기존 화려한 빛 반사 애니메이션 등 장식 강제 제거 */
.article-category::before, 
.article-category::after {
    display: none !important;
}

/* 호버 시 살짝 비뚤어지는 효과 적용 */
.article-category:hover {
    transform: translate(-2px, -2px) rotate(-2deg) !important;
    box-shadow: 4px 4px 0px var(--border) !important;
}

/* 2. 기사 대표 이미지 스크롤(패럴랙스) 시 테두리 어긋남 방지 */
.article-image {
    /* JS에서 적용하는 스크롤 이동(translateY) 효과 강제 무효화 */
    transform: none !important; 
    transition: none !important;
}

/* 대표 이미지 틀(래퍼) 스케치 테마 적용 */
.article-image-wrapper {
    border: 2px solid var(--border) !important;
    box-shadow: 6px 6px 0px var(--border) !important;
    background-color: var(--card) !important;
    border-radius: var(--radius) !important;
    overflow: hidden !important;
}

/* ============================================================
 * ★ 좋아요(Likes) 시스템 CSS - styles.css 맨 아래에 추가하세요
 * ============================================================ */


/* ── 헤더 nav 좋아요 링크 & 뱃지 ── */

.nav-link-likes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 뱃지: updateNavLikeBadge()가 count > 0 일 때 display:inline-flex 처리 */
.nav-likes-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background-color: #ea384d;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    line-height: 1;
    /* 스케치 테마 감성 */
    border: 2px solid #ea384d;
    box-shadow: 1px 1px 0px #ea384d;
}

/* 모바일 메뉴 안의 뱃지 */
.mobile-nav .nav-likes-badge {
    margin-left: 6px;
}


/* ── 좋아요 페이지 헤더 ── */

.likes-page-header {
    padding: 8rem 1rem 2.5rem;
    text-align: center;
    background: linear-gradient(
        135deg,
        rgba(234, 56, 77, 0.04) 0%,
        rgba(139, 92, 246, 0.04) 100%
    );
    border-bottom: 1px solid var(--border);
}

.likes-page-header h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 0.75rem;
    color: var(--foreground);
}

.likes-page-header h1 .fa-heart {
    color: #ea384d;
    margin-right: 0.4rem;
}

.likes-page-header p {
    color: var(--muted-foreground);
    font-size: 0.95rem;
}


/* ── 좋아요 페이지 섹션 ── */

.likes-page-section {
    padding: 2.5rem 1rem 5rem;
}


/* ── 카드 그리드 ── */

.likes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.likes-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--muted-foreground);
    padding: 3rem 0;
    font-size: 0.95rem;
}


/* ── 카드 래퍼 (취소 버튼 위치 기준점) ── */

.likes-card-wrapper {
    position: relative;
}

/* 래퍼 안의 .post-card는 100% 너비 사용 */
.likes-card-wrapper .post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}


/* ── 좋아요 취소 버튼 (카드 우상단) ── */

.likes-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(234, 56, 77, 0.88);
    color: #fff;
    border: 2px solid #ea384d;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.78rem;
    box-shadow: 2px 2px 0px #ea384d;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    z-index: 3;
}

.likes-remove-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px #ea384d;
    background: #ea384d;
}

.likes-remove-btn:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0px #ea384d;
}


/* ── 카드 내 좋아요 날짜 라벨 ── */

.liked-at-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 0.65rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #ea384d;
    letter-spacing: 0.3px;
}

.liked-at-label .fa-heart {
    font-size: 0.68rem;
}


/* ── 빈 상태 (좋아요한 글 없을 때) ── */

.likes-empty-state {
    text-align: center;
    padding: 5rem 1rem 4rem;
    color: var(--muted-foreground);
}

.likes-empty-state > .fa-heart {
    display: block;
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--muted-foreground);
    opacity: 0.2;
}

.likes-empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--foreground);
}

.likes-empty-state p {
    font-size: 0.95rem;
    line-height: 1.9;
    margin-bottom: 0;
}

/* 탐색하기 버튼 */
.likes-explore-btn {
    display: inline-block;
    margin-top: 2rem;
}


/* ── 모바일 반응형 ── */

@media (max-width: 768px) {
    .likes-page-header {
        padding: 6rem 1rem 2rem;
    }

    .likes-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    .likes-page-header h1 {
        font-size: 1.6rem;
    }
}


/* ============================================================
 * 스케치 테마 다크모드 적용 (기존 스케치 감성 유지)
 * ============================================================ */

/* 헤더 배경 - 다크모드에서도 미묘한 그라디언트 유지 */
.dark .likes-page-header {
    background: linear-gradient(
        135deg,
        rgba(234, 56, 77, 0.07) 0%,
        rgba(139, 92, 246, 0.07) 100%
    );
}

/* 카드 래퍼 안의 post-card는 기존 스케치 스타일 자동 상속 */
/* (.post-card { border: 2px solid var(--border) !important; ... }) */

/* 다크모드에서 취소 버튼 스케치 스타일 강화 */
.dark .likes-remove-btn {
    background: rgba(234, 56, 77, 0.75);
    border: 2px solid #ea384d;
    box-shadow: 2px 2px 0px #ea384d;
}

.dark .likes-remove-btn:hover {
    background: #ea384d;
    transform: translate(-2px, -2px) rotate(-2deg);
    box-shadow: 4px 4px 0px #ea384d;
}

/* 다크모드 liked-at-label */
.dark .liked-at-label {
    color: #f87171; /* 다크모드에서 좀 더 밝은 레드 */
}

/* 다크모드 nav 뱃지 */
.dark .nav-likes-badge {
    border-color: #f87171;
    background-color: #ea384d;
    box-shadow: 1px 1px 0px #f87171;
}