/*
 * 내집마련하GO 레이아웃 CSS (buupbox.com 테마 이식)
 * design-tokens.css의 변수를 사용해 헤더/내비/히어로/카드그리드/푸터를 구성
 */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── 헤더 / 내비게이션 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .nav-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}
.brand:hover { text-decoration: none; }
.site-nav-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}
.site-nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.site-nav-list a:hover {
  background: var(--bg-secondary);
  color: var(--accent);
  text-decoration: none;
}
.site-nav-list .current-menu-item a,
.site-nav-list .current_page_item a {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.site-nav-list .current-menu-item a:hover,
.site-nav-list .current_page_item a:hover {
  background: var(--accent-hover);
  color: #fff;
}

/* ── 히어로 (홈) ── */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 20px 32px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 12px;
}
.hero p.lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 28px;
}
/* ── 카드 그리드 (허브/최신글) ── */
.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px;
}
.section h2 {
  font-size: 1.4rem;
  margin-bottom: 18px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.grid .card {
  background: var(--bg-secondary);
  padding: 0 0 20px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.grid .card .card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 14px;
  background: var(--border); /* 이미지 로드 전/누락 시 채워지는 배경 */
}
.grid .card h3, .grid .card p {
  padding-left: 20px;
  padding-right: 20px;
}
.grid .card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
.grid .card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.grid .card a.card-link {
  position: absolute;
  inset: 0;
}
.grid .card { position: relative; }
.pick-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ── 주제별로 보기 (홈 화면 카테고리 그룹) ── */
.post-group + .post-group { margin-top: 36px; }
.post-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.post-group-head h3 { margin: 0; font-size: 1.1rem; }
.post-group-more {
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--text-muted);
}
.post-group-more:hover { color: var(--accent); }

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.post-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.post-list .card-thumb {
  width: 96px;
  height: 54px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
  background: var(--border);
}
.post-list-text { min-width: 0; }
.post-list .tag {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
  margin-right: 8px;
}

/* ── 피처드 이미지 (허브/클러스터/매거진 상단 썸네일) ── */
.featured-thumb-wrap {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 0 20px;
}
.featured-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
}

/* ── 본문 아티클 ── */
article.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
article.post h1 { font-size: 1.8rem; margin-bottom: 12px; }
article.post .byline {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
article.post h2 { font-size: 1.3rem; margin-top: 40px; border-top: 1px solid var(--border); padding-top: 24px; }
article.post h3 { font-size: 1.08rem; margin-top: 28px; margin-bottom: 10px; color: var(--text-primary); }
article.post table { width: 100%; border-color: var(--border) !important; margin: 16px 0; }
article.post table th { background: var(--bg-secondary); }
article.post ul, article.post ol { padding-left: 1.4em; }
article.post li { margin: 6px 0; }
article.post li::marker { color: var(--accent); }

/* ── FAQ 카드 ── */
article.post dl {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}
article.post .faq-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px 22px;
}
article.post .faq-item dt {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
}
article.post .faq-item dd {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.75;
}

/* ── 참고 자료 박스 ── */
article.post .sources-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin: 24px 0;
}
article.post .sources-box .sources-label {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}
article.post .sources-box p { margin: 0 0 8px; }
article.post .sources-box p:last-child { margin-bottom: 0; }
article.post .sources-box a {
  color: var(--accent);
  text-decoration: underline;
  font-size: 0.92rem;
}
article.post .sources-box a:hover { color: var(--accent-hover); }

/* ── 하단 안내(면책) 박스 ── */
article.post .disclaimer-box {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin: 28px 0 8px;
}
article.post .disclaimer-box p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--text-muted);
  font-style: normal;
}

/* ── 목차(TOC) ── */
article.post nav.toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0 40px;
}
article.post nav.toc > p.toc-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
article.post nav.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
article.post nav.toc li::marker { content: none; }
article.post nav.toc a {
  color: var(--text-primary);
  font-size: 0.94rem;
}
article.post nav.toc a::before {
  content: '→';
  color: var(--accent);
  margin-right: 8px;
}
article.post nav.toc a:hover { color: var(--accent); text-decoration: none; }

/* ── 포인트 강조 콜아웃 박스 ── */
article.post .callout {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-primary));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 24px 0;
}
article.post .callout p { margin: 0; }
article.post .callout p + p { margin-top: 8px; }
article.post .callout-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ── 인용구 ── */
article.post blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--border);
  color: var(--text-muted);
  font-style: italic;
}
article.post blockquote p { margin: 8px 0; }
article.post blockquote cite {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ── 같이보면 좋은글 (관련 글 카드) ── */
article.post .related-posts {
  margin: 24px 0;
  border-top: none !important;
  padding-top: 0 !important;
}
.related-posts-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.related-posts-grid li {
  margin: 0;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-soft);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.related-posts-grid li:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.related-posts-grid a {
  display: block;
  padding: 18px 18px;
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.5;
}
.related-posts-grid a:hover { color: var(--accent); text-decoration: none; }

.breadcrumb {
  max-width: 720px;
  margin: 20px auto 0;
  padding: 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── 푸터 ── */
.site-footer {
  position: relative;
  margin-top: 64px;
  padding: 0 20px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0) 0 0/22px 22px,
    var(--footer-bg);
  color: var(--footer-text-muted);
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--footer-accent), transparent);
  opacity: 0.55;
}
.footer-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  width: 560px;
  height: 280px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--footer-accent) 22%, transparent), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
.footer-inner {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--footer-border);
}
.footer-brand .footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--footer-text);
}
.footer-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--footer-accent) 16%, transparent);
  font-size: 0.95rem;
}
.footer-brand .footer-logo:hover { text-decoration: none; opacity: 0.85; }
.footer-brand .footer-logo-text {
  background: linear-gradient(90deg, var(--footer-text), var(--footer-accent) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.footer-brand p {
  margin: 16px 0 0;
  max-width: 300px;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--footer-text-muted);
}
.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--footer-text);
}
.footer-contact:hover { color: var(--footer-accent); text-decoration: none; }
.footer-contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--footer-border);
  font-size: 0.72rem;
}
.footer-col h4 {
  position: relative;
  margin: 0 0 20px;
  padding-top: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--footer-text);
}
.footer-col h4::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--footer-accent);
}
.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-col a {
  position: relative;
  display: inline-block;
  font-size: 0.88rem;
  color: var(--footer-text-muted);
  transition: color 0.15s ease;
}
.footer-col a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: -2px;
  height: 1px;
  background: var(--footer-accent);
  transition: right 0.2s ease;
}
.footer-col a:hover { color: var(--footer-text); text-decoration: none; }
.footer-col a:hover::after { right: 0; }
.footer-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
}
.footer-legal p {
  margin: 0 auto;
  max-width: 640px;
  font-size: 0.76rem;
  line-height: 1.7;
  color: var(--footer-text-muted);
  opacity: 0.85;
}
.footer-legal p + p { margin-top: 8px; }
.footer-legal .footer-copyright { opacity: 1; color: var(--footer-text-muted); }
.footer-top-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--footer-text);
  padding: 8px 14px;
  border: 1px solid var(--footer-border);
  border-radius: 999px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.footer-top-link:hover {
  text-decoration: none;
  border-color: var(--footer-accent);
  background: color-mix(in srgb, var(--footer-accent) 12%, transparent);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--footer-accent) 25%, transparent);
  transform: translateY(-1px);
}
.footer-top-arrow { transition: transform 0.2s ease; }
.footer-top-link:hover .footer-top-arrow { transform: translateY(-2px); }

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
  }
  .footer-brand p { margin-left: auto; margin-right: auto; }
  .footer-brand .footer-logo { justify-content: center; }
  .footer-col h4::before { left: 50%; transform: translateX(-50%); }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ── "이런 고민, 익숙하시죠" 문제 카드 섹션 (drain24.kr 편집형 UI 이식) ── */
.he-section {
  max-width: 1080px;
  margin: 36px auto;
  padding: 0 20px;
  box-sizing: border-box;
}
.he-section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 24px;
}
.he-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.he-section__title {
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 12px;
  font-weight: 700;
  text-wrap: balance;
}
.he-section__desc {
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

.he-problems__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.he-problem-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.he-problem-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  text-decoration: none;
}
.he-problem-card__visual {
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-secondary);
}
.he-problem-card__body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.he-problem-card__title {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  font-weight: 700;
}
.he-problem-card__desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}
.he-problem-card__more {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 4px;
}
@media (max-width: 900px) {
  .he-problems__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .he-problems__grid { grid-template-columns: 1fr; }
}
