@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Nanum+Square+Neo:wght@400;700;900&display=swap');

/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
li { list-style: none !important; }

body { 
    font-family: 'Pretendard', -apple-system, sans-serif; 
    background-color: #fff; 
    color: #1a1a1a; 
    line-height: 1.7; 
    -webkit-font-smoothing: antialiased;
}

.link_tit, .c_cnt { display: none !important; }

/* --- Progress Bar --- */
#progress-bar {
    position: fixed; top: 0; left: 0; width: 0%; height: 4px;
    background: linear-gradient(to right, #000, #444); z-index: 10000;
}

/* 4. 사이드바 따라오기 문제 해결! align-items: flex-start 추가 */
.container { 
    max-width: 1200px; margin: 0 auto; padding: 0 40px; 
    display: grid; grid-template-columns: 1fr 340px; gap: 60px; 
    align-items: flex-start; /* 이 한 줄이 사이드바를 고정되게 만듭니다! */
}

/* --- Header --- */
header { 
    position: sticky; top: 0; z-index: 1000;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 30px 40px; border-bottom: 1px solid rgba(0,0,0,0.05); margin-bottom: 60px;
}

.logo { 
    font-family: 'Nanum Square Neo', sans-serif; 
    font-size: 2.2rem; font-weight: 900; letter-spacing: -2px;
    text-decoration: none; color: #1a1a1a; display: block;
}

#header-nav { margin-top: 25px; border-top: 1px solid rgba(0,0,0,0.03); padding-top: 20px; }
#header-nav .tt_category { display: block !important; }
#header-nav .tt_category .category_list { display: flex !important; flex-wrap: wrap; gap: 32px; list-style: none !important; }
#header-nav .tt_category .link_item { 
    color: #86868b !important; text-decoration: none !important; font-weight: 700 !important; 
    font-size: 0.9rem !important; transition: color 0.3s; background: none !important; padding: 0 !important;
}
#header-nav .tt_category .link_item.selected,
#header-nav .tt_category .link_item:hover { color: #1a1a1a !important; }

/* 현재 위치(활성화된 카테고리)에만 동그란 점(dot) 표시 */
#header-nav .tt_category .link_item.selected::before,
#header-nav .tt_category .link_sub_item.selected::before,
#sidebar-category .tt_category .link_item.selected::before,
#sidebar-category .tt_category .link_sub_item.selected::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #1a1a1a;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* --- Main Content --- */
.main-content { padding-bottom: 100px; width: 100%; min-width: 0; }

/* 2. 대망의 '자동 히어로 포스트 (큰 글)' 시스템 */
.post-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.post-item { margin-bottom: 20px; }

/* 그리드 첫 번째 글 무조건 크게 (히어로 강제 변환) */
.post-grid .post-item:first-child {
    grid-column: 1 / -1; /* 두 칸 모두 차지 */
    margin-bottom: 60px;
}
.post-grid .post-item:first-child .thumb {
    height: 480px; /* 원래 260px에서 480px로 거대하게 */
    border-radius: 28px;
}
.post-grid .post-item:first-child h3 {
    font-size: 2.5rem; /* 제목도 거대하게 */
    font-family: 'Nanum Square Neo', sans-serif;
    line-height: 1.25;
}
.post-grid .post-item:first-child .category {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
/* 두 번째 글부터는 요약(excerpt) 숨김 (디자인 유지) */
.post-item p.excerpt { display: none; }
.post-grid .post-item:first-child p.excerpt { 
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #555; 
    margin-top: 20px; 
    font-size: 1.1rem; 
    line-height: 1.8; /* 줄간격을 띄워 가독성 확보 */
    word-break: keep-all;
}

.post-item .thumb { 
    width: 100%; height: 260px; background: #f5f5f7; border-radius: 22px; 
    margin-bottom: 20px; background-size: cover; background-position: center;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.post-item:hover .thumb { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(0,0,0,0.08); }
.post-item .category { display: block; font-size: 0.75rem; color: #86868b; margin-bottom: 8px; font-weight: 700; }

/* 제목 텍스트 & 마법의 호버 애니메이션 */
.post-item h3 { 
    font-size: 1.35rem; font-weight: 700; line-height: 1.4; color: #1a1a1a; 
    text-decoration: none !important; word-break: keep-all; display: inline-block; position: relative;
}
.post-item a { text-decoration: none !important; } /* 링크 자체의 밑줄 강제 제거 */
.post-item h3::after {
    content: ''; position: absolute; width: 100%; transform: scaleX(0); height: 2px;
    bottom: -2px; left: 0; background-color: #1a1a1a; transform-origin: bottom right;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.post-item:hover h3::after {
    transform: scaleX(1); transform-origin: bottom left;
}

/* 5. 퍼머링크(포스트 본문) 상세 출력. grid 무시하고 풀 캔버스 */
.post-view { 
    grid-column: 1 / -1; 
    padding-top: 20px; 
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.post-header { margin-bottom: 50px; }
.post-header h1 { 
    font-family: 'Nanum Square Neo', sans-serif; 
    font-size: 2.8rem; font-weight: 800; line-height: 1.3; margin-bottom: 15px; word-break: keep-all; 
}
.post-header .category { color: #86868b; font-weight: 700; letter-spacing: 1.5px; margin-bottom: 10px; display: inline-block; }
.post-meta { font-size: 1rem; color: #888; }

.post-content { font-size: 1.1rem; line-height: 1.8; color: #333; }
.post-content img { max-width: 100%; border-radius: 20px; margin: 30px 0; }
blockquote { 
    padding: 24px 32px; background: #f7f6f3; border-radius: 16px; margin: 30px 0; 
    font-size: 1.05rem; position: relative; border-left: 0; 
}
blockquote::before { content: "💡"; font-size: 1.4rem; margin-right: 10px; }

/* --- Sidebar --- */
.sidebar { position: sticky; top: 220px; align-self: start; width: 100%; } /* 헤더와의 겹침 방지를 위해 150px -> 220px로 확장 */
.widget { background: #f5f5f7; padding: 32px; border-radius: 24px; margin-bottom: 35px; width: 100%; }
.widget.glass { background: rgba(242, 242, 247, 0.5); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(0,0,0,0.05); }
.widget-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 20px; color: #1d1d1f; border-bottom: none; padding-bottom: 0px; }

/* Sidebar Category */
#sidebar-category .tt_category .category_list { display: block !important; padding: 0 !important; }
#sidebar-category .tt_category .link_item { 
    display: block !important; padding: 14px 20px !important; background: rgba(0,0,0,0.03) !important;
    border-radius: 16px !important; text-decoration: none !important; color: #444 !important;
    font-weight: 700 !important; font-size: 0.95rem !important; margin-bottom: 12px;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important; border: none !important;
}
#sidebar-category .tt_category .link_item:hover { background: #1d1d1f !important; color: #fff !important; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

/* Custom Scrollbar (Mac/Notion Style - Ultra Thin) */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.3); }
/* Trending Widget */
.widget-list { list-style: none; margin-top: 20px; padding: 0; }
.widget-item { margin-bottom: 12px; }
.widget-link { 
    display: block; padding: 14px 20px; background: rgba(0,0,0,0.03); border-radius: 16px;
    text-decoration: none; color: #444; font-weight: 700; font-size: 0.95rem; transition: all 0.4s;
}
.widget-link:hover { background: #1d1d1f; color: #fff; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

/* --- Spotlight Slider (무조건 등장하도록 강제화) --- */
.wide-gallery { margin: 100px 0; width: 100%; overflow: hidden; }
.slider-wrapper { padding: 0 40px; position: relative; }
.gallery-container { 
    display: flex; gap: 20px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; padding-bottom: 30px;
}
.gallery-container::-webkit-scrollbar { display: none; }
.gallery-item { flex: 0 0 500px; height: 320px; border-radius: 24px; overflow: hidden; position: relative; transition: all 0.5s; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 30px; background: linear-gradient(to top, rgba(0,0,0,0.6), transparent); color: #fff; }

.slider-nav { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); display: flex; justify-content: space-between; padding: 0 60px; pointer-events: none; z-index: 10; }
.nav-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: auto; opacity: 0; transition: all 0.3s; }
.slider-wrapper:hover .nav-btn { opacity: 1; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.9); transform: scale(1.1); }

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.reveal { animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

/* --- Responsive (Mobile / Tablet) --- */
@media screen and (max-width: 900px) {
    /* 1. 레이아웃 1열 종대 */
    .container { grid-template-columns: 1fr; gap: 40px; padding: 0 20px; }
    
    /* 2. 헤더 패딩 축소 */
    header { padding: 20px; margin-bottom: 30px; }
    .logo { font-size: 1.8rem; }
    
    /* 3. 포스트 목록 구조 최적화 (모두 1열) */
    .post-grid { grid-template-columns: 1fr; gap: 30px; }
    .post-grid .post-item:first-child .thumb { height: 320px; } /* 히어로 포스트 높이 좀 줄임 */
    .post-item .thumb { height: 220px; }
    .post-grid .post-item:first-child h3 { font-size: 1.8rem; }
    .post-grid .post-item:first-child p.excerpt { font-size: 1rem; }
    
    /* 4. 본문 크기 최적화 */
    .post-header h1 { font-size: 2rem; }
    .post-content { font-size: 1.05rem; }
    
    /* 5. 사이드바 하단 배치 (Sticky 해제) */
    .sidebar { position: static; margin-top: 40px; }
    
    /* 6. 스포트라이트 넓이 축소 */
    .slider-wrapper { padding: 0 20px; }
    .gallery-item { flex: 0 0 300px; height: 240px; }
    .slider-nav { padding: 0 20px; }
    .nav-btn { width: 36px; height: 36px; }
}
