/* 타이팡 공개 사이트 공용 스타일 — 외부 리소스 없음(시스템 글꼴만), 인라인 style 금지(CSP style-src 'self') */

:root {
  color-scheme: light dark;
  --bg: #FFFAF7;
  --surface: #FFFFFF;
  --ink: #2B1A1F;
  --muted: #6E5860;
  --accent: #C71440;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFE1E9;
  --line: #E8CFC6;
  --font-th: "Leelawadee UI", "Noto Sans Thai", "Sukhumvit Set", Thonburi, Tahoma, system-ui, -apple-system,
    "Segoe UI", Roboto, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-ko: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", system-ui, -apple-system,
    "Segoe UI", Roboto, "Leelawadee UI", "Noto Sans Thai", Thonburi, sans-serif;
  --font-en: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Leelawadee UI",
    "Noto Sans Thai", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1214;
    --surface: #241A1D;
    --ink: #F5E9EC;
    --muted: #C2AAB1;
    --accent: #FF7A9C;
    --accent-ink: #1A1214;
    --accent-soft: #3A1C26;
    --line: #3F2D33;
  }
}

/* hidden 속성은 레이아웃 규칙(display)보다 항상 우선 — 언어 전환이 이것에 기댄다 */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-th);
  font-size: 16px;
  line-height: 1.75;
  /* break-word: 넘치는 긴 단어(이메일·URL)만 끊는다 — anywhere 와 달리 표 열의 최소 폭을 한 글자로 무너뜨리지 않는다 */
  overflow-wrap: break-word;
}

:lang(ko) { font-family: var(--font-ko); word-break: keep-all; }
:lang(en) { font-family: var(--font-en); }
:lang(th) { font-family: var(--font-th); }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--accent);
  border-radius: 8px;
}
.skip:focus { left: 16px; }

.wrap { max-width: 720px; margin: 0 auto; padding-inline: 16px; }

/* ── 머리글 ─────────────────────────────────────────── */
.site-head { border-bottom: 2px solid var(--accent); background: var(--surface); }
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  line-height: 1.3;
}
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-names { display: flex; flex-direction: column; }
.brand-names .sub { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }

.lang-switch { display: flex; gap: 6px; }
.lang-switch button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* ── 본문 ───────────────────────────────────────────── */
main { padding-block: 8px 48px; }

h1 { font-size: 26px; line-height: 1.35; margin: 28px 0 8px; text-wrap: balance; }
h2 {
  font-size: 19px;
  line-height: 1.45;
  margin: 40px 0 10px;
  padding-top: 4px;
  text-wrap: balance;
  scroll-margin-top: 16px;
}
h3 { font-size: 16px; margin: 24px 0 6px; scroll-margin-top: 16px; }
h2 .no { color: var(--accent); margin-right: 6px; }

p, li { margin-block: 8px; }
ul, ol { padding-left: 22px; margin-block: 8px; }

.effective { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.lead { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.note {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
}

.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--ink);
}

/* 목차 */
.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
}
.toc h2 { font-size: 15px; margin: 0 0 4px; padding: 0; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin-block: 2px; }

/* 표 — 좁은 화면에서는 표만 가로 스크롤(페이지는 스크롤되지 않음) */
.table-scroll { overflow-x: auto; margin-block: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
thead th, th[scope="row"] { background: var(--surface); font-weight: 600; }
.nowrap { white-space: nowrap; }
caption { text-align: left; font-weight: 600; padding-bottom: 6px; }

/* 4열 표(.stack)는 좁은 화면에서 행마다 카드로 쌓는다 — 각 td 의 data-label 을 제목으로 보여 준다(rowspan 금지) */
@media (max-width: 600px) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  table.stack tr {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 10px;
  }
  table.stack td { border: 0; padding: 4px 0; }
  table.stack td::before {
    content: attr(data-label);
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
  }
  table.stack td:first-child { font-weight: 600; }
  .table-scroll:has(> table.stack) { overflow-x: visible; }
}

/* 국외 이전 카드 */
.cards { display: grid; gap: 12px; margin-block: 12px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
}
.card h3 { margin: 0 0 6px; }
.card dl { margin: 0; font-size: 15px; }
.card dt { font-weight: 600; color: var(--muted); font-size: 14px; }
.card dd { margin: 0 0 8px; }
.card dd:last-child { margin-bottom: 0; }

/* 단계 안내(홈) */
.steps { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 12px; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 12px 16px 12px 60px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  line-height: 30px;
  text-align: center;
}
.steps strong { display: block; }

/* 심사용 영문 요약 */
.en-summary {
  margin-top: 40px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 15px;
}
.en-summary h2 { font-size: 16px; margin: 0 0 6px; padding: 0; }

.contact-mail { font-size: 17px; font-weight: 700; }

/* ── 바닥글 ─────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--muted); }
.site-foot .wrap { padding-block: 20px 32px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 10px; padding: 0; list-style: none; }
.foot-links li { margin: 0; }
.foot-links .privacy-link { font-weight: 700; }
.biz { margin: 12px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; }
.biz dt { font-weight: 600; }
.biz dd { margin: 0; }

@media (max-width: 420px) {
  h1 { font-size: 23px; }
  .biz { grid-template-columns: 1fr; }
  .biz dd { margin-bottom: 6px; }
}

@media print {
  .lang-switch, .skip { display: none; }
  body { background: #FFFFFF; color: #000000; }
}
