/* 사이트 공통 — 푸터와 법적 페이지.
   각 사이트의 기존 화면(헤더·패널·타이포)을 그대로 따른다.
   키링: Arial/Nanum · 13px · #347650 / 플레이트: DM Sans · 12px · #216959 */

:root {
  --legal-ink: #283936;
  --legal-muted: #82918a;
  --legal-line: #e4e9e3;
  --legal-green: #347650;
  --legal-lime: #eef3e4;
  --legal-paper: #fafbf8;
  --legal-font: Arial, Nanum, system-ui, sans-serif;
  --legal-base: 13px;
  --legal-header-h: 88px;
  --legal-header-pad: 38px;
}

/* ── 언어 전환 ─────────────────────────────────────── */

.i18n-en { display: none; }
html[lang="en"] .i18n-ko { display: none !important; }
html[lang="en"] .i18n-en { display: inline; }
html[lang="en"] .i18n-en.block,
html[lang="en"] section.i18n-en,
html[lang="en"] div.i18n-en { display: block; }

/* ── 헤더 (사이트 헤더와 같은 형태) ────────────────── */

.legal-header {
  height: var(--legal-header-h);
  border-bottom: 1px solid var(--legal-line);
  background: #fff;
  display: flex;
  align-items: center;
  padding: 0 var(--legal-header-pad);
}

.legal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: 1844px;
  margin: 0 auto;
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--legal-ink);
  text-decoration: none;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}

.legal-brand:hover { text-decoration: none; }

.legal-brand-mark {
  background: var(--legal-green);
  color: #f5f9e8;
  width: 43px;
  height: 43px;
  border-radius: 13px;
  text-align: center;
  line-height: 39px;
  font-size: 39px;
  letter-spacing: -5px;
  padding-right: 5px;
  flex-shrink: 0;
}

.legal-brand-sub {
  display: block;
  font-size: 9px;
  letter-spacing: 1.5px;
  margin-top: 4px;
  font-weight: 600;
  color: var(--legal-muted);
}

.legal-lang {
  display: inline-flex;
  border: 1px solid var(--legal-line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}

.legal-lang button {
  border: 0;
  background: transparent;
  color: var(--legal-muted);
  font: inherit;
  font-size: 11px;
  padding: 7px 11px;
  cursor: pointer;
}

.legal-lang button[aria-pressed="true"] {
  background: var(--legal-lime);
  color: var(--legal-green);
  font-weight: 700;
}

.legal-lang button:focus-visible {
  outline: 2px solid #80a85a;
  outline-offset: -2px;
}

/* ── 본문 (사이트의 흰 패널과 같은 형태) ───────────── */

.legal-page {
  margin: 0;
  background: var(--legal-paper);
  color: var(--legal-ink);
  font-family: var(--legal-font);
  font-size: var(--legal-base);
  line-height: 1.8;
}

.legal-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 24px 56px;
}

.legal-eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: #759076;
  margin: 0 0 12px;
}

.legal-sheet {
  background: #fff;
  border: 1px solid var(--legal-line);
  border-radius: 12px;
  padding: 26px 28px 30px;
}

.legal-main h1 {
  font-size: 23px;
  letter-spacing: -1.3px;
  line-height: 1.4;
  margin: 0 0 6px;
}

.legal-main .legal-meta {
  margin: 0 0 22px;
  color: var(--legal-muted);
  font-size: 11px;
  letter-spacing: .1px;
}

.legal-main h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 26px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--legal-line);
  letter-spacing: 0;
}

.legal-main h3 {
  font-size: 12px;
  font-weight: 700;
  margin: 16px 0 6px;
}

.legal-main p,
.legal-main li { margin: 0 0 9px; }

.legal-main ul,
.legal-main ol { margin: 0 0 10px; padding-left: 18px; }
.legal-main li { margin-bottom: 5px; }

.legal-main a { color: var(--legal-green); }
.legal-main code {
  font-size: 11px;
  background: #f2f5ef;
  border: 1px solid var(--legal-line);
  border-radius: 4px;
  padding: 1px 5px;
}

.legal-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 11px;
  line-height: 1.6;
}

.legal-main th,
.legal-main td {
  border: 1px solid var(--legal-line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.legal-main th {
  background: #f6f8f2;
  font-weight: 600;
  color: #5d6f60;
  white-space: nowrap;
}

.legal-summary {
  background: #f6f8f2;
  border: 1px solid var(--legal-line);
  border-radius: 10px;
  padding: 15px 17px;
  margin: 0 0 22px;
  font-size: 12px;
  line-height: 1.75;
}

.legal-summary p { margin: 0; }

.legal-note {
  border-left: 2px solid var(--legal-lime);
  padding: 1px 0 1px 12px;
  color: var(--legal-muted);
  font-size: 11px;
  line-height: 1.7;
}

/* ── 법적 페이지 하단 ──────────────────────────────── */

.legal-footer {
  border-top: 1px solid var(--legal-line);
  padding: 16px var(--legal-header-pad) 22px;
  font-size: 9px;
  color: #a4af9b;
}

.legal-footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: space-between;
  max-width: 1844px;
  margin: 0 auto;
}

.legal-footer a { color: #8b9a8e; text-decoration: none; }
.legal-footer a:hover { color: var(--legal-green); text-decoration: underline; }

/* ── 도구 화면 푸터 (키링: 기존 footer-note와 같은 결) ── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  border-top: 1px solid var(--legal-line);
  background: #fff;
  padding: 14px 38px;
  font-size: 9px;
  color: #a4af9b;
  letter-spacing: .2px;
}

.site-footer a {
  color: #8b9a8e;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--legal-green);
  text-decoration: underline;
}

.site-footer a:focus-visible {
  outline: 2px solid #80a85a;
  outline-offset: 3px;
  border-radius: 2px;
}

.footer-legal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-legal .footer-legal-sep { opacity: .45; }

.footer-legal a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-legal a:hover { border-bottom-color: currentColor; text-decoration: none; }

.footer-legal a:focus-visible {
  outline: 2px solid #4c9f86;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── 사이트별 조정 ─────────────────────────────────── */

html[data-site="plate"] {
  --legal-ink: #24302e;
  --legal-muted: #89918a;
  --legal-line: #e4e8e3;
  --legal-green: #216959;
  --legal-lime: #e8f2ec;
  --legal-paper: #f4f6f3;
  --legal-font: 'DM Sans', 'Noto Sans KR', system-ui, sans-serif;
  --legal-base: 12px;
  --legal-header-h: 78px;
  --legal-header-pad: 42px;
}

html[data-site="plate"] .legal-brand {
  font-size: 25px;
  gap: 9px;
  letter-spacing: -1px;
}

html[data-site="plate"] .legal-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0;
  padding: 0;
  display: grid;
  place-items: center;
  color: #fff;
}

html[data-site="plate"] .legal-brand-sub {
  display: inline;
  font-size: 10px;
  letter-spacing: 2px;
  margin: 0 0 0 5px;
  color: #74817b;
  font-weight: 500;
}

html[data-site="plate"] .legal-main h1 { font-size: 25px; letter-spacing: -1.1px; }
html[data-site="plate"] .legal-main h2 { font-size: 12px; }
html[data-site="plate"] .legal-main p,
html[data-site="plate"] .legal-main li { line-height: 1.85; }

/* 키캡 — keycap-test/studio.css와 같은 값 */
html[data-site="keycap"] {
  --legal-ink: #243b38;
  --legal-muted: #6e8875;
  --legal-line: #dde5d8;
  --legal-green: #327752;
  --legal-lime: #e9f2e5;
  --legal-paper: #f8faf6;
  --legal-font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --legal-base: 13px;
  --legal-header-h: 76px;
  --legal-header-pad: 25px;
}

html[data-site="keycap"] .legal-brand {
  font-size: 21px;
  font-weight: 600;
  gap: 12px;
  letter-spacing: -1px;
}

html[data-site="keycap"] .legal-brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  padding: 0;
  display: grid;
  place-items: center;
  position: relative;
  color: #fff9df;
}

html[data-site="keycap"] .legal-brand-mark span {
  position: absolute;
  right: 3px;
  top: 0;
  font-size: 19px;
  line-height: 1;
  letter-spacing: 0;
}

html[data-site="keycap"] .legal-brand-sub {
  font-size: 8px;
  letter-spacing: 1.7px;
  color: #214638;
  font-weight: 600;
  margin-top: 3px;
}

html[data-site="keycap"] .legal-main h1 { font-size: 21px; }

/* 키캡 데스크톱은 화면을 꽉 채워 푸터가 가려지므로 고정 표시 */
html[data-site="keycap"] .site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: #fff;
  box-shadow: 0 -1px 0 var(--legal-line);
}

html[data-site="keycap"] .workspace { padding-bottom: 48px; }

/* 클리커 — index.html의 인라인 스타일과 같은 값 */
html[data-site="clicker"] {
  --legal-ink: #263c31;
  --legal-muted: #69836d;
  --legal-line: #dce5d6;
  --legal-green: #356a4e;
  --legal-lime: #e7f0e2;
  --legal-paper: #f6f8f2;
  --legal-font: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --legal-base: 14px;
  --legal-header-h: auto;
  --legal-header-pad: 28px;
}

html[data-site="clicker"] .legal-header {
  min-height: 0;
  padding-block: 16px;
}

html[data-site="clicker"] .legal-brand {
  font-size: 20px;
  font-weight: 600;
  gap: 0;
  letter-spacing: -.4px;
}

html[data-site="clicker"] .legal-main { padding-top: 24px; }
html[data-site="clicker"] .legal-sheet { border-radius: 12px; padding: 22px 24px 26px; }
html[data-site="clicker"] .legal-main h1 { font-size: 21px; font-weight: 600; letter-spacing: -.5px; }
html[data-site="clicker"] .legal-main h2 { font-size: 14px; }
html[data-site="clicker"] .legal-footer { font-size: 10px; }

html[data-site="clicker"] .site-footer { font-size: 11px; }

/* ── 좁은 화면 ─────────────────────────────────────── */

@media (max-width: 700px) {
  .legal-header { padding: 0 16px; height: auto; min-height: 66px; padding-block: 10px; }
  .legal-brand { font-size: 18px; gap: 10px; }
  .legal-brand-mark { width: 34px; height: 34px; font-size: 31px; line-height: 31px; border-radius: 10px; }
  .legal-brand-sub { font-size: 8px; letter-spacing: 1.2px; }

  .legal-main { padding: 18px 12px 40px; }
  .legal-sheet { padding: 20px 16px 24px; border-radius: 10px; }
  .legal-main h1 { font-size: 20px; }
  .legal-main table { font-size: 10px; }
  .legal-main th, .legal-main td { padding: 6px 8px; }
  .legal-main th { white-space: normal; }

  .site-footer { padding: 12px 16px; }
  .legal-footer { padding: 14px 16px 18px; }
}
