/* 가이드(콘텐츠) 페이지 전용 스타일.
   토큰은 /design.css(:root 캐논)를 그대로 쓴다 — 이 파일은 design.css 뒤에 로드된다.
   대상: /guide/index.html + /guide/<slug>.html (SEO 콘텐츠 페이지, 앱 화면 아님) */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink-900);
  line-height: 1.78;
  -webkit-font-smoothing: antialiased;
  /* 한국어는 어절 단위로만 줄바꿈(모바일 「스/캔하면」 낱말 쪼개짐 — quick-261003-tec).
     overflow-wrap 은 공백 없는 긴 URL·이메일의 가로 넘침 방지.
     앱 화면 보호를 위해 design.css 가 아니라 여기(공개 페이지 전용)에 둔다. */
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: var(--e700); }

/* ── 헤더 ── */
.gh {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 24px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.gh-logo { font-weight: 800; font-size: 1.05rem; color: var(--ink-900); text-decoration: none; letter-spacing: -.02em; }
.gh-nav { display: flex; align-items: center; gap: 18px; }
.gh-nav a { font-size: .9rem; font-weight: 600; text-decoration: none; color: var(--ink-700); }
.gh-nav a:hover { color: var(--e700); }
.gh-cta {
  padding: 8px 16px; border-radius: var(--r-pill);
  background: var(--e600); color: #fff !important; box-shadow: var(--sh-sm);
}
.gh-cta:hover { background: var(--e700); }

/* ── 본문 레이아웃 ── */
.wrap { max-width: 760px; margin: 0 auto; padding: 36px 24px 72px; }

.crumb { font-size: .82rem; color: var(--ink-500); margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumb a { color: var(--ink-500); text-decoration: none; }
.crumb a:hover { color: var(--e700); text-decoration: underline; }
.crumb em { font-style: normal; color: var(--ink-700); }

h1 {
  font-size: clamp(1.55rem, 4.4vw, 2.1rem); font-weight: 800;
  line-height: 1.32; letter-spacing: -.025em; margin-bottom: 12px;
}
.pmeta { font-size: .84rem; color: var(--ink-500); margin-bottom: 32px; }
.lede { font-size: 1.02rem; color: var(--ink-700); margin-bottom: 32px; }

article h2 {
  font-size: 1.24rem; font-weight: 750; letter-spacing: -.02em;
  margin: 44px 0 14px; padding-top: 24px; border-top: 1px solid var(--line);
}
article h3 { font-size: 1.04rem; font-weight: 700; margin: 30px 0 10px; color: var(--ink-900); }
article p { margin: 0 0 16px; color: var(--ink-700); }
article ul, article ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink-700); }
article li { margin-bottom: 7px; }
article strong { color: var(--ink-900); font-weight: 700; }

figure { margin: 24px 0; }
figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-sm);
  background: var(--surface);
}

/* 표 — 좁은 화면에서 가로 스크롤 */
.tw { overflow-x: auto; margin: 18px 0 24px; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
th, td { border: 1px solid var(--line); padding: 10px 13px; text-align: left; vertical-align: top; }
th { background: var(--e50); color: var(--e800); font-weight: 700; white-space: nowrap; }
td { color: var(--ink-700); }
tbody tr:nth-child(even) td { background: var(--surface-2); }

/* ── CTA ── */
.cta {
  margin: 48px 0 0; padding: 28px 24px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.cta h2 { font-size: 1.12rem; font-weight: 750; margin-bottom: 8px; border: 0; padding: 0; }
.cta p { font-size: .92rem; color: var(--ink-700); margin-bottom: 16px; }
.cta-btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: var(--r-pill);
  font-size: .92rem; font-weight: 700; text-decoration: none;
  background: var(--e600); color: #fff; box-shadow: var(--sh-sm);
}
.btn:hover { background: var(--e700); }
.btn.ghost { background: var(--surface); color: var(--e700); border: 1px solid var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: var(--e50); }

/* ── 관련 글 ── */
.related { margin-top: 48px; }
.related h2 { font-size: 1.05rem; font-weight: 750; margin-bottom: 14px; }
.related ul { list-style: none; display: grid; gap: 10px; }
.related a {
  display: block; padding: 15px 17px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); transition: border-color .15s, transform .15s;
}
.related a:hover { border-color: var(--e300); transform: translateY(-1px); }
.related strong { display: block; font-size: .95rem; color: var(--ink-900); margin-bottom: 4px; }
.related span { font-size: .84rem; color: var(--ink-500); line-height: 1.6; }

/* ── 허브 카드 ── */
.cards { list-style: none; display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.cards a {
  display: block; height: 100%; padding: 20px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cards a:hover { border-color: var(--e300); transform: translateY(-2px); box-shadow: var(--sh); }
.cards h3 { font-size: 1rem; font-weight: 750; color: var(--ink-900); margin-bottom: 8px; line-height: 1.45; }
.cards p { font-size: .87rem; color: var(--ink-500); margin-bottom: 12px; }
.cards time { font-size: .78rem; color: var(--ink-400); }

/* ── 푸터 ── */
.gf { border-top: 1px solid var(--line); background: var(--surface); }
.gf-in { max-width: 760px; margin: 0 auto; padding: 28px 24px 40px; font-size: .85rem; color: var(--ink-500); }
.gf-links { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 14px; }
.gf-links a { color: var(--ink-500); text-decoration: none; }
.gf-links a:hover { color: var(--e700); text-decoration: underline; }

/* ── 그림 설명 · 폰 캡처 묶음 (quick-261005-fav · app-entry-number 글에서 처음 씀) ── */
figcaption { margin-top: 8px; font-size: .82rem; color: var(--ink-500); text-align: center; line-height: 1.5; }
/* 폰 캡처는 이미 흰 배경·베젤이 합성돼 있어 테두리·그림자를 다시 두르지 않는다.
   좁은 화면에서도 2열을 유지한다(폰 캡처는 세로로 길어 1열이면 스크롤이 너무 길어진다). */
.phones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; align-items: start; }
.phones figure { margin: 0; }
.phones figure img {
  max-width: 300px; margin: 0 auto;
  border: 0; border-radius: 0; box-shadow: none; background: transparent;
}

/* ── 인쇄 / PDF로 저장 버튼(화면 전용 — 인쇄에서는 숨긴다) ── */
.print-row { margin: -16px 0 28px; }
.print-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r-pill);
  font: inherit; font-size: .86rem; font-weight: 700; cursor: pointer;
  background: var(--surface); color: var(--e700); border: 1px solid var(--line-2);
}
.print-btn:hover { background: var(--e50); }

/* ── 인쇄(= PDF 원본) — 브라우저 인쇄와 e2e/make_guide_pdf.mjs 가 같은 규칙을 탄다 ── */
@page { size: A4; margin: 16mm 14mm 18mm; }
@media print {
  .gh, .crumb, .cta, .related, .gf, .print-btn, .print-row { display: none !important; }
  body { background: #fff; color: #13201b; font-size: 10.5pt; line-height: 1.65; }
  .wrap { max-width: none; margin: 0; padding: 0; }
  h1 { font-size: 18pt; }
  .pmeta { margin-bottom: 14pt; }
  article h2 { margin: 20pt 0 8pt; padding-top: 10pt; break-after: avoid; page-break-after: avoid; }
  article h3 { break-after: avoid; page-break-after: avoid; }
  figure, .phones, li { break-inside: avoid; page-break-inside: avoid; }
  figure img { box-shadow: none; }
  figure.wide img { width: 100%; }
  .phones { grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 12pt 0; }
  .phones figure img { max-width: 100%; }
  a { color: inherit; text-decoration: none; }
}

/* ── howto (248) — 사용법 글·허브 «따라 하기 사용법» 묶음 (Phase 248 · UI-SPEC 화면 1·2) ──
   표지 <meta name="omrlab:howto"> 가 붙은 글과 허브(index.html)만 이 규칙을 쓴다(guide.css?v=4).
   새 간격은 4/8/16/24/32/48px 만. 색은 UI-SPEC «Accent reserved for» 목록 안에서만. */
.print-row { display: flex; flex-wrap: wrap; gap: 8px; }
a.print-btn { text-decoration: none; }

/* «먼저 알아 둘 것» 상자 */
section.know {
  margin: 24px 0 0; padding: 16px 24px;
  background: var(--e50); border: 1px solid var(--e200); border-left: 4px solid var(--e600);
  border-radius: 12px;
}
article section.know h2 { margin: 0 0 8px; padding-top: 0; border-top: 0; }
section.know ul { margin-bottom: 0; }

/* 목차(큰 사용법만) */
nav.toc {
  margin: 24px 0 0; padding: 16px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  font-size: .875rem; font-weight: 400; line-height: 1.5;
}
nav.toc strong { display: block; font-weight: 700; color: var(--ink-900); margin-bottom: 8px; }
nav.toc ol { margin: 0; padding-left: 24px; }
nav.toc li { margin-bottom: 4px; }
nav.toc a { color: var(--e700); }
h2[id] { scroll-margin-top: 72px; }

/* 인쇄 꼬리(화면에서는 숨김) */
.print-foot { display: none; }

/* 관련 사용법(관련 글 카드 모양 상속) */
section.howto-related { margin-top: 48px; }

/* 허브 «따라 하기 사용법» 묶음 */
.hub-h2 { font-size: 1.24rem; font-weight: 700; line-height: 1.4; margin: 32px 0 8px; }
.hub-h2:first-of-type { margin-top: 0; }
.hub-sub { font-size: .875rem; font-weight: 700; color: var(--ink-500); margin: 24px 0 8px; }
.hub-lede { font-size: 1rem; color: var(--ink-700); margin: 0 0 8px; }
.howto-cards li { display: flex; flex-direction: column; }
.howto-cards li > a:first-child { flex: 1; }
.howto-big a:first-child { background: var(--e50); border-color: var(--e200); }
.card-pdf {
  align-self: flex-start; margin-top: 4px; padding: 8px 4px;
  font-size: .875rem; font-weight: 700; color: var(--e700); text-decoration: none;
}
.card-pdf:hover { text-decoration: underline; }
.howto-cards + .hub-h2, .howto-cards + h2 { margin-top: 48px; }

@media print {
  .print-foot {
    display: block; margin-top: 8pt; padding-top: 4pt;
    border-top: 1pt solid #d4dbd7; font-size: 9pt; color: #6a756e;
    break-before: avoid; page-break-before: avoid;   /* 꼬리 한 줄만 다음 쪽에 외톨이로 남지 않게 */
  }
  section.know {
    background: none; border: 1pt solid #9aa39d; border-left: 3pt solid #13201b;
    break-inside: avoid; page-break-inside: avoid;
  }
  nav.toc { background: none; border: 1pt solid #d4dbd7; break-inside: avoid; page-break-inside: avoid; }
  h2.chapter { break-before: page; page-break-before: always; }
  .howto-related, a.print-btn { display: none !important; }
  li { break-inside: avoid; page-break-inside: avoid; }
}
