/* ─────────────────────────────────────────────────────
   EZYPATTERN — 사용 설명서 (웹 페이지 + PDF 인쇄)
   site.css 다음에 읽는다. 색은 site.css 토큰을 그대로 쓴다.
   ───────────────────────────────────────────────────── */

.g-crumb { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.g-crumb a:hover { color: var(--ink); text-decoration: underline; }
.g-crumb .sep { opacity: .6; }

/* ── 머리 ───────────────────────────────────────────── */
.g-hero { padding: 44px 0 30px; border-bottom: 1px solid var(--line); }
.g-hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: end; }
.g-kicker { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--accent-ink); }
:lang(en) .g-kicker { letter-spacing: .08em; }
.g-hero h1 { margin: 8px 0 12px; font-size: 40px; line-height: 1.15; letter-spacing: -.035em; font-weight: 800; }
.g-lead { margin: 0; font-size: 16.5px; line-height: 1.7; color: var(--ink-2); max-width: 680px; }
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.g-actions .btn { height: 44px; padding: 0 18px; border-radius: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.g-actions .btn small { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ink-3); }
.g-actions .btn.primary small { color: rgba(255, 255, 255, .8); }
.g-need { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.g-need h2 { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--ink-2); }
.g-need ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.g-need li { position: relative; padding-left: 22px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.g-need li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 12px; border-radius: 4px; border: 2px solid var(--ok); }
.g-need li::after { content: ""; position: absolute; left: 6px; top: 7px; width: 3px; height: 6px; border: solid var(--ok); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* ── 본문 (왼쪽 목차 + 오른쪽 내용) ─────────────────── */
.g-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 34px; padding-bottom: 80px; }
.g-toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; scrollbar-width: thin; }
.g-toc b { display: block; font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: .06em; margin: 0 0 8px 10px; }
.g-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.g-toc a { display: flex; gap: 10px; align-items: baseline; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.g-toc a span { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); flex: none; }
.g-toc a:hover { background: var(--surface); color: var(--ink); }
.g-toc a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 700; }
.g-toc a.on span { color: var(--accent-ink); }

.g-art { min-width: 0; max-width: 920px; }
.g-sec { padding: 6px 0 44px; scroll-margin-top: 84px; }
.g-sec + .g-sec { border-top: 1px dashed var(--line-2); padding-top: 38px; }
.g-sec h2 { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; font-size: 26px; letter-spacing: -.03em; line-height: 1.3; font-weight: 800; }
.g-no { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--accent-ink); flex: none; }
.g-intro { margin: 0 0 18px; font-size: 15.5px; line-height: 1.75; color: var(--ink-2); max-width: 760px; }

.g-fig { margin: 0 0 18px; }
.g-fig a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.g-fig img { display: block; width: 100%; height: auto; }
.g-fig a:hover { border-color: var(--line-2); }
.g-fig figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-3); line-height: 1.5; }

.g-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: st; max-width: 780px; }
.g-steps li { counter-increment: st; position: relative; padding: 2px 0 2px 44px; font-size: 15.5px; line-height: 1.7; }
.g-steps li::before {
  content: counter(st); position: absolute; left: 0; top: 1px; width: 30px; height: 30px; border-radius: 50%;
  background: #E2552B; color: #fff; font-weight: 800; font-size: 15px; line-height: 30px; text-align: center;
  box-shadow: 0 0 0 3px var(--bg), 0 3px 8px rgba(226, 85, 43, .35);
}

.ui { display: inline-block; padding: 0 7px; margin: 0 1px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); font-weight: 700; font-size: .92em; line-height: 1.55; white-space: nowrap; box-shadow: 0 1px 0 var(--line); }
kbd { display: inline-block; min-width: 22px; padding: 0 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font-family: var(--mono); font-size: .85em; line-height: 1.6; text-align: center; }

.g-note { margin: 16px 0 0; padding: 12px 16px 12px 44px; border-radius: 12px; position: relative; font-size: 14.5px; line-height: 1.65; max-width: 780px; }
.g-note::before { position: absolute; left: 14px; top: 11px; width: 20px; height: 20px; border-radius: 50%; font-weight: 800; font-size: 13px; line-height: 20px; text-align: center; }
.g-note.tip { background: color-mix(in srgb, var(--ok) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 28%, var(--line)); }
.g-note.tip::before { content: "i"; background: var(--ok); color: #fff; font-family: Georgia, serif; font-style: italic; }
.g-note.warn { background: var(--soon-bg); border: 1px solid var(--soon-line); color: var(--soon-ink); }
.g-note.warn::before { content: "!"; background: #D39A12; color: #fff; }
.g-note b.lbl { margin-right: 6px; }

.g-keys { width: 100%; max-width: 780px; border-collapse: collapse; font-size: 14.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.g-keys td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.g-keys tr:first-child td { border-top: 0; }
.g-keys td:first-child { width: 200px; white-space: nowrap; }

.g-faq { max-width: 780px; display: grid; gap: 10px; }
.g-faq div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.g-faq dt { font-weight: 800; font-size: 15px; line-height: 1.5; }
.g-faq dt::before { content: "Q. "; color: var(--accent-ink); font-family: var(--mono); }
.g-faq dd { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.7; }

.g-next { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.g-next p { margin: 0 auto 0 0; font-weight: 700; }

/* ── 설명서 모음 (/guide/) ──────────────────────────── */
.g-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 34px 0 80px; }
.g-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.g-card > a.shot { display: block; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.g-card > a.shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.g-card .in { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.g-card h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.g-card p { margin: 0; color: var(--ink-2); line-height: 1.65; font-size: 14.5px; }
.g-card ol { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; line-height: 1.8; columns: 2; column-gap: 24px; }
.g-card .g-actions { margin-top: auto; padding-top: 8px; }

/* 인쇄 전용 표지 (웹에서는 숨김) */
.g-cover { display: none; }

@media (max-width: 1000px) {
  .g-hero .wrap { grid-template-columns: 1fr; gap: 22px; }
  .g-body { grid-template-columns: 1fr; gap: 0; }
  .g-toc { position: static; max-height: none; margin-bottom: 22px; }
  .g-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .g-hero h1 { font-size: 30px; }
  .g-toc ol { grid-template-columns: 1fr; }
  .g-sec h2 { font-size: 22px; }
  .g-card ol { columns: 1; }
  .g-keys td:first-child { width: auto; }
}

/* ── PDF 인쇄 ───────────────────────────────────────── */
@page { size: A4; margin: 14mm 14mm 16mm; }
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #FAF8F3; --shadow: none; }
  html, body { background: #fff !important; font-size: 12.5px; }
  .topbar, .foot, .g-toc, .g-actions, .g-crumb, .g-next, .no-print { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .g-cover { display: block; margin: 0 0 8mm; padding: 0 0 6mm; border-bottom: 2px solid #E2552B; }
  .g-cover .brand { display: flex; align-items: center; gap: 10px; }
  .g-cover .brand img { width: 30px; height: 30px; }
  .g-cover .brand b { font-size: 15px; }
  .g-cover .url { margin-left: auto; font-family: var(--mono); font-size: 11px; color: #6E737D; }
  .g-hero { padding: 0 0 6mm; border: 0; }
  .g-hero .wrap { grid-template-columns: minmax(0, 1fr) 70mm; gap: 8mm; align-items: start; }
  .g-hero h1 { font-size: 26px; margin-top: 4px; }
  .g-lead { font-size: 13px; }
  .g-need { box-shadow: none; padding: 12px 14px; }
  .g-need li { font-size: 12px; }
  .g-body { display: block; padding: 0; }
  .g-art { max-width: none; }
  .g-sec { padding: 0 0 7mm; break-inside: auto; }
  .g-sec + .g-sec { border-top: 1px dashed #D3CDBF; padding-top: 6mm; }
  .g-sec.pb { break-before: page; border-top: 0; padding-top: 0; }
  .g-sec h2 { font-size: 18px; break-after: avoid; }
  .g-intro { font-size: 12.5px; margin-bottom: 4mm; break-after: avoid; }
  .g-fig { break-inside: avoid; margin-bottom: 4mm; }
  .g-fig a { box-shadow: none; border-radius: 8px; }
  .g-fig img { max-height: 118mm; width: auto; max-width: 100%; margin: 0 auto; }
  .g-fig figcaption { font-size: 11px; }
  .g-steps { gap: 5px; max-width: none; }
  .g-steps li { font-size: 12.5px; padding-left: 34px; break-inside: avoid; }
  .g-steps li::before { width: 24px; height: 24px; line-height: 24px; font-size: 12.5px; box-shadow: none; }
  .g-note { font-size: 12px; break-inside: avoid; max-width: none; }
  .g-keys, .g-faq { max-width: none; }
  .g-keys { font-size: 12px; }
  .g-faq div { break-inside: avoid; padding: 10px 14px; }
  .g-faq dt { font-size: 12.5px; }
  .g-faq dd { font-size: 12px; }
  a[href]::after { content: none !important; }
}

/* 저작권 · 이용 안내 */
.g-legal { margin: 0; padding-left: 20px; display: grid; gap: 9px; max-width: 780px; font-size: 15.5px; line-height: 1.75; color: var(--ink-2); }
.g-legal b { color: var(--ink); }
.g-legal li::marker { color: var(--accent); }
