@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-gray: #f9fafb;
  --border: #e5e7eb;
  --max-width: 1080px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.site-title a {
  color: inherit;
}

.site-title a:hover {
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Main Content */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 160px);
}

.container--narrow {
  max-width: 768px;
}

/* Index Page */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-desc {
  color: var(--text-light);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  list-style: none;
}

.card-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
  background: var(--bg);
}

.card-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.card-item a {
  color: inherit;
  display: block;
}

.card-item a:hover {
  text-decoration: none;
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  display: block;
}

.card-item h2 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.card-item h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.card-item p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.card-count {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  padding: 0;
  list-style: none;
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb li::after {
  content: "›";
  margin-left: 0.4rem;
  color: var(--border);
}

.breadcrumb li:last-child::after {
  content: "";
}

.breadcrumb li:last-child {
  color: var(--text);
  font-weight: 500;
}

/* Hub Hero */
.hub-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.hub-hero .hub-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
  display: block;
}

.hub-hero h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.hub-hero p {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Hub Section */
.hub-section {
  margin-bottom: 2rem;
}

.hub-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

/* TOC */
.toc {
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.toc h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  border: none;
  padding: 0;
  margin-top: 0;
}

.toc ol {
  list-style: decimal;
  padding-left: 1.25rem;
  margin: 0;
}

.toc li {
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.toc a {
  color: var(--text);
}

.toc a:hover {
  color: var(--primary);
}

/* Post List (kept for backward compat) */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.2s;
}

.post-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.post-item a {
  color: inherit;
}

.post-item a:hover {
  text-decoration: none;
}

.post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.post-item h2 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 0.4rem;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Article Page */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.article-header .post-category {
  margin-bottom: 0.75rem;
}

.article-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.article-header .post-meta {
  font-size: 0.85rem;
}

.article-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-body p {
  margin-bottom: 1.2rem;
  word-break: keep-all;
}

.article-body ul, .article-body ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body strong {
  font-weight: 600;
}

/* Related Posts */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  border: none;
  padding: 0;
  margin-top: 0;
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-list li a {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.related-list li a:hover {
  background: var(--bg-gray);
  text-decoration: none;
}

/* Static Pages */
.static-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.static-page h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.static-page p {
  margin-bottom: 1rem;
}

.static-page ul, .static-page ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.static-page li {
  margin-bottom: 0.3rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-gray);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

.footer-inner a {
  color: var(--text-light);
}

.footer-inner a:hover {
  color: var(--primary);
}

.footer-links {
  margin-bottom: 0.5rem;
}

.footer-links a {
  margin: 0 0.5rem;
}

/* Responsive */
@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-nav {
    gap: 1rem;
  }

  .container {
    padding: 1.5rem 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hub-hero {
    padding: 1.5rem 1rem;
  }

  .hub-hero h1 {
    font-size: 1.35rem;
  }

  .article-header h1 {
    font-size: 1.35rem;
  }

  .article-body h2 {
    font-size: 1.15rem;
  }
}
