/* ============================================================
   dream.hisoyul.com — 꿈해몽 디자인 시스템
   설계 원칙: 모바일 우선 / 정적 / 빠른 독해 / 한국어 최적화
   ============================================================ */

/* ── 토큰 ─────────────────────────────────── */
:root {
  /* 색상 */
  --ink:       #1a1a2e;      /* 본문 텍스트 */
  --ink-soft:  #4a4a6a;      /* 보조 텍스트 */
  --ink-mute:  #8888aa;      /* 메타 정보 */
  --bg:        #f8f7ff;      /* 페이지 배경 (보라 기운 흰색) */
  --bg-card:   #ffffff;
  --bg-deep:   #0f0e1a;      /* 헤더 배경 */
  --accent:    #7c5cbf;      /* 보라 — 신비·꿈 */
  --accent-lt: #e8e0ff;      /* 연보라 배경 */
  --gold:      #c8922a;      /* 길몽 강조 */
  --gold-lt:   #fff8e6;
  --red:       #c0392b;      /* 흉몽 강조 */
  --red-lt:    #fff0ee;
  --border:    #e2dff5;

  /* 타이포 */
  --font-kor:  'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* 스케일 */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  /* 레이아웃 */
  --content-w: 780px;
  --radius:    10px;
  --radius-lg: 16px;
}

/* ── 리셋 & 기본 ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-kor);
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { padding-left: 1.4em; }

/* ── 레이아웃 컨테이너 ──────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── 사이트 헤더 ────────────────────────────── */
.site-header {
  background: var(--bg-deep);
  color: #fff;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(124,92,191,0.4);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-logo {
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.site-logo span { color: var(--accent); }

/* ── 검색창 ─────────────────────────────────── */
.search-wrap {
  flex: 1;
  min-width: 0;
  max-width: 480px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.5rem 2.8rem 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: var(--text-base);
  font-family: var(--font-kor);
  background: rgba(255,255,255,0.12);
  color: #fff;
  outline: none;
  transition: background 0.2s;
}
.search-input::placeholder { color: rgba(255,255,255,0.5); }
.search-input:focus { background: rgba(255,255,255,0.2); }

.search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
}

/* ── 브레드크럼 ─────────────────────────────── */
.breadcrumb {
  font-size: var(--text-sm);
  color: var(--ink-mute);
  padding: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb-sep { color: var(--ink-mute); }

/* ── 메인 레이아웃 ──────────────────────────── */
.page-wrap {
  padding: 1.5rem 0 3rem;
}

/* ── 빠른 해몽 카드 ─────────────────────────── */
.quick-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
}

@media (max-width: 500px) {
  .quick-card { grid-template-columns: 1fr; }
}

.quick-item {}
.quick-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 0.2rem;
}
.quick-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
}

.quick-good .quick-value { color: var(--gold); }
.quick-bad .quick-value  { color: var(--red); }

.quick-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
}
.badge-good { background: var(--gold-lt); color: var(--gold); }
.badge-bad  { background: var(--red-lt);  color: var(--red); }
.badge-both { background: var(--accent-lt); color: var(--accent); }

/* ── 본문 타이포 ─────────────────────────────── */
.prose h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.prose h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}

.prose h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--accent);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-bottom: 1rem;
  color: var(--ink);
}

.prose ul, .prose ol {
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.3rem;
}

.prose strong { color: var(--ink); }

.intro-para {
  font-size: var(--text-lg);
  line-height: 1.85;
  color: var(--ink-soft);
  margin-bottom: 0;
}

/* ── 길흉 판단 박스 ─────────────────────────── */
.verdict-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

@media (max-width: 480px) {
  .verdict-box { grid-template-columns: 1fr; }
}

.verdict-good, .verdict-bad {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.verdict-good {
  background: var(--gold-lt);
  border-left: 4px solid var(--gold);
}
.verdict-bad {
  background: var(--red-lt);
  border-left: 4px solid var(--red);
}

.verdict-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.verdict-good .verdict-title { color: var(--gold); }
.verdict-bad  .verdict-title { color: var(--red); }

.verdict-list {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  list-style: none;
  padding: 0;
}
.verdict-list li::before {
  content: "· ";
  color: var(--ink-mute);
}

/* ── 상황별 꿈풀이 섹션 ──────────────────────── */
.situation-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
}

.situation-tag {
  display: inline-block;
  background: var(--accent-lt);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

/* ── FAQ 아코디언 ────────────────────────────── */
.faq-list { margin: 0; }

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-q {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 0;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--ink);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-kor);
  line-height: 1.6;
}

.faq-q:hover { color: var(--accent); }

.faq-icon {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 1.2rem;
  transition: transform 0.2s;
  margin-top: 0.1rem;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-a {
  display: none;
  padding: 0 0 1rem;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  line-height: 1.8;
}

.faq-item.open .faq-a { display: block; }

/* ── 관련 꿈 카드 그리드 ─────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(124,92,191,0.12);
  text-decoration: none;
  color: var(--accent);
}

.related-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ── 면책 공고 ──────────────────────────────── */
.disclaimer {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  color: var(--ink-mute);
  line-height: 1.7;
}

/* ── 허브 페이지 카드 그리드 ─────────────────── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.hub-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hub-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(124,92,191,0.15);
  transform: translateY(-2px);
  text-decoration: none;
}

.hub-emoji { font-size: 2rem; }
.hub-name  { font-size: var(--text-sm); font-weight: 600; }
.hub-count { font-size: var(--text-xs); color: var(--ink-mute); }

/* ── 홈 히어로 검색 ─────────────────────────── */
.hero {
  background: var(--bg-deep);
  color: #fff;
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.hero-eyebrow {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

.hero-title em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero-sub {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.55);
  margin-bottom: 1.75rem;
}

.hero-search-wrap {
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

.hero-input {
  width: 100%;
  padding: 0.9rem 3.5rem 0.9rem 1.4rem;
  border-radius: 999px;
  border: none;
  font-size: var(--text-base);
  font-family: var(--font-kor);
  color: var(--ink);
  outline: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.hero-submit {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.hero-chip {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 0.15s;
}

.hero-chip:hover {
  background: rgba(255,255,255,0.2);
  text-decoration: none;
  color: #fff;
}

/* ── 홈 섹션 타이틀 ─────────────────────────── */
.section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 0.5rem;
}

/* ── 최근 추가 리스트 ────────────────────────── */
.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--text-sm);
  transition: border-color 0.15s;
}

.recent-item:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.recent-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ── 사이트 푸터 ─────────────────────────────── */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255,255,255,0.5);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: var(--text-sm);
  text-align: center;
  line-height: 2;
}

.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: #fff; }

/* ── 허브 드림 링크 리스트 ──────────────────── */
.dream-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  margin-top: 1rem;
}

.dream-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: var(--text-sm);
  transition: all 0.15s;
}

.dream-link:hover {
  border-color: var(--accent);
  background: var(--accent-lt);
  color: var(--accent);
  text-decoration: none;
}

/* ── 반응형 ─────────────────────────────────── */
@media (max-width: 640px) {
  .prose h1 { font-size: var(--text-2xl); }
  .prose h2 { font-size: var(--text-lg); }
  .hub-grid { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: 1fr; }
  .dream-list { grid-template-columns: 1fr; }
}

/* ── 유틸 ───────────────────────────────────── */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.text-mute { color: var(--ink-mute); font-size: var(--text-sm); }
.tag {
  display: inline-block;
  background: var(--accent-lt);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* ── 모션 감소 ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
