/* 습관 피라미드 공통 스타일 (index.html 외 모든 페이지에서 link) */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  background: #fdfdfb;
  color: #1f2937;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* Header */
header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 24px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 32px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}
.logo-icon { font-size: 24px; }
.lang-badge {
  display: inline-block;
  background: #f3f4f6;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

/* Article (정적 페이지 컨텐츠) */
.article h1 {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 8px;
  line-height: 1.3;
}
.article .meta {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 24px;
}
.article h2 {
  font-size: 19px;
  font-weight: 600;
  color: #2563eb;
  margin: 32px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e5e7eb;
}
.article h3 {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 20px 0 8px;
}
.article p { margin: 0 0 14px; color: #374151; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 22px; }
.article li { margin-bottom: 6px; color: #374151; }
.article blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  background: #eff6ff;
  border-left: 3px solid #2563eb;
  border-radius: 6px;
  color: #1e3a8a;
  font-size: 14px;
}
.article .disclaimer-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: #78350f;
  margin: 24px 0;
}
.article .source-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: #6b7280;
  margin: 24px 0;
}
.article .toc {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0 32px;
  font-size: 14px;
}
.article .toc strong {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.article .toc ul { list-style: none; padding-left: 0; margin: 0; }
.article .toc li { margin-bottom: 4px; }
.article .related {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px 18px;
  margin-top: 32px;
  font-size: 14px;
}
.article .related strong {
  display: block;
  margin-bottom: 8px;
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.article .related ul { list-style: none; padding: 0; margin: 0; }
.article .related li { margin-bottom: 4px; }

/* Habit Catalog (인기 습관 카탈로그) */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.catalog-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, transform 0.15s;
}
.catalog-item:hover {
  border-color: #2563eb;
  transform: translateY(-1px);
}
.catalog-icon {
  font-size: 20px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.catalog-name { color: #111827; font-weight: 500; }
.catalog-category {
  font-size: 12px;
  color: #6b7280;
  margin: 24px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 0;
}
.faq-q {
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
  font-size: 16px;
}
.faq-a { color: #374151; font-size: 14px; margin: 0; }

/* How it works (단계별) */
.steps {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
}
.step-num {
  background: #2563eb;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 14px;
}
.step-content { flex: 1; }
.step-title { font-weight: 600; color: #111827; margin-bottom: 4px; }
.step-desc { color: #6b7280; font-size: 14px; }

/* Insight Card (인사이트 사례) */
.insight-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
}
.insight-stat {
  font-size: 24px;
  font-weight: 700;
  color: #2563eb;
  margin: 4px 0;
}
.insight-desc { color: #374151; font-size: 14px; margin: 0; }

/* Stats (공개 통계) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #2563eb;
  margin: 4px 0;
}
.stat-label { color: #6b7280; font-size: 13px; }

/* Ad placeholder (AdSense 승인 후 활성화) */
.ad-placeholder {
  margin: 32px auto;
  max-width: 728px;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 24px 16px;
}

/* Footer */
footer.app-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.8;
}
footer .footer-links { margin-top: 8px; }
footer .footer-links a {
  color: #6b7280;
  text-decoration: none;
  margin: 0 6px;
}
footer .footer-links a:hover { color: #2563eb; }

@media (max-width: 600px) {
  .container { padding: 16px 14px 60px; }
  .article h1 { font-size: 22px; }
  .article h2 { font-size: 17px; }
  header.app-header { padding: 12px 0 16px; margin-bottom: 20px; }
  .step { flex-direction: column; gap: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .catalog-grid { grid-template-columns: 1fr 1fr; }
}

/* === prerender seo-content (메인 PWA의 정적 콘텐츠 영역) === */
#seo-content {
  font-size: 15px;
}
#seo-content h1 { font-size: 26px; margin: 0 0 14px; color: #1a1a1a; line-height: 1.35; }
#seo-content h2 { font-size: 19px; margin: 28px 0 10px; color: #1a1a1a; line-height: 1.4; }
#seo-content p { margin: 0 0 12px; color: #1f2937; }
#seo-content ul { margin: 0 0 16px 22px; color: #1f2937; }
#seo-content ul li { margin-bottom: 6px; }
#seo-content a { color: #2563eb; text-decoration: none; }
#seo-content a:hover { text-decoration: underline; }

/* prerender 영역은 JS 동작 시작 시 숨김 (PWA 본체 사용) */
body.app-ready #seo-content { display: none; }

/* === footer 사이트맵 === */
.app-footer {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 32px 20px;
  border-top: 1px solid #e5e5e0;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
}
.app-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}
.app-footer-grid h3 {
  font-size: 14px;
  margin: 0 0 12px;
  color: #1a1a1a;
}
.app-footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.app-footer-grid li { margin-bottom: 6px; }
.app-footer-grid a {
  color: #4b5563;
  text-decoration: none;
}
.app-footer-grid a:hover { color: #2563eb; }
.app-footer-bottom {
  margin: 24px 0 0;
  font-size: 13px;
  color: #6b7280;
}
.app-footer-disclaimer {
  margin: 8px 0 0;
  font-size: 12px;
  color: #9ca3af;
}

/* === 애드센스 광고 슬롯 === */
.ad-slot {
  margin: 32px auto;
  max-width: 100%;
  text-align: center;
  padding: 12px 0;
  background: #fafaf7;
  border-radius: 12px;
  border: 1px solid #f0f0eb;
}
.ad-label {
  font-size: 11px;
  color: #999;
  margin: 8px 0 0;
  text-align: center;
  letter-spacing: 0.5px;
}
