/**
 * 엔스타일투어 리뉴얼 - 약관 / 개인정보취급방침 (/doc/...)
 * base.css 다음에 로드
 * 테마: 사이트 기본 색상 body[data-region="site"] (base.css 토큰)
 * 본문은 기존 약관 조각(.serviceBox > .ttt / .tit / .txt)을 그대로 사용 → 이 화면(.doc-body) 안에서만 스타일 지정
 */

/* ==========================================================
   1. 문서 탭 + 목차 / 본문 배치
   ========================================================== */
.doc-tabs { margin-bottom: 2.5rem; }

.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}

/* 목차 (조항 제목으로 자동 생성) */
.doc-toc { position: sticky; top: calc(var(--header-h) + 1.5rem); max-height: calc(100vh - var(--header-h) - 3rem); overflow-y: auto; }
.doc-toc summary { display: none; }
.doc-toc-title { margin-bottom: 0.75rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 1.5px; color: var(--text-tertiary); }
.doc-toc ol { display: grid; border-left: 1px solid var(--line); }

.doc-toc a {
  display: block;
  margin-left: -1px;
  padding: 0.4rem 0 0.4rem 0.9rem;
  border-left: 2px solid transparent;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-secondary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.doc-toc a:hover { color: var(--text-primary); border-left-color: var(--line-strong); }
.doc-toc a.is-active { color: var(--text-primary); font-weight: 700; border-left-color: var(--gold); }

/* ==========================================================
   2. 본문 (기존 약관 조각)
   ========================================================== */
.doc-body { max-width: 860px; }
.doc-body .serviceBox { font-size: 0.95rem; line-height: 1.9; color: var(--text-secondary); word-break: keep-all; overflow-wrap: anywhere; }

.doc-body .ttt {
  margin-bottom: 0.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.4;
  color: var(--text-primary);
}

.doc-body .tit {
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}

.doc-body .txt + .txt { margin-top: 0.75rem; }
.doc-body .txt b, .doc-body .txt strong { color: var(--text-primary); }
.doc-body table { width: 100%; margin: 0.75rem 0; border-collapse: collapse; font-size: 0.88rem; }
.doc-body th, .doc-body td { padding: 0.6rem 0.75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-body th { background: var(--ivory); color: var(--text-primary); }

/* 맨 위로 */
.doc-top { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); text-align: right; }
.doc-top a { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--text-tertiary); }
.doc-top a:hover { color: var(--text-primary); }
.doc-top svg { width: 14px; height: 14px; }

/* ==========================================================
   3. 반응형
   ========================================================== */
@media (max-width: 1024px) {
  .doc-layout { grid-template-columns: 1fr; gap: 1.5rem; }

  /* 목차: 접었다 펼치기 */
  .doc-toc { position: static; max-height: none; border: 1px solid var(--line); background: var(--ivory); }
  .doc-toc summary { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.1rem; font-size: 0.9rem; font-weight: 700; cursor: pointer; list-style: none; }
  .doc-toc summary::-webkit-details-marker { display: none; }
  .doc-toc summary::after { content: '+'; font-size: 1.2rem; font-weight: 400; color: var(--text-tertiary); }
  .doc-toc[open] summary::after { content: '−'; }
  .doc-toc-title { display: none; }
  .doc-toc ol { margin: 0 1.1rem 1rem; }
}

@media (max-width: 768px) {
  .doc-tabs { margin-bottom: 1.5rem; }
  .doc-body .serviceBox { font-size: 0.9rem; }
  .doc-body .ttt { padding-bottom: 1.1rem; font-size: 1.3rem; }
  .doc-body .tit { margin-top: 1.75rem; font-size: 0.98rem; }
}
