/* ============================================================
   legal.css — 법적 페이지 4종 전용 CSS
   terms.html, privacy.html, refund.html, 404.html에서 공유
   common.css 이후에 로드할 것
   ============================================================ */

/* ── 법적 페이지 컨테이너 ───────────────────────── */
.legal-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ── 헤더 (제목 + 시행일) ───────────────────────── */
.legal-header {
  text-align: center;
  margin-bottom: 40px;
}

.legal-header h1 {
  font-family: 'Noto Serif KR', 'Batang', 'Georgia', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.4;
}

.legal-header .date {
  font-size: 13px;
  color: var(--sub-text);
  margin-top: 8px;
}

/* ── 목차 ────────────────────────────────────────── */
.legal-toc {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 8px;
}

.legal-toc h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}

.legal-toc ol {
  padding-left: 20px;
  list-style: decimal;
}

.legal-toc li {
  margin-bottom: 4px;
}

.legal-toc a {
  font-size: 14px;
  color: var(--sub-text);
  transition: color 0.2s;
}

.legal-toc a:hover {
  color: var(--gold);
}

/* ── 섹션 (각 조항) ─────────────────────────────── */
.legal-section {
  margin-top: 40px;
  border-top: 1px solid var(--card-border);
  padding-top: 32px;
}

.legal-section h2 {
  font-family: 'Noto Serif KR', 'Batang', 'Georgia', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
}

.legal-section h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  margin: 16px 0 8px;
}

.legal-section p {
  color: var(--white);
  line-height: 1.8;
  margin-bottom: 12px;
  font-size: 15px;
}

.legal-section ul,
.legal-section ol {
  color: var(--white);
  padding-left: 20px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-section li {
  margin-bottom: 8px;
  font-size: 15px;
}

/* ── 테이블 ──────────────────────────────────────── */
.legal-section .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

.legal-section table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  min-width: 400px;
}

.legal-section th {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 10px 12px;
  color: var(--gold);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.legal-section td {
  border: 1px solid var(--card-border);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--white);
  line-height: 1.6;
}

/* ── 하이라이트 박스 ─────────────────────────────── */
.legal-highlight {
  background: var(--card-bg);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}

.legal-highlight p {
  margin-bottom: 4px;
  font-weight: 600;
}

.legal-highlight p:last-child {
  margin-bottom: 0;
}

/* ── 푸터 (상호 링크) ────────────────────────────── */
.legal-footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  text-align: center;
}

.legal-footer p {
  color: var(--sub-text);
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.legal-footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-footer .footer-links a {
  color: var(--sub-text);
  font-size: 13px;
  transition: color 0.2s;
  padding: 2px 4px;
}

.legal-footer .footer-links a:hover {
  color: var(--gold);
}

.legal-footer .footer-links a.active {
  color: var(--gold);
  font-weight: 600;
}

.legal-footer .footer-links .sep {
  color: rgba(153, 153, 153, 0.4);
  font-size: 13px;
  user-select: none;
}

/* ── 404 에러 페이지 전용 ────────────────────────── */
.error-container {
  text-align: center;
  padding: 120px 24px;
}

.error-code {
  font-family: 'Noto Serif KR', 'Batang', 'Georgia', serif;
  font-size: 120px;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.3;
  line-height: 1;
}

.error-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  margin-top: -20px;
}

.error-desc {
  color: var(--sub-text);
  margin: 16px 0 8px;
  font-size: 15px;
}

.error-sub {
  color: var(--sub-text);
  font-size: 14px;
  font-style: italic;
  margin-bottom: 32px;
}

.error-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 600px) {
  .legal-container {
    padding: 24px 16px 40px;
  }

  .legal-header h1 {
    font-size: 22px;
  }

  .legal-section h2 {
    font-size: 17px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 14px;
  }

  .legal-section table {
    font-size: 13px;
  }

  .legal-section th,
  .legal-section td {
    padding: 8px 6px;
    font-size: 13px;
  }

  .legal-toc {
    padding: 16px;
  }

  .legal-toc a {
    font-size: 13px;
  }

  .error-container {
    padding: 80px 16px;
  }

  .error-code {
    font-size: 80px;
  }

  .error-title {
    font-size: 20px;
    margin-top: -12px;
  }

  .error-desc {
    font-size: 14px;
  }

  .error-buttons {
    flex-direction: column;
    align-items: center;
  }

  .error-buttons .btn-gold,
  .error-buttons .btn-outline {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}

@media (min-width: 600px) and (max-width: 900px) {
  .legal-container {
    padding: 32px 24px 48px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 15px;
  }
}

@media (min-width: 900px) {
  .legal-container {
    padding: 48px 32px 80px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 16px;
  }
}

/* ============================================================
   인쇄 스타일
   ============================================================ */
@media print {
  body {
    background: white;
    color: #333;
  }

  .page-nav,
  .legal-footer {
    display: none;
  }

  .legal-container {
    max-width: 100%;
    padding: 20px;
  }

  .legal-header h1 {
    color: #333;
  }

  .legal-section h2 {
    color: #333;
  }

  .legal-section h3 {
    color: #333;
  }

  .legal-section p,
  .legal-section li,
  .legal-section td {
    color: #333;
  }

  .legal-section th {
    color: #333;
    background: #f5f5f5;
    border-color: #ccc;
  }

  .legal-section td {
    border-color: #ccc;
  }

  .legal-toc {
    border-color: #ccc;
    background: #f5f5f5;
  }

  .legal-toc a {
    color: #333;
  }

  .legal-highlight {
    border-left-color: #999;
    background: #f5f5f5;
  }

  .legal-highlight p {
    color: #333;
  }

  .legal-section {
    border-top-color: #ccc;
  }
}
