@charset "UTF-8";
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* === 1. 기본 리셋 및 변수 === */
:root {
  --primary: #0f172a;       /* 딥 네이비 */
  --accent: #1d4ed8;        /* 신뢰감 있는 블루 */
  --bg-page: #ffffff;
  --bg-soft: #f8fafc;
  --border: #e2e8f0;
  --text-main: #1e293b;
  --text-sub: #64748b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }

/* === 2. 상단 헤더 === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-brand a {
  font-size: 21px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}
.site-nav ul {
  display: flex;
  gap: 24px;
}
.site-nav a {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  transition: color 0.2s;
}
.site-nav a:hover { color: var(--accent); }
.header-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  background: var(--bg-soft);
}
.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 130px;
  color: var(--text-main);
}
.header-search button {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
}

/* === 3. 상단 카테고리 바 === */
.category-bar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.category-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  overflow-x: auto;
}
.tt_category, .tt_category ul {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.tt_category .link_tit, .tt_category .link_item, .tt_category .link_sub_item {
  display: inline-block;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: all 0.2s;
}
.tt_category a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.c_cnt { font-size: 12px; color: var(--text-sub); margin-left: 3px; }

/* === 4. 메인 컨테이너 및 홈 2열 카드 그리드 === */
.site-main { min-height: 70vh; padding: 48px 20px 80px; }
.main-container { max-width: 1000px; margin: 0 auto; }

.list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary);
}
.list-title { font-size: 24px; font-weight: 800; color: var(--primary); }
.list-count { font-size: 14px; color: var(--text-sub); }

/* 목록 화면일 때만 2열 그리드 적용 */
#tt-body-index .article-wrapper,
#tt-body-category .article-wrapper,
#tt-body-search .article-wrapper,
#tt-body-tag .article-wrapper {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.post-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.07);
}
.card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 22px; }
.card-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: #eff6ff;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.card-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-summary {
  font-size: 14.5px;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { font-size: 13px; color: #94a3b8; }

/* === 5. 글 상세 본문 (전문 매거진 가독성) === */
.single-post {
  max-width: 780px;
  margin: 0 auto;
}
.post-header {
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.post-category {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.post-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.38;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.post-meta {
  font-size: 14px;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-ctrl { margin-left: auto; display: flex; gap: 10px; }
.admin-ctrl a { color: var(--accent); font-weight: 600; }

/* 본문 타이포그래피 (대제목·소제목·표·인용구) */
.entry-content {
  font-size: 17px;
  line-height: 1.88;
  color: #1f2937;
  letter-spacing: -0.015em;
}
.entry-content p { margin-bottom: 20px; }

.entry-content h2 {
  font-size: 23px;
  font-weight: 800;
  color: var(--primary);
  background: var(--bg-soft);
  border-left: 5px solid var(--primary);
  border-bottom: 1px solid var(--border);
  padding: 13px 18px;
  margin: 46px 0 20px;
  line-height: 1.45;
  border-radius: 0 6px 6px 0;
}
.entry-content h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 30px 0 14px;
  line-height: 1.45;
}
.entry-content ul, .entry-content ol {
  margin: 16px 0 24px 20px;
  list-style: disc;
}
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 8px; }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 15px;
  border-top: 2px solid var(--primary);
}
.entry-content th {
  background: #f1f5f9;
  color: var(--primary);
  font-weight: 700;
  padding: 13px 14px;
  border-bottom: 1px solid #cbd5e1;
  text-align: left;
}
.entry-content td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: #334155;
}
.entry-content blockquote {
  background: var(--bg-soft);
  border-left: 4px solid #64748b;
  padding: 18px 22px;
  margin: 28px 0;
  color: #334155;
  border-radius: 4px;
}

/* 태그 및 관련 글 */
.post-tags { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-sub); }
.post-tags a { display: inline-block; background: var(--bg-soft); padding: 4px 12px; border-radius: 16px; margin: 0 6px 6px 0; }

.related-posts {
  margin-top: 44px;
  padding: 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.related-heading { font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 14px; }
.related-list li { border-bottom: 1px solid var(--border); }
.related-list li:last-child { border-bottom: none; }
.related-list a { display: flex; justify-content: space-between; padding: 11px 0; font-size: 15px; }
.related-list a:hover .rel-title { color: var(--accent); text-decoration: underline; }
.rel-date { font-size: 13px; color: #94a3b8; flex-shrink: 0; margin-left: 12px; }

/* 댓글 */
.post-comments { margin-top: 44px; }
.comment-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-meta { font-size: 14px; margin-bottom: 6px; display: flex; gap: 10px; color: var(--text-sub); }
.comment-meta strong { color: var(--primary); }
.comment-form { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.guest-inputs { display: flex; gap: 10px; }
.guest-inputs input, .comment-form textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: 14px;
}
.comment-form button {
  align-self: flex-end; padding: 10px 22px; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-weight: 700; cursor: pointer;
}

/* 페이지네이션 & 푸터 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 56px; }
.page-btn, .page-num {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-weight: 600; color: #475569;
}
.page-num .selected { color: var(--accent); font-weight: 800; }
.no-more-prev, .no-more-next { opacity: 0.35; pointer-events: none; }

.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 36px 20px;
}
.footer-inner {
  max-width: 1040px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-brand { font-size: 16px; font-weight: 800; color: var(--primary); margin-bottom: 4px; }
.footer-copy { font-size: 13px; color: var(--text-sub); }
.footer-menu ul { display: flex; gap: 18px; font-size: 13px; color: var(--text-sub); }

/* === 6. 모바일 반응형 === */
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 14px 16px; }
  .header-search { display: none; }
  #tt-body-index .article-wrapper,
  #tt-body-category .article-wrapper,
  #tt-body-search .article-wrapper,
  #tt-body-tag .article-wrapper {
    grid-template-columns: 1fr;
  }
  .post-title { font-size: 25px; }
  .entry-content { font-size: 16px; }
  .entry-content h2 { font-size: 20px; padding: 11px 14px; }
}
/* === 자동 목차(TOC) 디자인 === */
.entry-content h2,
.entry-content h3 {
  scroll-margin-top: 90px;
}

.auto-toc {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0f172a;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 0 0 36px 0;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.toc-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.toc-toggle {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.toc-toggle:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
}

.toc-list {
  margin: 14px 0 0 0;
  padding: 0;
  list-style: none;
}

.auto-toc.is-collapsed .toc-header {
  padding-bottom: 0;
  border-bottom: none;
}

.auto-toc.is-collapsed .toc-list {
  display: none;
}

.toc-item {
  margin-bottom: 8px;
  line-height: 1.5;
}

.toc-item:last-child {
  margin-bottom: 0;
}

.toc-item a {
  color: #334155;
  text-decoration: none;
  transition: color 0.15s ease;
}

.toc-item a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.toc-h2 a {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.toc-h3 {
  padding-left: 16px;
}

.toc-h3 a {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}