:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --border: #e7e5e4;
  --text: #1c1917;
  --text-muted: #78716c;
  --text-faint: #a8a29e;
  --indigo-950: #1e1b4b;
  --indigo-700: #4338ca;
  --indigo-600: #4f46e5;
  --indigo-500: #6366f1;
  --indigo-100: #e0e7ff;
  --indigo-50: #eef2ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: 896px;
  margin: 0 auto;
  padding: 0 16px;
}

.wrap-narrow {
  max-width: 672px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-emoji { font-size: 22px; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--indigo-950); letter-spacing: -0.02em; }
.logo-text .dot { color: var(--indigo-500); }
.logo-sub { font-size: 13px; color: var(--text-muted); }

.header-nav { font-size: 14px; color: var(--text-muted); display: flex; gap: 16px; }
.header-nav a:hover { color: var(--indigo-700); }

/* Hero + search */
.hero { padding: 56px 0 40px; text-align: center; }
.hero .eyebrow { font-size: 14px; font-weight: 500; color: var(--indigo-500); margin: 0 0 12px; }
.hero h1 { font-size: 32px; font-weight: 900; line-height: 1.3; color: var(--indigo-950); margin: 0 0 20px; }
.hero p.lead { color: var(--text-muted); margin: 0 0 32px; }

.search-wrap { position: relative; max-width: 560px; margin: 0 auto; }
.search-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #d6d3d1;
  background: var(--surface);
  padding: 14px 20px;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}
.search-input:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 3px var(--indigo-100); }

/* GNB 바로 아래 들어가는 축소형 검색바 (상세 페이지 등) */
.subsearch {
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.subsearch .search-wrap { max-width: 480px; }
.subsearch .search-input { padding: 10px 18px; font-size: 15px; }

.search-results {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  margin-top: 8px;
  max-height: 380px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  text-align: left;
  z-index: 30;
}
.search-results[hidden] { display: none; }
.search-results ul { list-style: none; margin: 0; padding: 0; }
.search-results li { border-top: 1px solid #f5f5f4; }
.search-results li:first-child { border-top: none; }
.search-results a { display: block; padding: 12px 16px; }
.search-results a:hover { background: var(--indigo-50); }
.search-empty { padding: 24px 16px; text-align: center; font-size: 14px; color: var(--text-faint); }

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 0 40px; }
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 6px 14px;
  font-size: 14px;
  color: var(--text-muted);
}
.tag-pill:hover { border-color: var(--indigo-500); color: var(--indigo-700); }
.tag-count { color: var(--text-faint); font-size: 13px; }

/* Section headings */
.section { padding-bottom: 56px; }
.section h2 { font-size: 18px; font-weight: 700; margin: 0 0 16px; }

/* Card grid */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.dream-card {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.dream-card:hover { border-color: #a5b4fc; box-shadow: 0 4px 14px rgba(79,70,229,0.08); }

.card-thumb { width: 80px; height: 80px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: var(--indigo-50); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 26px; }

.card-body { min-width: 0; flex: 1; }
.card-body h3 { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dream-card:hover .card-body h3 { color: var(--indigo-700); }
.card-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.chip { border-radius: 999px; background: var(--indigo-50); color: var(--indigo-700); font-size: 12px; padding: 2px 8px; }

/* Detail page */
.breadcrumb { font-size: 13px; color: var(--text-faint); margin: 24px auto; max-width: 672px;   }
.breadcrumb a:hover { color: var(--indigo-600); }
.breadcrumb .sep { margin: 0 6px; }

article.dream h1 { font-size: 26px; font-weight: 900; line-height: 1.4; color: var(--indigo-950); margin: 0 0 16px; }

.dream-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.dream-tags .chip { padding: 4px 10px; font-weight: 500; }

.dream-image { margin-bottom: 20px; }
.dream-image img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); object-fit: cover; }

.dream-answer {
  border-radius: 16px;
  border: 1px solid var(--indigo-100);
  background: var(--indigo-50);
  padding: 24px;
  margin-bottom: 40px;
}
.dream-answer h2 { font-size: 13px; font-weight: 700; color: var(--indigo-500); margin: 0 0 8px; }
.dream-answer p { font-size: 18px; line-height: 1.7; white-space: pre-line; margin: 0; }

.dream-more { margin-bottom: 40px; }
.dream-more h2 { font-size: 15px; font-weight: 700; color: #44403c; margin: 0 0 12px; }
.dream-more p { font-size: 15px; line-height: 1.8; color: #3f3d38; margin: 0 0 12px; }
.dream-more p:last-child { margin-bottom: 0; }

.related-section { padding-bottom: 64px; }
.related-section h2 { font-size: 17px; font-weight: 700; margin: 0 0 16px; }

/* Tag page */
.tag-hero { padding: 40px 0 24px; }
.tag-hero h1 { font-size: 22px; font-weight: 900; color: var(--indigo-950); margin: 0 0 6px; }
.tag-hero p { color: var(--text-muted); margin: 0; }

/* 상징 도감 역링크 */
.symbol-link { margin-top: 16px; }
.symbol-link a {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 12px 16px; border: 1px solid var(--indigo-100); border-radius: 12px;
  background: var(--indigo-50); color: var(--indigo-950);
}
.symbol-link a:hover { border-color: var(--indigo-500); }
.symbol-link-label { font-size: 12px; font-weight: 700; color: var(--indigo-700); }
.symbol-link strong { font-size: 15px; }
.symbol-link-site { font-size: 13px; color: var(--text-muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: auto; }
.site-footer .wrap { padding: 32px 16px; font-size: 13px; color: var(--text-muted); }
.site-footer p { margin: 0 0 8px; }
.footer-name { font-weight: 500; color: #44403c; }
.footer-fine { color: var(--text-faint); }

main { flex: 1; }

/* Not found page */
.notfound { padding: 80px 0; text-align: center; }
.notfound h1 { font-size: 28px; margin-bottom: 12px; }

/* 주제 허브 */
article.hub { padding-bottom: 64px; }
article.hub h1 { font-size: 26px; font-weight: 900; line-height: 1.4; color: var(--indigo-950); margin: 0 0 16px; }
.hub-intro p { font-size: 16px; line-height: 1.85; color: #3f3d38; margin: 0 0 14px; }
.hub-toc { margin: 28px 0 8px; padding: 18px 20px; border: 1px solid var(--indigo-100); border-radius: 16px; background: var(--indigo-50); }
.hub-toc h2 { font-size: 13px; font-weight: 700; color: var(--indigo-500); margin: 0 0 8px; }
.hub-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 24px; }
.hub-toc li { font-size: 14px; line-height: 1.9; break-inside: avoid; }
.hub-toc a:hover { color: var(--indigo-600); }
@media (max-width: 520px) { .hub-toc ol { columns: 1; } }
.hub-section { margin-top: 36px; scroll-margin-top: 16px; }
.hub-section h2 { font-size: 19px; font-weight: 800; color: var(--indigo-950); margin: 0 0 10px; }
.hub-section > p { font-size: 15px; line-height: 1.8; color: #3f3d38; margin: 0 0 12px; }
.hub-links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.hub-links li { border-bottom: 1px solid var(--border); }
.hub-links a { display: block; padding: 11px 4px; font-size: 15px; color: var(--text); }
.hub-links a:hover { color: var(--indigo-600); background: var(--surface); }
.hub-links a::after { content: " →"; color: var(--text-faint); }
.hub-more, .hub-back { margin: 14px 0 0; font-size: 14px; font-weight: 600; }
.hub-more a, .hub-back a { color: var(--indigo-600); }
.hub-related { margin-top: 48px; }
.hub-related h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; }
.hub-related .tag-cloud { padding: 0; justify-content: flex-start; }
.hub-pager { display: flex; justify-content: space-between; align-items: center; margin: 16px 0; font-size: 14px; color: var(--text-muted); }
.hub-pager a { color: var(--indigo-600); font-weight: 600; }

/* 5단계 보강 본문: 상황별 해석 / 관련 꿈 */
.dream-situations h3 { font-size: 15px; font-weight: 700; color: #292524; margin: 20px 0 6px; }
.dream-situations h3:first-of-type { margin-top: 0; }
.dream-related-notes ul { margin: 0; padding-left: 18px; }
.dream-related-notes li { font-size: 15px; line-height: 1.8; color: #3f3d38; margin-bottom: 8px; }
.dream-related-notes a { color: var(--indigo-700); font-weight: 600; }

/* 애드센스 본문 내 광고 */
.ad-slot { margin: 32px 0; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); min-height: 120px; }
.ad-label { font-size: 11px; color: var(--text-faint); text-align: center; margin-bottom: 6px; letter-spacing: 0.05em; }

/* 함께 보면 좋은 꿈 (글 목록) */
.related-list { margin-top: 32px; }
.related-list h2 { font-size: 1.1rem; margin-bottom: 10px; }
.related-list ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.related-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.related-list a { color: var(--indigo-700); text-decoration: none; }
.related-list a:hover { text-decoration: underline; }
@media (max-width: 640px) { .related-list ul { columns: 1; } }
