/* ============ [H39] 이용약관 · 개인정보처리방침 ============
   - 랜딩 푸터의 모달(.policy-modal, js/policy-modal.js) — policy/<문서>.html 의 <article class="pol-doc"> 를 불러와 띄움
   - 같은 문서의 단독 페이지(.pol-page — policy/build.py 가 만듦, 스크립트 없이도 읽힘)
   본문: 데스크톱은 왼쪽 목차(읽는 조 표시) + 오른쪽 본문, 좁은 화면은 위에 가로로 넘기는 목차 */

/* ---- 모달 ---- */
.policy-modal {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  width: min(1000px, calc(100% - 32px));
  max-width: none;
  height: calc(100dvh - 48px);
  max-height: none;
  overflow: visible;
}
.policy-modal::backdrop {
  background: rgba(8, 6, 18, 0.74);
  backdrop-filter: blur(6px);
}
.policy-modal[open] {
  animation: pm-in 0.22s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .policy-modal[open] {
    animation: none;
  }
}
/* 모달이 열린 동안 뒤 페이지 스크롤 잠금 */
html:has(.policy-modal[open]) {
  overflow: hidden;
}
.pol-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #17142d; /* 사전 예약 창과 같은 불투명 바탕 */
  border: 1px solid rgba(248, 87, 180, 0.28);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pol-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--line);
}
.pol-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}
.pol-tab {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.pol-tab:hover {
  color: #fff;
}
.pol-tab[aria-selected='true'] {
  background: var(--grad);
  color: #fff;
}
.pol-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pol-bar .pm-close {
  position: static;
  flex: none;
  margin-left: auto;
}
.pol-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  --pol-toc-top: 20px;
  --pol-toc-max: calc(100dvh - 48px - 70px - 40px); /* 모달 높이 - 탭 줄 - 위아래 여백 */
}
.pol-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.pol-status {
  margin: 0;
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
}
.pol-status a {
  color: var(--accent-text);
  text-decoration: underline;
}

/* ---- 문서 본문 (모달·단독 페이지 공통) ---- */
.pol-doc {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  column-gap: 44px;
  padding: 32px clamp(20px, 4vw, 40px) 72px;
  color: #d8d5ea;
  font-size: 15.5px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.pol-doc-head {
  grid-column: 2;
  max-width: 72ch;
  padding-bottom: 8px;
}
.pol-doc-head h2 {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.3;
  color: #fff;
}
.pol-meta {
  display: inline-block;
  margin: 12px 0 0;
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(248, 87, 180, 0.12);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}
.pol-lead {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* 목차 — 데스크톱: 왼쪽에 붙어 따라오는 세로 목록 */
.pol-toc {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  position: sticky;
  top: var(--pol-toc-top);
  max-height: var(--pol-toc-max);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 4px 0;
  scrollbar-width: thin;
}
.pol-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pol-toc a {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.45;
}
.pol-toc a:hover {
  color: #fff;
}
.pol-toc a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.pol-toc a b {
  font-weight: 700;
  color: var(--violet-soft);
}
.pol-toc a.is-current {
  border-left-color: var(--accent);
  color: #fff;
  background: linear-gradient(90deg, rgba(248, 87, 180, 0.12), transparent);
}
.pol-toc a.is-current b {
  color: var(--accent-text);
}

.pol-body {
  grid-column: 2;
  max-width: 72ch;
}
.pol-art {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 8px;
}
.pol-art:first-child {
  margin-top: 16px;
}
.pol-art h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.02em;
  color: #fff;
}
.pol-no {
  flex: none;
  font-weight: 800;
  color: var(--accent-text);
}
.pol-art h4 {
  margin: 26px 0 8px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--violet-soft);
}
.pol-art h5 {
  margin: 20px 0 8px;
  padding-left: 12px;
  border-left: 3px solid rgba(201, 164, 245, 0.5);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: #ebe8f6;
}
.pol-art p {
  margin: 0 0 12px;
}
.pol-items {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 6px 0 16px;
  padding: 0;
}
.pol-items li {
  display: grid;
  grid-template-columns: 1.7em minmax(0, 1fr);
}
.pol-mark {
  font-weight: 700;
  color: var(--violet-soft);
}
.pol-items strong {
  font-weight: 700;
  color: #fff;
}

/* ---- 단독 페이지 (policy/terms.html · privacy.html) ---- */
.pol-page {
  overflow-x: clip;
}
.pol-page-head,
.pol-page main {
  max-width: 1100px;
  margin: 0 auto;
}
.pol-page-head {
  padding: 22px clamp(20px, 4vw, 40px) 0;
}
.pol-page-head .brand {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
}
.pol-page-head .brand .dot {
  color: var(--accent);
}
.pol-page main {
  --pol-toc-top: 16px;
  --pol-toc-max: calc(100dvh - 32px);
}

/* ---- 좁은 화면: 모달은 화면 전체, 목차는 위에 붙는 가로 칩 ---- */
@media (max-width: 820px) {
  .policy-modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
  }
  .pol-panel {
    border: 0;
    border-radius: 0;
  }
  .pol-bar {
    padding: 10px 12px 10px 14px;
  }
  .pol-tab {
    padding: 8px 13px;
    font-size: 13.5px;
  }
  .pol-doc {
    display: block;
    padding: 22px 18px 56px;
    font-size: 15px;
    line-height: 1.78;
  }
  .pol-doc-head h2 {
    font-size: 23px;
  }
  .pol-toc {
    z-index: 1;
    top: 0;
    max-height: none;
    margin: 18px -18px 0;
    padding: 10px 18px;
    overflow-x: auto;
    overflow-y: hidden;
    background: #17142d;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .pol-toc::-webkit-scrollbar {
    display: none;
  }
  .pol-toc ol {
    display: flex;
    gap: 8px;
    width: max-content;
  }
  .pol-toc a {
    max-width: 15em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
  }
  .pol-toc a.is-current {
    border-color: var(--accent);
    background: rgba(248, 87, 180, 0.14);
  }
  .pol-art {
    scroll-margin-top: 64px; /* 위에 붙은 목차에 가리지 않게 */
  }
  .pol-page .pol-toc {
    background: var(--night);
  }
}
