/* 이용약관(terms.html)·개인정보처리방침(privacy.html) 화면.
   style.css 의 색·글꼴·바닥글을 그대로 쓰고, 여기에는 읽는 문서 모양만 둔다.
   왼쪽 목차 + 오른쪽 본문(줄 길이 약 40자), 좁은 화면은 목차가 본문 위로 접힌다 */

.lg-top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.lg-top-in { max-width: calc(var(--wrap) + 32px); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); height: var(--gnb-h); display: flex; align-items: center; gap: 16px; }
.lg-top .logo { color: var(--fg); text-decoration: none; }
.lg-back { margin-left: auto; text-decoration: none; }

.lg { max-width: calc(var(--wrap) + 32px); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 40px 8px; }
/* 넓은 화면: 왼쪽 목차가 제목부터 본문 끝까지 따라오고, 오른쪽에 제목 → 한눈에 보기 → 본문 */
.lg-grid { display: grid; grid-template-columns: 220px minmax(0, 760px); grid-template-areas: 'toc hero' 'toc glance' 'toc body'; column-gap: 48px; align-items: start; }
.lg-hero { grid-area: hero; }
.lg-hero h1 { margin: 0; font: 700 clamp(26px, 3.2vw, 34px)/1.25 var(--body); letter-spacing: -0.01em; }
.lg-meta { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.lg-lead { margin: 18px 0 0; font-size: 16px; line-height: 1.75; }

/* 이용약관 ↔ 개인정보처리방침 */
.lg-switch { display: inline-flex; gap: 4px; margin-top: 24px; padding: 4px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.lg-switch a { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.lg-switch a:hover { color: var(--fg); background: var(--surface-2); }
.lg-switch a[aria-current='page'] { color: var(--on-fg); background: var(--fg); }

.lg-toc { grid-area: toc; align-self: start; position: sticky; top: calc(var(--gnb-h) + 20px); max-height: calc(100vh - var(--gnb-h) - 40px); overflow: auto; font-size: 13px; }
.lg-toc p { margin: 0 0 8px; font: 700 12px/1.2 var(--pixel); letter-spacing: 0.12em; color: var(--accent-ink); }
.lg-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.lg-toc a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.45; }
.lg-toc a:hover { color: var(--fg); border-left-color: var(--line-2); }
.lg-toc a.on { color: var(--fg); font-weight: 600; border-left-color: var(--accent); }

.lg-body { grid-area: body; min-width: 0; margin-top: 36px; font-size: 15px; line-height: 1.8; }
.lg-body section { padding-top: 8px; scroll-margin-top: calc(var(--gnb-h) + 16px); }
.lg-body section + section { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.lg-body h2 { margin: 0 0 10px; font: 700 19px/1.4 var(--body); letter-spacing: -0.005em; }
.lg-body h3 { margin: 18px 0 6px; font: 700 15px/1.5 var(--body); }
.lg-body p { margin: 0 0 10px; }
.lg-body ol, .lg-body ul { margin: 0 0 10px; padding-left: 1.4em; }
.lg-body li + li { margin-top: 4px; }
.lg-body ol ol, .lg-body ul ul, .lg-body ol ul { margin: 4px 0 0; }
.lg-body a { color: var(--accent-ink); text-underline-offset: 3px; }
.lg-body b { font-weight: 700; }
.lg-body .lg-small { font-size: 13px; color: var(--muted); }

/* 표: 좁은 화면에서는 표만 옆으로 밀린다 (화면 전체는 밀리지 않게) */
.lg-table { margin: 8px 0 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.lg-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.lg-table th, .lg-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.lg-table tbody tr:last-child > * { border-bottom: 0; }
.lg-table thead th { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.lg-table tbody th { font-weight: 700; white-space: nowrap; }

/* 한눈에 보기 (개인정보 처리 표시) */
.lg-glance { grid-area: glance; margin-top: 28px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.lg-glance h2 { margin: 0 0 14px; font: 700 13px/1.2 var(--pixel); letter-spacing: 0.12em; color: var(--accent-ink); }
.lg-glance dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.lg-glance dl.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lg-glance div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.lg-glance dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.lg-glance dd { margin: 4px 0 0; font-size: 14px; line-height: 1.55; }

/* 운영자가 채울 칸: 채우면 class="fill" 을 지운다 */
.fill { padding: 0 4px; border: 1px dashed var(--warn); border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-weight: 600; white-space: nowrap; }

.lg-notice { margin: 0 0 10px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; line-height: 1.7; }

@media (max-width: 860px) {
  .lg { padding-top: 28px; }
  .lg-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'hero' 'glance' 'toc' 'body'; }
  .lg-body { margin-top: 24px; }
  .lg-toc { margin-top: 24px; position: static; max-height: none; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
  .lg-toc ol { border-left: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
  .lg-toc a { padding-left: 0; border-left: 0; }
  .lg-toc a.on { color: var(--accent-ink); }
}
@media (max-width: 480px) {
  .lg-switch { display: flex; }
  .lg-switch a { flex: 1; text-align: center; padding-inline: 8px; }
  .lg-back span { display: none; }
  .lg-glance { padding: 16px; }
  .lg-glance dl, .lg-glance dl.two { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .lg-glance div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 10px 12px; }
  .lg-glance dd { margin: 0; }
}
@media print {
  .lg-top, .lg-toc, .lg-switch, .site-foot { display: none; }
  .lg-grid { display: block; }
  .fill { border: 0; background: none; color: inherit; }
}
