/* Rhythm Helper 블로그 — scripts/build-blog.mjs 가 생성하는 정적 페이지 공용 스타일 */
:root {
  color-scheme: light;
  --ink: #1e1b4b;
  --sub: #4c4a78;
  --muted: #6b6a92;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-soft: #eef2ff;
  --amber: #f59e0b;
  --line: #e0e4f5;
  --bg: #eef0f6;
  --card: #ffffff;
  --radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "PingFang SC", "Microsoft YaHei", "Noto Sans KR", "Noto Sans JP", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
html:lang(ja) body, html:lang(zh) body { word-break: normal; line-break: strict; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(238, 240, 246, 0.88);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 800; white-space: nowrap; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand em { font-style: normal; color: var(--accent); font-weight: 700; margin-left: 2px; }
.site-nav { display: flex; align-items: center; gap: 4px; font-size: 13.5px; }
.lang { padding: 5px 8px; border-radius: 999px; color: var(--sub); text-decoration: none; white-space: nowrap; }
.lang:hover { background: #fff; }
.lang--on { color: var(--ink); font-weight: 700; background: #fff; }
.nav-app {
  margin-left: 6px; padding: 6px 12px; border-radius: 999px; background: var(--accent);
  color: #fff; text-decoration: none; font-weight: 700; white-space: nowrap;
}
.lang-short { display: none; }
@media (max-width: 560px) {
  .brand span { font-size: 15px; }
  .site-nav { gap: 2px; }
  .lang { padding: 4px 6px; font-size: 12.5px; font-weight: 600; }
  .lang-full { display: none; }
  .lang-short { display: inline; }
  .nav-app { display: none; }
}

/* index */
.blog-hero { padding: 40px 0 18px; }
.blog-hero h1 { font-size: clamp(26px, 4.4vw, 38px); line-height: 1.3; letter-spacing: -0.02em; }
.blog-hero p { margin-top: 10px; color: var(--sub); max-width: 680px; font-size: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 22px; }
.filter {
  padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  color: var(--sub); text-decoration: none; font-size: 14px; font-weight: 600;
}
.filter--on { background: var(--ink); border-color: var(--ink); color: #fff; }

.cards { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card[hidden] { display: none; }
.card a {
  display: flex; flex-direction: column; height: 100%; background: var(--card); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; border: 1px solid var(--line);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card a:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(30, 27, 75, 0.1); }
.card-thumb { aspect-ratio: 1200 / 630; background: #e4e7f4; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 18px; line-height: 1.45; letter-spacing: -0.01em; }
.card-desc {
  color: var(--sub); font-size: 14.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { margin-top: auto; color: var(--muted); font-size: 13px; }
.chip {
  align-self: flex-start; display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 700;
}

/* post */
.post { max-width: 760px; }
.breadcrumb { padding: 22px 0 6px; font-size: 13.5px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.post-head { padding: 12px 0 20px; display: flex; flex-direction: column; gap: 12px; }
.post-head h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.35; letter-spacing: -0.02em; }
.post-lead { color: var(--sub); font-size: 17px; }
.post-meta { color: var(--muted); font-size: 13.5px; }
.hero { border-radius: var(--radius); overflow: hidden; background: #e4e7f4; aspect-ratio: 1200 / 630; }
.hero img { width: 100%; height: 100%; object-fit: cover; }

.summary {
  margin: 26px 0 0; padding: 18px 20px; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); border-left: 4px solid var(--amber);
}
.summary-title, .toc-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.summary ul { padding-left: 20px; color: var(--sub); font-size: 15.5px; }
.summary li + li { margin-top: 4px; }
.toc { margin: 16px 0 0; padding: 16px 20px; background: var(--accent-soft); border-radius: var(--radius); }
.toc ol { padding-left: 22px; font-size: 15px; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.prose { padding: 8px 0 10px; font-size: 17px; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 {
  font-size: clamp(21px, 3.6vw, 26px); line-height: 1.4; letter-spacing: -0.015em;
  margin-top: 2.1em; padding-top: 0.2em; scroll-margin-top: 72px;
}
.prose h3 { font-size: 19px; line-height: 1.45; margin-top: 1.6em; scroll-margin-top: 72px; }
.prose p, .prose li { color: #2c2a5a; }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose a { text-underline-offset: 3px; }
.prose blockquote {
  border-left: 4px solid var(--accent-2); padding: 6px 0 6px 16px; color: var(--sub); font-style: italic;
}
.prose figure { margin: 1.6em 0; }
.prose figure img { width: 100%; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.prose figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); text-align: center; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.prose th, .prose td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: #f5f6fc; font-weight: 700; color: var(--ink); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.callout { padding: 14px 18px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #064e3b; }
.callout--warn { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.callout p, .callout li { color: inherit; }
.callout > * + * { margin-top: 0.5em; }
.steps { list-style: none; counter-reset: step; padding-left: 0 !important; }
.steps > li {
  counter-increment: step; position: relative; padding: 12px 14px 12px 54px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
}
.steps > li + li { margin-top: 10px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px;
  border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.steps > li > strong:first-child { display: block; }

.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px;
}
.faq details + details { margin-top: 10px; }
.faq summary {
  cursor: pointer; padding: 14px 24px 14px 0; font-weight: 700; color: var(--ink); list-style: none; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; font-size: 20px; color: var(--accent); }
.faq details[open] summary::after { content: "–"; }
.faq details > :not(summary) { padding-bottom: 14px; color: var(--sub); }

/* CTA */
.cta {
  display: flex; gap: 18px; align-items: flex-start; margin: 36px 0 10px; padding: 24px;
  border-radius: 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #818cf8 0%, #4f46e5 45%, #312e81 100%);
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.28);
}
.cta-icon img { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.cta-text { display: flex; flex-direction: column; gap: 6px; }
.cta-kicker { font-size: 12.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #c7d2fe; }
.cta-title { font-size: 21px; font-weight: 800; line-height: 1.4; }
.cta-desc { color: #e0e7ff; font-size: 15.5px; }
.cta-btn {
  align-self: flex-start; margin-top: 8px; padding: 12px 20px; border-radius: 999px; background: #fff;
  color: var(--accent); font-weight: 800; text-decoration: none; font-size: 16px;
}
.cta-btn:hover { background: #fef3c7; }
.cta-note { font-size: 13px; color: #c7d2fe; }
.cta--index { margin: 36px 0 0; }
@media (max-width: 560px) {
  .cta { flex-direction: column; padding: 20px; }
  .cta-btn { align-self: stretch; text-align: center; }
}

.related { margin: 40px 0 0; }
.related-title { font-size: 21px; margin-bottom: 14px; }
.cards--related { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cards--related .card-desc { display: none; }
.cards--related .card-title { font-size: 16px; }

.site-footer { margin-top: 56px; padding: 28px 0 48px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.site-footer strong { color: var(--ink); }
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--sub); }
