/* 나노플레이데이즈 스타일시트
   글꼴: 본문·제목 모두 고운돋움(자체 호스팅, 400 한 굵기). 굵기 대신 크기·색·간격으로 위계를 만든다.
   한글 서브셋이므로 로마자·숫자는 뒤따르는 시스템 글꼴이 맡는다. 외부 자산 없음. */

@font-face {
  font-family: "Gowun Dodum";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/gowun-dodum-korean-400.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #f8f6f1;
  --paper-deep: #efece4;
  --surface: #fffefb;
  --ink: #22252a;
  --ink-soft: #3f444b;
  --muted: #747980;
  --line: #e1dcd1;
  --line-strong: #c3bbad;
  --accent: #1f5e4d;
  --accent-ink: #164a3c;
  --accent-soft: #e3eee8;
  --accent-line: #bcd4c8;
  --font: "Gowun Dodum", -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --measure: 680px;
  --shell: 960px;
  --gutter: 40px;
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-family: var(--font);
  font-synthesis: none;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: .18em; transition: color .15s ease; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.32; letter-spacing: -.01em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
b, strong { font-weight: 400; color: var(--ink); }
time { font-variant-numeric: tabular-nums; }

.shell { width: min(var(--shell), calc(100% - var(--gutter))); margin-inline: auto; }
.skip-link {
  position: absolute; z-index: 20; top: -100px; left: 16px;
  padding: 10px 14px; border-radius: 4px;
  background: var(--ink); color: #fff; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* 작은 라벨 (404 등) */
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 14px; letter-spacing: .04em; }

/* ---------- 헤더 ---------- */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-size: 19px; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--accent); }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.site-header nav { display: flex; align-items: center; gap: 26px; }
.site-header nav a {
  position: relative;
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink-soft); font-size: 15px;
  text-decoration: none; white-space: nowrap;
}
.site-header nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 9px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .18s ease;
}
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--ink); }
.site-header nav a:hover::after, .site-header nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- 홈 상단 ---------- */
.hero { padding-block: 72px 56px; }
.hero h1 { max-width: 22ch; font-size: clamp(30px, 4.2vw, 42px); line-height: 1.3; }
.hero-description { max-width: 32em; margin-top: 18px; color: var(--ink-soft); font-size: 17px; }

/* ---------- 글 목록 ---------- */
.latest-section { padding-block: 0 96px; }
.list-label { margin-bottom: 12px; color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.post-list { display: grid; border-top: 1px solid var(--line-strong); }
.post-card {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 6px 28px;
  padding-block: 28px 30px;
  border-bottom: 1px solid var(--line);
}
.post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--muted); font-size: 14px; }
.post-meta > span:first-child { color: var(--accent); }
.post-card-image { grid-column: 1; grid-row: 1 / 3; align-self: start; overflow: hidden; border-radius: 5px; }
.post-card-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.post-card .post-meta { grid-column: 2; padding-top: 0; }
.post-card-body { grid-column: 2; min-width: 0; }
.post-card h2, .post-card h3 { font-size: clamp(21px, 2.1vw, 25px); line-height: 1.38; }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: .2em; }
.post-card-body > p { max-width: 40em; margin-top: 10px; color: var(--ink-soft); font-size: 16px; line-height: 1.75; }
.text-link { display: inline-block; font-size: 15px; text-decoration: none; }
.text-link:hover { text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: .2em; }
.all-posts { margin-top: 24px; }

/* ---------- 전체 글 ---------- */
.archive-page { min-height: 65vh; padding-block: 64px 96px; }
.archive-header { padding-bottom: 28px; }
.archive-page h1 { font-size: clamp(28px, 3.6vw, 36px); }
.archive-intro { margin-top: 10px; color: var(--muted); font-size: 16px; }

/* ---------- 글 본문 ---------- */
.article-shell { width: min(var(--measure), calc(100% - var(--gutter))); margin-inline: auto; padding-block: 40px 104px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; color: var(--muted); font-size: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.article-header { padding-bottom: 30px; border-bottom: 1px solid var(--line-strong); }
.article-header .post-meta { margin-bottom: 16px; }
.article-header h1 { font-size: clamp(28px, 4vw, 38px); }
.article-lead { margin-top: 18px; color: var(--ink-soft); font-size: 18px; line-height: 1.75; }
.article-cover { width: 100%; margin-top: 28px; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 5px; }

.article-body { padding-top: 32px; font-size: 17px; line-height: 1.9; }
.article-body h2 { margin: 52px 0 16px; font-size: clamp(22px, 2.4vw, 26px); line-height: 1.4; }
.article-body h3 { margin: 32px 0 10px; font-size: 20px; }
.article-body p, .article-body li { color: var(--ink-soft); }
.article-body p { margin: 0 0 20px; }
.article-body :is(p, li) :is(b, strong) {
  color: var(--ink);
  padding: .02em .12em;
  border-radius: 2px;
  background: var(--accent-soft);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.article-body ol, .article-body ul { margin: 0 0 24px; padding-left: 1.4em; }
.article-body li { margin-bottom: 12px; padding-left: 4px; }
.article-body li::marker { color: var(--accent); }
.article-body a, .simple-page a { text-decoration: underline; text-decoration-color: var(--accent-line); }
.article-body a:hover, .simple-page a:hover { text-decoration-color: currentColor; }
.article-body img { margin: 8px 0 24px; border: 1px solid var(--line); border-radius: 4px; }
.article-body blockquote { margin: 0 0 24px; padding: 4px 0 4px 20px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.article-body code { padding: 2px 6px; border-radius: 4px; background: var(--paper-deep); font-size: .92em; }
.article-body pre { margin: 0 0 24px; padding: 18px 20px; border-radius: 6px; background: var(--paper-deep); overflow-x: auto; font-size: 14px; line-height: 1.6; }
.article-body pre code { padding: 0; background: none; font-size: inherit; }
.article-body table { width: 100%; margin: 0 0 24px; border-collapse: collapse; font-size: 15px; }
.article-body th, .article-body td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { color: var(--ink); border-bottom-color: var(--line-strong); }
.article-body hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }

/* 핵심 답변 상자 (본문 마크다운에서 사용) */
.answer-box {
  margin: 0 0 24px;
  padding: 22px 26px 24px;
  border: 1px solid var(--accent-line);
  border-left: 4px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  background: var(--surface);
}
.answer-box > strong { display: block; margin-bottom: 8px; color: var(--accent); font-size: 14px; letter-spacing: .04em; }
.answer-box p { margin: 0; color: var(--ink); font-size: 17px; line-height: 1.8; }

/* 글 끝 */
.article-next { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line-strong); }

/* ---------- 소개·안내·404 ---------- */
.simple-page { min-height: 65vh; padding-top: 64px; }
.simple-page h1 { font-size: clamp(28px, 3.8vw, 38px); }
.simple-page .article-lead { margin: 18px 0 8px; padding-bottom: 30px; border-bottom: 1px solid var(--line-strong); }
.simple-page h2 { margin: 44px 0 14px; font-size: 22px; line-height: 1.4; }
.simple-page .article-lead + h2, .simple-page .article-lead + p { margin-top: 32px; }
.simple-page p:not(.eyebrow):not(.article-lead) { margin: 0 0 18px; color: var(--ink-soft); font-size: 17px; line-height: 1.85; }
.button {
  display: inline-flex; align-items: center; min-height: 44px;
  margin-top: 8px; padding: 10px 20px; border-radius: 6px;
  text-decoration: none;
}
.button-primary { background: var(--ink); color: #fff; }
.button-primary:hover { background: var(--accent); color: #fff; }

/* ---------- 푸터 ---------- */
.site-footer { margin-top: 24px; border-top: 1px solid var(--line); background: var(--paper-deep); color: var(--muted); }
.footer-inner { display: flex; align-items: baseline; justify-content: space-between; gap: 20px 32px; padding-block: 32px 36px; font-size: 14px; }
.footer-brand { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.footer-brand strong { color: var(--ink); font-size: 15px; }
.footer-brand small { font-size: 13px; }
.footer-inner nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-inner a { color: var(--ink-soft); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); }

/* ---------- 반응형 ---------- */
@media (max-width: 860px) {
  .post-card { grid-template-columns: 144px minmax(0, 1fr); gap: 6px 22px; }
}

@media (max-width: 680px) {
  :root { --gutter: 32px; }
  body { font-size: 16px; }
  .header-inner { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-block: 12px 4px; }
  .brand { font-size: 17px; }
  .brand img { width: 26px; height: 26px; }
  .site-header nav { width: 100%; gap: 22px; }
  .site-header nav a { min-height: 40px; font-size: 14px; }
  .site-header nav a::after { bottom: 7px; }

  .hero { padding-block: 44px 36px; }
  .hero h1 { font-size: clamp(26px, 7.4vw, 32px); }
  .hero-description { margin-top: 14px; font-size: 16px; }

  .latest-section { padding-block: 0 64px; }
  .post-card { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-block: 22px 24px; }
  .post-card-image { grid-column: 1; grid-row: auto; }
  .post-card .post-meta, .post-card-body { grid-column: 1; }
  .post-card .post-meta { flex-direction: row; align-items: baseline; padding-top: 0; }
  .post-card h2, .post-card h3 { font-size: 20px; }
  .post-card-body > p { margin-top: 8px; font-size: 15px; }
  .all-posts { margin-top: 20px; }

  .archive-page { padding-block: 40px 72px; }
  .archive-header { padding-bottom: 20px; }
  .archive-page h1 { font-size: clamp(26px, 7.2vw, 32px); }
  .archive-intro { font-size: 15px; }

  .article-shell { padding-block: 28px 72px; }
  .breadcrumb { margin-bottom: 28px; }
  .article-header { padding-bottom: 24px; }
  .article-header h1 { font-size: clamp(25px, 6.8vw, 32px); }
  .article-lead { font-size: 16px; }
  .article-body { padding-top: 24px; font-size: 16px; line-height: 1.85; }
  .article-body h2 { margin-top: 42px; font-size: 21px; }
  .article-body h3 { font-size: 18px; }
  .answer-box { padding: 18px 20px 20px; }
  .answer-box p { font-size: 16px; }
  .article-next { margin-top: 52px; }

  .simple-page { padding-top: 40px; }
  .simple-page h1 { font-size: clamp(26px, 7.2vw, 32px); }
  .simple-page h2 { font-size: 20px; }
  .simple-page p:not(.eyebrow):not(.article-lead) { font-size: 16px; }

  .footer-inner { flex-direction: column; gap: 16px; padding-block: 28px 32px; }
}

@media (max-width: 400px) {
  :root { --gutter: 28px; }
  .site-header nav { gap: 16px; }
  .post-meta { gap: 4px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .skip-link, .site-header nav, .site-footer, .article-next, .breadcrumb { display: none; }
  body { background: #fff; color: #000; }
  .article-shell { width: 100%; padding-block: 0; }
  a { color: inherit; text-decoration: none; }
}
