/*
 * 약관·개인정보 처리방침 본문 서식 복원 (CH-U-TE-01-01-01 / CH-U-PP-01-01-01).
 *
 * 공용 reset 이 Meyer 라 `strong`·`b`·`ol`·`ul` 의 기본 서식이 전부 지워진다
 * (`font: inherit` + `list-style: none`). 목업 `terms.css` 는 그중 조 번호만
 * `counter()` 로 되살리고 나머지는 두지 않아, 본문이 **굵기·번호·목록·링크 구분이 없는
 * 한 덩어리 평문**으로 읽힌다. 원문(레거시 `trion/rule/terms.jsp`)은 조 제목을 `<strong>`
 * 으로 굵게 쓰고 항 번호를 ①②③ 로 나눈 문서다.
 *
 * 여기서 되살리는 것은 **서식뿐**이고, 범위는 약관 본문 컨테이너
 * (`.terms-document` · `.privacy-document`) 안으로 제한한다 — 목업이 정의한 클래스
 * (`.privacy-table`·`.privacy-index`·`.privacy-seller-button`)는 건드리지 않는다.
 * 본문 문자열(`policyTermsContent.ts`)도 그대로 둔다 — 자동 추출물이다.
 */

/* 1) 조 제목 — **더 이상 여기서 손대지 않는다** (20260826 목업).
      예전 목업은 `font-size: inherit; font-weight: 400` 으로 눕혀 본문과 구분되지 않아
      여기서 굵기·색을 되살렸다. 20260826 `terms.css` 가 `14px / 600 / #111` 을 직접 정하고
      모바일에서는 `#505050` 로 낮추므로, 우리 보정이 남아 있으면 **목업이 정한 값을 덮는다.**
      목업이 따라잡은 보정은 지운다. */

/* 2) strong·b — reset 이 지운 굵기를 되돌린다(본문 안에서만) */
.terms-content-body .terms-document :is(strong, b),
.terms-content-body .privacy-document :is(strong, b) {
  font-weight: 600;
}

/* 3) 번호 목록 — 목업이 `counter()` 로 번호를 찍지만 구분점과 들여쓰기가 없어
      번호와 본문이 붙고, 줄바꿈된 다음 줄이 번호 아래로 파고든다.
      번호 폭을 확보하고 내어쓰기(hanging indent)로 정렬한다. */
.terms-content-body .terms-document ol > li,
.terms-content-body .privacy-document ol > li {
  padding-left: 20px;
  text-indent: -20px;
}

.terms-content-body .terms-document ol > li + li,
.terms-content-body .privacy-document ol > li + li {
  margin-top: 4px;
}

.terms-content-body .terms-document ol > li::before,
.terms-content-body .privacy-document ol > li::before {
  display: inline-block;
  width: 20px;
  text-indent: 0;
  content: counter(terms) '.';
}

/* 목차(`.privacy-index`)는 목업이 이미 `counter(privacy-index) ". "` 로 찍는다 —
   자체 카운터·여백을 쓰므로 위 규칙을 되돌린다. */
.terms-content-body .privacy-index ol > li {
  padding-left: 0;
  text-indent: 0;
}

.terms-content-body .privacy-index ol > li::before {
  width: auto;
  content: counter(privacy-index) '. ';
}

/* 4) 불릿 목록 — reset 이 `list-style: none` 이라 표식과 들여쓰기가 모두 없다 */
.terms-content-body .terms-document ul,
.terms-content-body .privacy-document ul {
  margin-top: 4px;
  padding-left: 18px;
  list-style: disc;
  list-style-position: outside;
}

/* 5) 문단 — 원문의 단락 간격을 되돌린다(목업은 `margin: 0` 이다) */
.terms-content-body .terms-document p + p,
.terms-content-body .terms-document ol + p,
.terms-content-body .terms-document p + ol {
  margin-top: 8px;
}

/* 6) 링크 — reset 이 색·밑줄을 지워 본문과 구분되지 않는다.
      목차 링크는 목업이 `color: inherit` 로 의도한 것이라 제외한다. */
.terms-content-body .terms-document a,
.terms-content-body .privacy-document a:not(.privacy-index a) {
  color: #3d5a94;
  text-decoration: underline;
}

/* 7) 표 — 목업 CSS 는 `.privacy-table` 클래스가 붙은 표만 그린다.
      클래스가 없는 표도 최소한 격자·머리행을 갖게 한다(넘침도 막는다). */
.terms-content-body .terms-document table,
.terms-content-body .privacy-document table:not(.privacy-table) {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.terms-content-body .terms-document :is(th, td),
.terms-content-body .privacy-document table:not(.privacy-table) :is(th, td) {
  padding: 10px 8px;
  border: 1px solid #e6e6f2;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.terms-content-body .terms-document th,
.terms-content-body .privacy-document table:not(.privacy-table) th {
  background: #f6f7f9;
  font-weight: 600;
}
