/* =========================================================================
   수금대장 개인정보 처리방침 - 커스텀 스타일
   구조: 1) 공통  2) 챕터/조문  3) 목록  4) 표  5) 정보박스
         6) 목차(TOC)  7) 맨 위로 버튼  8) 모바일 목차  9) 하이라이트
         10) 인쇄  11) 스크롤바
   ※ Tailwind CSS 유틸리티로 표현이 어려운 부분만 여기서 정의합니다.
   ========================================================================= */

/* ---------- 1. 공통 ---------- */
html {
  scroll-behavior: smooth;
}

body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 상단 스크롤 시 헤더 그림자 */
#site-header.scrolled {
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ---------- 2. 챕터(Chapter) & 조문(Article) ---------- */
.chapter {
  margin-top: 3.5rem;
  scroll-margin-top: 5.5rem;
}

.chapter:first-of-type {
  margin-top: 0;
}

.chapter-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #182a68;
  background: linear-gradient(90deg, #eef4ff 0%, rgba(238, 244, 255, 0) 100%);
  border-left: 5px solid #3366ff;
  padding: 0.65rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 1.75rem;
}

.chapter-note {
  font-size: 0.875rem;
  color: #64748b;
  margin: -1.25rem 0 1.5rem 0.75rem;
}

.article {
  margin-bottom: 2.25rem;
  scroll-margin-top: 5.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed #e2e8f0;
}

.chapter .article:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.article-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.75rem;
  padding-left: 0.75rem;
  border-left: 3px solid #b9d1ff;
}

.article p {
  font-size: 0.975rem;
  line-height: 1.9;
  color: #334155;
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}

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

/* ---------- 3. 목록 (번호/글머리 기호) ---------- */
.numbered-list {
  list-style: none;
  counter-reset: item;
  margin: 0.5rem 0 0.75rem 0.75rem;
  padding-left: 0;
}

.numbered-list li {
  counter-increment: item;
  position: relative;
  padding-left: 1.75rem;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #334155;
  margin-bottom: 0.5rem;
}

.numbered-list li::before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  font-weight: 600;
  color: #3366ff;
}

.bullet-list {
  list-style: none;
  margin: 0.5rem 0 0.75rem 0.75rem;
  padding-left: 0;
}

.bullet-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.85;
  color: #334155;
  margin-bottom: 0.4rem;
}

.bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #8ab0ff;
  font-weight: 700;
}

/* ---------- 4. 표 ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0 1rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}

.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

.table-wrap th,
.table-wrap td {
  border: 1px solid #e2e8f0;
  padding: 0.65rem 0.85rem;
  text-align: left;
  vertical-align: top;
  color: #334155;
}

.table-wrap thead th {
  background-color: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
}

.table-wrap tbody th {
  background-color: #f8fafc;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
}

.table-wrap tbody tr:nth-child(even) td {
  background-color: #f8fafc;
}

.table-wrap table:first-child,
.table-wrap table:last-child {
  margin: 0;
}

/* ---------- 5. 정보박스 (안내/책임자/이원적구조 등) ---------- */
.dual-box-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0 0 0.75rem;
}

@media (min-width: 640px) {
  .dual-box-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.info-box {
  border-radius: 0.75rem;
  border: 1px solid;
  padding: 1rem;
}

.info-box-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.info-box-brand {
  background-color: #eef4ff;
  border-color: #dce8ff;
}

.info-box-brand .info-box-title {
  color: #182f85;
}

.info-box-slate {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
}

.info-box-slate .info-box-title {
  color: #1e293b;
}

/* ---------- 6. 목차 (TOC) ---------- */
.toc-chapter-title {
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: background-color 0.15s ease;
}

.toc-chapter-title:hover {
  background-color: #eef4ff;
  color: #2148d9;
}

.toc-article-link {
  display: block;
  padding: 0.35rem 0.5rem 0.35rem 1.25rem;
  font-size: 0.825rem;
  color: #64748b;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.toc-article-link:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.toc-article-link.active {
  background-color: #eef4ff;
  color: #2148d9;
  font-weight: 600;
}

/* ---------- 7. 맨 위로 버튼 ---------- */
#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- 8. 모바일 목차 드로어 ---------- */
#mobile-toc.open {
  transform: translateX(0);
}

/* ---------- 9. 목차 클릭/해시 진입 시 하이라이트 ---------- */
.article.highlight,
.chapter.highlight {
  animation: highlightPulse 1.6s ease;
}

@keyframes highlightPulse {
  0% { background-color: #fff7db; }
  100% { background-color: transparent; }
}

/* ---------- 10. 인쇄 스타일 ---------- */
@media print {
  #site-header, #toc-sidebar, #mobile-toc, #mobile-toc-overlay,
  #back-to-top, #mobile-menu-btn {
    display: none !important;
  }
  main {
    padding: 0 !important;
  }
  body {
    background: #fff !important;
  }
  .article, .chapter {
    scroll-margin-top: 0 !important;
  }
}

/* ---------- 11. 스크롤바 (사이드바/모바일 목차) ---------- */
#toc-sidebar::-webkit-scrollbar,
#mobile-toc::-webkit-scrollbar {
  width: 6px;
}
#toc-sidebar::-webkit-scrollbar-thumb,
#mobile-toc::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}
