/* ============================================================
   ghost-k.com — SEO 최적화 경량 스킨 CSS
   Black & White Clean Light
   ============================================================ */

/* ── 구글 폰트 폴백 ── */
:root {
  --ff: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  --bg:      #ffffff;
  --bg2:     #f8f8f6;
  --bg3:     #f0efec;
  --line:    #e5e3de;
  --line2:   #d0cdc8;
  --txt:     #111111;
  --txt2:    #555555;
  --txt3:    #999999;
  --accent:  #111111;
  --hdr-h:   56px;
  --sb-w:    220px;
  --r:       6px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--ff); background: var(--bg); color: var(--txt); line-height: 1.75; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ── 접근성 ── */
.skip-nav { position: absolute; top: -100px; left: 0; background: var(--txt); color: #fff; padding: 8px 16px; z-index: 9999; font-size: 13px; border-radius: 0 0 var(--r) 0; }
.skip-nav:focus { top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  height: var(--hdr-h);
}
.header-inner {
  max-width: 1160px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.header-logo a { display: flex; align-items: center; }
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; color: var(--txt); }
.header-logo img { height: 28px; width: auto; }

.header-nav { display: flex; gap: 24px; margin-left: auto; }
.header-nav a { font-size: 13px; font-weight: 500; color: var(--txt2); letter-spacing: 0.03em; text-transform: uppercase; padding: 4px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.header-nav a:hover { color: var(--txt); border-color: var(--txt); }

/* 햄버거 */
.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; margin-left: auto; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--txt); border-radius: 2px; transition: .2s; }

/* 모바일 nav */
.mobile-nav { display: none; flex-direction: column; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 24px 16px; }
.mobile-nav.open { display: flex; }
.mobile-nav a { padding: 10px 0; font-size: 14px; font-weight: 500; color: var(--txt2); border-bottom: 1px solid var(--line); }
.mobile-nav a:last-child { border-bottom: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.site-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  gap: 40px;
  align-items: start;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
  position: sticky;
  top: calc(var(--hdr-h) + 16px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.widget { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; background: var(--bg); }
.widget-title { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--txt3); margin-bottom: 12px; }

/* 검색 */
.search-form { display: flex; border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; }
.search-input { flex: 1; padding: 8px 12px; font-size: 13px; font-family: var(--ff); border: none; outline: none; background: var(--bg2); color: var(--txt); }
.search-input::placeholder { color: var(--txt3); }
.search-btn { padding: 8px 12px; background: var(--bg2); color: var(--txt3); border-left: 1px solid var(--line2); transition: color .15s; }
.search-btn:hover { color: var(--txt); }

/* 카테고리 */
.tt_category { display: flex; flex-direction: column; }
.tt_category a { font-size: 13px; color: var(--txt2); padding: 5px 6px; border-radius: 4px; display: flex; justify-content: space-between; transition: background .12s, color .12s; }
.tt_category a:hover { background: var(--bg3); color: var(--txt); }
.tt_category li li a { padding-left: 18px; font-size: 12px; }
.tt_category .link_tit { font-weight: 600; }

/* 최근글 */
.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-list li a { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--txt2); line-height: 1.4; transition: color .12s; }
.recent-list li a:hover { color: var(--txt); }
.recent-list img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.recent-list span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 태그 클라우드 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-item { font-size: 12px; padding: 3px 10px; border: 1px solid var(--line2); border-radius: 999px; color: var(--txt2); background: var(--bg2); transition: all .12s; }
.tag-item:hover { background: var(--txt); color: #fff; border-color: var(--txt); }

/* 방문자 */
.visitor-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; }
.visitor-grid > div { display: flex; flex-direction: column; gap: 2px; }
.v-num { font-size: 15px; font-weight: 700; color: var(--txt); }
.v-label { font-size: 11px; color: var(--txt3); }

/* 광고 위젯 */
.ad-widget { padding: 0; border: none; overflow: hidden; }

/* ============================================================
   MAIN
   ============================================================ */
#main-content { min-width: 0; }

/* 광고 영역 */
.ad-top, .ad-bottom, .ad-article-top, .ad-article-bottom { margin: 20px 0; }

/* 목록 제목 */
.list-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.02em; }
.empty-msg { color: var(--txt3); font-size: 14px; padding: 32px 0; text-align: center; }

/* ============================================================
   POST CARD (목록)
   ============================================================ */
.post-list { display: flex; flex-direction: column; }

.post-card { border-bottom: 1px solid var(--line); }
.post-card:first-child { border-top: 1px solid var(--line); }
.post-card-link { display: flex; gap: 20px; align-items: flex-start; padding: 20px 0; }

.post-thumb { width: 120px; height: 80px; flex-shrink: 0; border-radius: 4px; overflow: hidden; background: var(--bg3); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.post-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }

.post-meta { display: flex; gap: 8px; align-items: center; }
.post-category { font-size: 11px; font-weight: 700; color: var(--txt3); letter-spacing: 0.06em; text-transform: uppercase; }
.post-date { font-size: 12px; color: var(--txt3); }
.notice-badge { color: #fff; background: var(--txt); padding: 2px 8px; border-radius: 3px; }

.post-title { font-size: 15px; font-weight: 700; color: var(--txt); letter-spacing: -0.01em; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .12s; }
.post-card-link:hover .post-title { color: var(--txt2); }

.post-summary { font-size: 13px; color: var(--txt2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post { max-width: 720px; }

.post-header { margin-bottom: 24px; }
.post-category-badge a { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--txt3); border: 1px solid var(--line2); padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 12px; }
.single-title { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.35; color: var(--txt); margin-bottom: 12px; }
.single-meta { font-size: 13px; color: var(--txt3); display: flex; gap: 12px; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
.single-meta a { color: var(--txt3); }

/* 대표 이미지 */
.single-thumb { margin: 20px 0; border-radius: var(--r); overflow: hidden; }
.single-thumb img { width: 100%; height: auto; }

/* 관리자 바 */
.admin-bar { display: flex; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--bg3); border-radius: var(--r); margin-bottom: 16px; }
.admin-bar a, .admin-bar button { font-size: 12px; color: var(--txt2); text-decoration: underline; }

/* ── 본문 콘텐츠 ── */
.entry-content { font-size: 15px; line-height: 1.85; color: var(--txt); }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 {
  font-weight: 700; letter-spacing: -0.02em; margin: 1.8em 0 0.6em; line-height: 1.3; color: var(--txt);
}
.entry-content h2 { font-size: 19px; padding-left: 12px; border-left: 3px solid var(--txt); }
.entry-content h3 { font-size: 17px; }
.entry-content h4 { font-size: 15px; }
.entry-content p { margin-bottom: 1em; }
.entry-content strong { font-weight: 700; }
.entry-content em { font-style: italic; }
.entry-content a { color: var(--txt); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line2); }
.entry-content a:hover { text-decoration-color: var(--txt); }
.entry-content blockquote { border-left: 3px solid var(--line2); padding: 10px 16px; margin: 20px 0; background: var(--bg2); color: var(--txt2); border-radius: 0 4px 4px 0; }
.entry-content pre { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; overflow-x: auto; margin: 16px 0; font-size: 13px; }
.entry-content code { font-size: 13px; background: var(--bg2); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; }
.entry-content pre code { background: none; border: none; padding: 0; }
.entry-content ul, .entry-content ol { padding-left: 20px; margin-bottom: 1em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 4px; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 16px 0; }
.entry-content th { background: var(--txt); color: #fff; padding: 9px 12px; font-weight: 600; font-size: 13px; text-align: left; }
.entry-content td { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.entry-content tr:nth-child(even) td { background: var(--bg2); }
.entry-content img { border-radius: var(--r); margin: 16px 0; max-width: 100%; }
.entry-content hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

/* 태그 */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 24px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.tag-list a { font-size: 12px; padding: 4px 12px; border: 1px solid var(--line2); border-radius: 999px; color: var(--txt2); background: var(--bg2); transition: all .12s; }
.tag-list a:hover { background: var(--txt); color: #fff; border-color: var(--txt); }

/* 이전/다음 */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 32px 0; border-top: 1px solid var(--line); padding-top: 24px; }
.post-nav a { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg2); transition: background .12s; }
.post-nav a:hover { background: var(--bg3); }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; color: var(--txt3); text-transform: uppercase; }
.nav-post-title { font-size: 13px; font-weight: 600; color: var(--txt); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-next { text-align: right; }

/* 댓글 */
.comments-wrap { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 24px; }

/* ============================================================
   COVER SECTION
   ============================================================ */
.cover-section { margin-bottom: 32px; }
.cover-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.cover-header h2 { font-size: 16px; font-weight: 700; }
.more-link { font-size: 12px; color: var(--txt3); }
.more-link:hover { color: var(--txt); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 32px; }
.page-btn, .page-num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 4px; font-size: 14px; color: var(--txt2); border: 1px solid var(--line); background: var(--bg); transition: all .12s; }
.page-btn:hover, .page-num:hover { background: var(--bg3); color: var(--txt); }
.page-num[style*="bold"], .page-num.on { background: var(--txt) !important; color: #fff !important; border-color: var(--txt) !important; font-weight: 700; }
.no_more_prev, .no_more_next { opacity: 0.3; pointer-events: none; }
.page-nums { display: flex; gap: 4px; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer { border-top: 1px solid var(--line); background: var(--bg2); }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 20px 24px; }
.footer-copy { font-size: 13px; color: var(--txt3); }
.footer-copy a { color: var(--txt3); }
.footer-copy a:hover { color: var(--txt); }

/* ============================================================
   SCROLL TOP
   ============================================================ */
#scroll-top { position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px; background: var(--txt); color: #fff; border-radius: 50%; font-size: 18px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .2s; z-index: 99; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
#scroll-top:hover { background: #333; }

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .site-wrap { grid-template-columns: 1fr; gap: 0; padding: 20px 16px 40px; }
  #sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
  .header-nav { display: none; }
  .nav-toggle { display: flex; }
  #site-header { height: auto; min-height: var(--hdr-h); }
  .header-inner { height: var(--hdr-h); }
  .single-title { font-size: 20px; }
}

@media (max-width: 540px) {
  #sidebar { grid-template-columns: 1fr; }
  .post-card-link { flex-direction: column; gap: 12px; }
  .post-thumb { width: 100%; height: 160px; }
  .post-title { white-space: normal; }
  .post-nav { grid-template-columns: 1fr; }
}
