/* 기본 설정 */
@font-face { font-family: 'GmarketSansMedium'; src: local('GmarketSansMedium'), url('/GmarketSansMedium.woff') format('woff'); font-weight: normal; font-style: normal; font-display: swap; }
:root { --primary-color: #e9ecef; --accent-color: #60a5fa; --background-color: #0f172a; --card-background: #1e293b; --text-primary: #f8fafc; --text-secondary: #94a3b8; --border-color: #2d3748; --hover-color: #3b82f6; --shadow-sm: 0 2px 4px rgba(0,0,0,0.2); --shadow-md: 0 4px 6px rgba(0,0,0,0.3); --shadow-lg: 0 10px 15px rgba(0,0,0,0.3); --transition: all 0.3s ease; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'GmarketSansMedium', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background-color: var(--background-color); color: var(--text-primary); line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 상단 추천 게시글 섹션 */
.featured-posts { padding: 60px 0; background: var(--card-background); margin-bottom: 40px; box-shadow: var(--shadow-sm); }
.section-title { text-align: center; font-size: 28px; margin-bottom: 40px; color: var(--text-primary); position: relative; }
.section-title::after { content: ''; display: block; width: 50px; height: 3px; background: var(--accent-color); margin: 15px auto 0; border-radius: 2px; }
.featured-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; list-style: none; padding: 0; }
.featured-item { border-radius: 12px; overflow: hidden; background: var(--card-background); box-shadow: var(--shadow-md); transition: var(--transition); }
.featured-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.featured-link { text-decoration: none; color: inherit; display: block; }
.featured-image-wrapper { position: relative; padding-top: 60%; overflow: hidden; }
.featured-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.featured-item:hover .featured-image { transform: scale(1.05); }
.featured-content { padding: 20px; }
.featured-category { display: inline-block; background: var(--accent-color); color: white; padding: 4px 12px; border-radius: 20px; font-size: 14px; margin-bottom: 12px; }
.featured-title { font-size: 18px; margin-bottom: 12px; color: var(--text-primary); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured-meta { display: flex; justify-content: space-between; color: var(--text-secondary); font-size: 14px; }

/* 카테고리 네비게이션 */
.category-nav { background: var(--card-background); padding: 20px 0; margin-bottom: 20px; box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 100; }
.category-nav .container { display: flex; justify-content: center; gap: 15px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 40px; }
.category-nav .container::-webkit-scrollbar { display: none; }
.category-link { color: var(--text-secondary); text-decoration: none; padding: 8px 20px; border-radius: 20px; transition: var(--transition); white-space: nowrap; font-size: 15px; }
.category-link.active { background: var(--accent-color); color: white; }
.category-link:hover:not(.active) { background: var(--border-color); }

/* 일반 게시글 목록 */
.post-list { padding-top: 40px; }
.post-item { background: var(--card-background); border-radius: 12px; overflow: hidden; margin-bottom: 30px; box-shadow: var(--shadow-md); transition: var(--transition); }
.post-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.post-link { display: flex; text-decoration: none; color: inherit; }
.post-thumbnail { flex: 0 0 280px; position: relative; height: 260px; overflow: hidden; border-radius: 12px 0 0 12px; }
.post-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.post-content { flex: 1; padding: 25px; display: flex; flex-direction: column; }
.post-header { margin-bottom: 15px; }
.post-category { display: inline-block; background: var(--accent-color); color: white; padding: 4px 12px; border-radius: 20px; font-size: 14px; margin-bottom: 10px; }
.post-title { font-size: 22px; color: var(--text-primary); line-height: 1.4; margin: 0 0 15px; }
.post-excerpt { color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-bottom: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--text-secondary); font-size: 14px; }

/* 페이지네이션 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 50px; padding: 20px 0; }
.pagination a { color: var(--text-primary); text-decoration: none; padding: 8px 16px; border-radius: 6px; transition: var(--transition); }
.pagination a.active { background: var(--accent-color); color: white; }
.pagination a:hover:not(.active) { background: var(--border-color); }
.page-dots { color: var(--text-secondary); }
.page-arrow { display: flex; align-items: center; justify-content: center; }

/* 총개시물 스타일 */
.post-list-header { display: flex; justify-content: flex-end; margin-bottom: 15px; }
.post-count { color: var(--text-secondary); font-size: 15px; background: var(--card-background); padding: 6px 12px; border-radius: 15px; box-shadow: var(--shadow-sm); }

/* 반응형 디자인 */
@media (max-width: 1024px) {
   .container { max-width: 960px; }
   .featured-grid { gap: 20px; }
   .post-thumbnail { flex: 0 0 240px; height: 220px; }
}
@media (max-width: 768px) {
   .container { width: 100%; padding: 0; }
   .featured-posts { padding: 40px 5px; margin-bottom: 30px; }
   .section-title { font-size: 24px; margin-bottom: 30px; }
   .featured-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
   .post-link { flex-direction: column; }
   .post-thumbnail { flex: none; width: 100%; height: 200px; border-radius: 12px 12px 0 0; }
   .featured-image-wrapper { padding-top: 70%; }
   .featured-content { padding: 15px; }
   .featured-title { font-size: 16px; }
   .post-content { padding: 15px; }
   .post-title { font-size: 18px; margin-bottom: 10px; }
   .post-excerpt { font-size: 14px; -webkit-line-clamp: 2; margin-bottom: 10px; }
   .category-nav .container { padding: 0 15px; }
   .category-link { padding: 6px 15px; font-size: 14px; }
   .post-meta, .featured-meta { font-size: 12px; }
   .post-list { padding: 15px 5px 0; }
   .post-list-header { margin-bottom: 15px; padding: 0 5px; }
}
@media (max-width: 480px) {
   .featured-grid { grid-template-columns: 1fr; }
   .post-thumbnail { height: 180px; }
   .post-title { font-size: 17px; }
   .featured-category, .post-category { font-size: 12px; padding: 3px 10px; }
   .pagination { gap: 5px; }
   .pagination a { padding: 6px 12px; font-size: 14px; }
   .post-item { margin-bottom: 20px; }
   .featured-posts { padding: 30px 5px; }
   .category-nav { padding: 15px 0; }
   .category-link { padding: 5px 12px; font-size: 13px; }
}

/* 헤더 스타일 */
.main-header { background: var(--card-background); box-shadow: var(--shadow-sm); position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid var(--border-color); }
.header-content { display: flex; justify-content: space-between; align-items: center; height: 70px; padding: 0 1rem; }
/* 사이트 로고 및 제목 */
.site-title { display: flex; align-items: center; gap: 0.5rem; outline: none; text-decoration: none; flex-shrink: 0; }
.site-title:focus, .site-logo:focus { outline: none; border: none; }
.site-logo { width: 150px; height: auto; outline: none; border: none; box-shadow: none; }
/* 메뉴 토글 버튼 */
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 10px; z-index: 1001; }
.menu-icon { width: 24px; height: 2px; background-color: var(--text-primary); display: block; position: relative; transition: all 0.3s ease; }
.menu-icon::before, .menu-icon::after { content: ''; width: 24px; height: 2px; background-color: var(--text-primary); position: absolute; left: 0; transition: all 0.3s ease; }
.menu-icon::before { top: -8px; }
.menu-icon::after { top: 8px; }
.menu-toggle.active .menu-icon { background-color: transparent; }
.menu-toggle.active .menu-icon::before { transform: rotate(45deg); top: 0; }
.menu-toggle.active .menu-icon::after { transform: rotate(-45deg); top: 0; }
/* 내비게이션 - 우측 정렬 */
.main-nav { display: flex; align-items: center; flex-wrap: nowrap; gap: 0.7rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-left: 1rem; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-link { color: var(--text-primary); text-decoration: none; padding: 0.5rem 0.7rem; border-radius: 6px; transition: all 0.25s ease; font-size: 0.95rem; white-space: nowrap; }
.nav-link:hover, .nav-link.active { background: var(--accent-color); color: white; }

/* 애니메이션 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.post-item { animation: fadeIn 0.6s ease backwards; }
.post-item:nth-child(1) { animation-delay: 0.1s; }
.post-item:nth-child(2) { animation-delay: 0.2s; }
.post-item:nth-child(3) { animation-delay: 0.3s; }
.post-item:nth-child(4) { animation-delay: 0.4s; }
.post-item:nth-child(5) { animation-delay: 0.5s; }

/* 접근성 */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
a:focus { outline: 3px solid var(--accent-color); outline-offset: 2px; }

/* 모바일 메뉴 */
@media (max-width: 768px) {
   .menu-toggle { display: block; order: 3; }
   .main-nav { display: none; position: absolute; flex-direction: column; align-items: flex-start; top: 70px; left: 0; width: 100%; background-color: var(--card-background); box-shadow: var(--shadow-lg); z-index: 1001; padding: 1rem; border-radius: 0 0 12px 12px; border-top: 1px solid var(--border-color); max-height: 80vh; overflow-y: auto; }
   .main-nav.active { display: flex; animation: slideDown 0.3s ease; }
   .nav-link { width: 100%; padding: 0.8rem 1rem; border-radius: 8px; font-size: 1rem; }
   .nav-link:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.1); }
   .pagination .page-arrow { display: none !important; /* 모바일에서 "이전", "다음" 버튼 숨기기 */}
}
@media (max-width: 480px) {
   .header-content { height: 60px; padding: 0 0.5rem; }
   .site-logo { width: 120px; }
   .main-nav { top: 60px; }
   .nav-link { padding: 0.7rem 0.9rem; }
   .menu-toggle { padding: 8px; }
   .pagination .page-arrow { display: none !important; /* 모바일에서 "이전", "다음" 버튼 숨기기 */}
}