/* ================================================================
   site-pages.css — www 일반 페이지(블로그·공지사항·글 상세·이용약관·개인정보처리방침·아이디어·404) 전용 조각
   공통 모양(헤더·제목 줄·버튼·표·안내 상자·하단 알림)은 core-ui.css, 기준은 design-docs/.
     · 목록은 표(제목 링크) + 한 페이지 30개 + 페이지 번호, 날짜 YYYY/MM/DD
     · 문서(약관·방침)는 읽기 폭을 좁힌 본문 + 조항 구분선
     · 글 상세는 위치 안내(목록 › 현재 글) → 글 머리 → 본문
================================================================ */

/* ── 공통: 위치 안내(여러 단계 경로가 있는 화면만) ── */
.sp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.sp-crumbs a { color: var(--muted); }
.sp-crumbs a:hover { color: var(--focus); text-decoration: underline; text-underline-offset: 3px; }
.sp-crumbs svg { width: 14px; height: 14px; }
.sp-crumbs [aria-current] { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ── 목록: 검색 줄 + 표 + 페이지 번호 ── */
.sp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sp-search { width: min(360px, 100%); }
.sp-search .input-shell { padding-left: 12px; }
.sp-search .input-shell > svg { color: var(--muted); width: 18px; height: 18px; }
.sp-count { font-size: 14px; color: var(--muted); white-space: nowrap; }
.sp-table td.sp-title { width: 100%; max-width: 0; }   /* 제목 칸이 남는 폭을 다 쓰고 길면 말줄임 */
.sp-table td.sp-title a { font-weight: 600; }
.sp-table td.sp-title a:hover { color: var(--focus); text-decoration: underline; text-underline-offset: 3px; }
.sp-table td.sp-title .badge { margin-left: 8px; vertical-align: 1px; }
.sp-table th.sp-svc, .sp-table td.sp-svc { width: 1%; text-align: center; }   /* 목록 표는 제목만 왼쪽, 짧은 칸은 가운데(2026/11/03) */
.sp-table th.sp-date, .sp-table td.sp-date { width: 1%; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.sp-table th.sp-c, .sp-table td.sp-c { text-align: center; }   /* 가운데 칸(유형·서비스·접수번호·날짜·상태) — 내 문의·내 아이디어 표 */
/* 목록 위 계정 안내(내 아이디어·문의 처리 상태 조회) — 계정 바꾸기는 헤더 사용자 메뉴로 */
.sp-acct { margin: 0 0 16px; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.sp-acct b { color: var(--text); font-weight: 600; }
.sp-pages { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 20px; }
.sp-pages .button { min-width: 40px; min-height: 40px; padding: 0 10px; }
.sp-pages .button[aria-current="page"] { background: var(--soft); border-color: var(--focus); color: var(--focus); }
.sp-pages .icon-button { width: 40px; min-width: 40px; height: 40px; }
.sp-pages .icon-button:disabled { opacity: .35; cursor: default; }

/* ── 글 상세(블로그·공지사항) ── */
.sp-article { max-width: 820px; }
.sp-article-head { padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.sp-article-head .badge { margin-bottom: 12px; }
.sp-article-head h2 { font-size: 24px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere; }
.sp-article-head h2:focus { outline: none; }   /* 화면 전환 때 옮긴 초점은 테두리 없이 */
.sp-article-head time { display: block; margin-top: 8px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sp-photo { margin-top: 24px; }
.sp-photo img { display: block; width: 100%; border-radius: var(--radius); }
.sp-body { padding-top: 24px; font-size: 16px; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.sp-body > :first-child { margin-top: 0; }
.sp-body p { margin: 0 0 1.1em; }
.sp-body h2 { font-size: 20px; margin: 1.8em 0 .6em; }
.sp-body h3 { font-size: 16px; margin: 1.5em 0 .5em; }
.sp-body ul, .sp-body ol { padding-left: 22px; margin: 0 0 1.1em; }
.sp-body li + li { margin-top: 4px; }
.sp-body a { color: var(--focus); text-decoration: underline; text-underline-offset: 3px; }
.sp-body img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 1.2em 0; }
.sp-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.sp-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--brand); color: var(--muted); }
.sp-body code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: .88em; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; }
.sp-body pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; margin: 0 0 1.4em; }
.sp-body pre code { background: none; border: 0; padding: 0; }
.sp-body table { display: block; overflow-x: auto; max-width: 100%; margin: .6em 0 1.4em; border: 1px solid var(--border); border-radius: var(--radius); }
.sp-body th, .sp-body td { white-space: normal; max-width: none; text-align: left; vertical-align: top; }
.sp-article-foot { margin-top: 48px; }
.sp-plain { white-space: pre-wrap; }   /* 사용자가 쓴 글(내 아이디어) — 줄바꿈 그대로 */
.sp-ref-cell { letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── 문서(이용약관·개인정보처리방침) ── */
.sp-doc { max-width: 820px; }
.sp-doc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 14px; color: var(--muted); }
.sp-doc-meta strong { color: var(--text); font-weight: 600; }
.sp-doc-meta .note { width: 100%; margin-top: 8px; }
.sp-doc > .note { margin-bottom: 24px; }
.doc-section { padding: 28px 0; border-top: 1px solid var(--border); }
.doc-section:first-of-type { margin-top: 24px; }
.doc-section h2 { margin-bottom: 12px; }
.doc-section p, .doc-section li { font-size: 16px; line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; }
.doc-section ul, .doc-section ol { margin: 0; padding-left: 22px; }
.doc-section li + li { margin-top: 6px; }
.doc-section strong { font-weight: 700; }
.doc-section a { color: var(--focus); text-decoration: underline; text-underline-offset: 3px; }
.doc-section table { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; display: block; overflow-x: auto; }
.doc-section th, .doc-section td { white-space: normal; max-width: none; min-width: 120px; vertical-align: top; }
.doc-section td { line-height: 1.6; }
.doc-section .sub-note { margin-top: 10px; font-size: 14px; color: var(--muted); }
.doc-section .sub-note strong { color: var(--text); }
.service-link-list { display: grid; gap: 8px; margin-top: 14px; }
.service-link-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 14px; }
.service-link-item span { font-weight: 600; }
.service-link-item a { color: var(--focus); font-weight: 600; text-decoration: none; }
.service-link-item a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* 개정 이력 */
.sp-history { margin-top: 16px; padding-top: 28px; border-top: 1px solid var(--border); }
.sp-history h2 { margin-bottom: 12px; }
.sp-history-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.sp-history-row:first-of-type { border-top: 0; }
.sp-history-row strong { font-weight: 600; }
.sp-history-row .small { display: block; margin-top: 2px; }

/* ── 안내 화면(아이디어 제보·404): 가운데 카드 하나 ── */
.sp-center { display: flex; justify-content: center; }
.sp-message { width: 100%; max-width: 560px; text-align: center; padding: 40px 32px; }
.sp-message-icon { width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--focus); }
.sp-message-icon svg { width: 26px; height: 26px; }
.sp-message-code { font-size: 14px; font-weight: 700; color: var(--focus); letter-spacing: .08em; margin-bottom: 6px; }
.sp-message h2 { word-break: keep-all; }
.sp-message p { margin-top: 10px; font-size: 16px; color: var(--muted); word-break: keep-all; }
.sp-message .actions { margin-top: 28px; }
.sp-message .actions.single { justify-content: center; }

/* ── 아이디어 제보 양식 ── */
.id-form { margin-top: 24px; }
.id-form .field + .field { margin-top: 20px; }
.id-combo { position: relative; }
.id-combo .input-shell > svg { color: var(--muted); width: 18px; height: 18px; }
.id-options { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; max-height: 280px; overflow-y: auto;
  list-style: none; margin: 0; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-h); }
.id-options [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 10px 12px;
  border-radius: calc(var(--radius) - 4px); font-size: 14px; cursor: pointer; }
.id-options [role="option"]:hover, .id-options .is-active { background: var(--soft); color: var(--focus); }
.id-options [aria-selected="true"] { font-weight: 600; color: var(--focus); }
.id-options [role="option"] svg { width: 16px; height: 16px; }
.id-options .id-empty { padding: 12px; font-size: 14px; color: var(--muted); }
.id-area { position: relative; }
.id-area textarea { display: block; width: 100%; min-height: 220px; padding: 12px 48px 12px 16px; resize: vertical;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); font-size: 14px; line-height: 1.7; }
.id-area textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.id-area textarea[aria-invalid="true"] { border-color: var(--error); }
.id-area .icon-button { position: absolute; top: 4px; right: 4px; width: 36px; min-width: 36px; height: 36px; color: var(--muted); }
.id-area .icon-button svg { width: 16px; height: 16px; }
.id-area-foot { display: flex; justify-content: space-between; gap: 12px; }
.id-count { flex: none; font-variant-numeric: tabular-nums; }
/* 보내는 사람 카드(support.css 의 .sp-me 와 같은 모양) */
.id-label { font-size: 14px; font-weight: 600; }
.sp-me { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.sp-me-av { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.sp-me--guest .sp-me-av { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.sp-me-who { flex: 1; min-width: 0; }
.sp-me-name { font-weight: 700; }
.sp-me-mail { font-size: 14px; overflow-wrap: anywhere; }
.sp-me-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sp-alt { width: 100%; margin: 0; font-size: 14px; color: var(--muted); }
.sp-alt:empty { display: none; }
.sp-alt a, .sp-alt button { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--focus); cursor: pointer; }
.sp-alt a:hover, .sp-alt button:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 800px) { .sp-me-acts { width: 100%; justify-content: flex-start; } }
/* 접수번호 + 복사(support.css 의 .sp-ref 와 같은 모양) */
.sp-message .sp-ref { display: inline-flex; align-items: center; gap: 12px; margin-top: 20px; padding: 6px 6px 6px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sp-message .sp-ref strong { font-size: 18px; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--text); }
.sp-message .sp-ref .button { min-height: 36px; padding: 0 12px; }
/* reCAPTCHA 안내 — 배지 대신 문구로(App Check 를 쓰는 화면) */
.grecaptcha-badge { visibility: hidden; }
.sp-recaptcha { margin-top: 12px; text-align: center; font-size: 12px; line-height: 1.6; color: var(--muted); word-break: keep-all; }
.sp-recaptcha a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 800px) {
  .sp-toolbar { flex-direction: column; align-items: stretch; }
  .sp-search { width: 100%; }
  .sp-count { align-self: flex-end; }
  .sp-table { min-width: 560px; }   /* 좁은 화면은 표 안에서 가로로 넘겨 본다(design-docs 표 규칙) — 제목이 너무 잘리지 않게 */
  .sp-article-head h2 { font-size: 20px; }
  .sp-message { padding: 32px 20px; }
}
@media (max-width: 480px) {
  .sp-message .actions { flex-direction: column-reverse; }
  .sp-message .actions .button { width: 100%; }
}
