/*
 * 법적 고지 문서(이용약관·개인정보 처리방침) 공용 스타일.
 *
 * 원래 terms/index.php와 privacy/index.php가 거의 같은 <style> 블록을 각자 들고 있었다.
 * 한쪽만 고치면 두 문서의 생김새가 갈라지므로 여기로 합쳤다 — 두 페이지가 같은 규칙을
 * 쓰는 게 맞고, 실제로 표 스타일을 고치면서 그 문제가 바로 드러났다.
 */

.terms-body {
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 12px;
    padding: 40px;
    font-size: 15px;
    line-height: 1.75;
    color: #2b333f;
}

/* 문서 첫머리 요약 — 본문과 구분되게 상자로 감싼다. */
.terms-body .terms-intro {
    background: #f6f9ff;
    border: 1px solid #e2ebfa;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 36px;
    color: #40506a;
}

/* 조 제목 — 위쪽 구분선으로 조문 사이를 확실히 끊는다. */
.terms-body h2 {
    font-size: 17px;
    font-weight: 700;
    color: #0d1a33;
    margin: 34px 0 12px;
    padding-top: 22px;
    border-top: 1px solid #eef2f7;
}
.terms-body h2:first-of-type {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.terms-body p { margin: 0 0 10px; }
.terms-body ol,
.terms-body ul { margin: 4px 0 14px; padding-left: 22px; }
.terms-body li { margin-bottom: 6px; }
.terms-body b { font-weight: 600; color: #14243d; }

/* 아직 확정되지 않은 값 — 배포 전에 반드시 실제 값으로 바꿔야 한다. */
.terms-body b.ph {
    background: #fff4d6;
    border-bottom: 1px dashed #d9a521;
    color: #8a5d00;
    padding: 0 3px;
}

/* ── 표 ─────────────────────────────────────────────────────────────────────
 * 좁은 화면에서는 표가 본문을 밀지 않고 **자기 상자 안에서만** 가로 스크롤한다.
 * 표 자체에 display:block; overflow-x:auto를 주면 table-layout:fixed가 무시되므로
 * (테이블 박스가 아니게 된다) 반드시 바깥 div로 감싼다. */
.pp-scroll {
    overflow-x: auto;
    margin: 14px 0 22px;
    /* 잘린 쪽 가장자리에만 그림자를 띄워 "옆으로 더 있다"를 알린다.
     * 순수 CSS로 스크롤 여부를 감지하는 방법 — 흰 그라디언트 두 장은 내용과 함께
     * 움직이고(local) 그림자 두 장은 고정(scroll)이라, 끝까지 스크롤하면 흰 장이
     * 그림자를 덮어 사라진다. 넘치지 않는 표에는 아예 나타나지 않는다. */
    background:
        linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center,
        linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center,
        radial-gradient(farthest-side at 0 50%, rgba(19, 42, 76, 0.14), transparent) left center,
        radial-gradient(farthest-side at 100% 50%, rgba(19, 42, 76, 0.14), transparent) right center;
    background-repeat: no-repeat;
    background-size: 34px 100%, 34px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
}

.pp-table {
    width: 100%;
    min-width: 520px;   /* 이보다 좁아지면 칸이 뭉개지므로 스크롤로 넘긴다 */
    margin: 0;
    border-collapse: collapse;
    /* 열 너비를 colgroup으로 직접 정한다 — 자동 배분에 맡기면 정보량이 적은
       1열이 과도하게 좁아져서 라벨이 어절 중간에서 끊긴다. */
    table-layout: fixed;
    font-size: 14px;
    line-height: 1.6;
}

.pp-table th,
.pp-table td {
    padding: 11px 14px;
    text-align: left;
    vertical-align: top;
    /* 한국어는 어절 단위로 끊어야 읽힌다. 기본값이면 "서비스 이용 과/정에서"처럼
       단어 한가운데가 갈라진다. 긴 URL·영문만 예외적으로 끊는다. */
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 세로 격자선을 없애고 가로선만 남긴다 — 칸마다 테두리를 두르면 좁은 폭에서
   글자보다 선이 먼저 눈에 들어와 오히려 읽기 어렵다. */
.pp-table thead th {
    background: #f6f9ff;
    font-weight: 600;
    color: #26364d;
    border-bottom: 2px solid #d8e3f2;
    white-space: nowrap;
}
.pp-table tbody td { border-bottom: 1px solid #edf1f6; }
.pp-table tbody tr:last-child td { border-bottom: 0; }

/* 1열은 "이 행이 무엇에 관한 것인가"를 알려주는 라벨이라 살짝 강조한다. */
.pp-table tbody td:first-child {
    font-weight: 500;
    color: #1d2a3d;
}

/* 표 안에서는 줄 간격을 줄여 목록이 세로로 늘어지지 않게 한다. */
.pp-table ul { margin: 0; padding-left: 16px; }
.pp-table li { margin-bottom: 2px; }

/* 연락처 등 강조 상자 */
.pp-contact {
    background: #f8fafc;
    border: 1px solid #e8edf5;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 10px 0 14px;
}
.pp-contact ul { margin: 8px 0 0; }

/* 문서 끝의 사업자 정보 */
.terms-company {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px solid #eef2f7;
    color: #55606f;
    font-size: 14px;
}
.terms-company h2 { border-top: 0; padding-top: 0; }

.terms-updated {
    margin-top: 18px;
    color: #9aa5b4;
    font-size: 13px;
    text-align: right;
}

@media (max-width: 640px) {
    .terms-body { padding: 24px 20px; font-size: 14.5px; }
    .pp-table { font-size: 13.5px; }
    .pp-table th,
    .pp-table td { padding: 9px 11px; }
}

/* 개정 전 시행본 열람(group/lib/legal_versions.php) */
.legal-old-notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 8px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    font-size: 14px;
    color: #5d4037;
}
.legal-old-notice a { color: #1565c0; font-weight: 500; }
.legal-versions { margin-top: 40px; padding-top: 20px; border-top: 1px solid #e0e0e0; font-size: 14px; }
.legal-versions h2 { font-size: 16px; margin-bottom: 8px; }
.legal-versions ul { list-style: none; padding: 0; }
.legal-versions li { padding: 3px 0; }
.legal-versions a { color: #1565c0; }
