/* 화면 전용 — 공지사항(사용자 /notices · /notices/<코드>, 관리자 /admin/notices, 대시보드·고객센터 「최근 공지」).
   공용 부품(.table·.tabs-nav·.filter-bar·.file-list·.badge·.card)은 components.css. 값은 토큰만. 모바일 먼저(min-width 600 · 960). */

/* ── 공지 본문(정화한 HTML) — 사용자 본문·관리자 미리보기 공용. 허용 태그만 그린다(includes/html_sanitize.php) ── */
.notice-body { color: var(--ink); font-size: var(--text-base); line-height: var(--leading-normal); overflow-wrap: anywhere; }
.notice-body > * + * { margin-top: var(--space-4); }
.notice-body h2 { font-size: var(--text-xl); line-height: var(--leading-tight); margin-top: var(--space-7); }
.notice-body h3 { font-size: var(--text-lg); line-height: var(--leading-tight); margin-top: var(--space-6); }
.notice-body h4 { font-size: var(--text-base); line-height: var(--leading-tight); margin-top: var(--space-5); }
.notice-body > :first-child { margin-top: 0; }
.notice-body a { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; }
.notice-body ul, .notice-body ol { padding-left: var(--space-6); display: grid; gap: var(--space-1); }
.notice-body ul { list-style: disc; }
.notice-body ol { list-style: decimal; }
.notice-body blockquote { padding: var(--space-3) var(--space-4); border-left: 3px solid var(--brand-deco); background: var(--surface-2); border-radius: 0 var(--r) var(--r) 0; color: var(--sub); }
.notice-body hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-6) 0; }
.notice-body img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r); }
.notice-body figure { display: grid; gap: var(--space-2); }
.notice-body figcaption { font-size: var(--text-sm); color: var(--sub); }
.notice-body table { width: 100%; border-collapse: collapse; font-size: var(--text-md); display: block; overflow-x: auto; }
.notice-body caption { text-align: left; font-weight: 700; padding-bottom: var(--space-2); }
.notice-body th, .notice-body td { padding: var(--space-2) var(--space-3); border: 1px solid var(--line); text-align: left; vertical-align: top; }
.notice-body th { background: var(--surface-2); font-weight: 700; }
.notice-body .ta-center { text-align: center; }
.notice-body .ta-right { text-align: right; }
.notice-body .ta-justify { text-align: justify; }
@media (min-width: 600px) {
  .notice-body table { display: table; }
}

/* ── 공지 꾸밈(사용자 결정 2026-10-04 — 미리 정한 class 만, 정화 목록 HTML_SANITIZE_NB_CLASSES 와 같은 이름). 토큰만 → 라이트·다크·C 전환에 따라 바뀐다.
   편집기(Jodit) 편집 영역에도 .notice-body 가 붙어 같은 모양으로 보인다(notice-editor-jodit.js editorClassName) ── */
.notice-body .nb-callout { --nb-bg: var(--surface-2); --nb-line: var(--line-strong); padding: var(--space-4) var(--space-5); border-left: 4px solid var(--nb-line); border-radius: 0 var(--r) var(--r) 0; background: var(--nb-bg); color: var(--ink); }
.notice-body .nb-callout > * + * { margin-top: var(--space-2); }
.notice-body .nb-callout--info  { --nb-bg: var(--st-sched-bg); --nb-line: var(--st-sched-fg); }
.notice-body .nb-callout--tip   { --nb-bg: var(--st-done-bg);  --nb-line: var(--st-done-fg); }
.notice-body .nb-callout--warn  { --nb-bg: var(--st-write-bg); --nb-line: var(--st-write-fg); }
.notice-body .nb-callout--brand { --nb-bg: var(--brand-soft);  --nb-line: var(--brand-text); border: 1px solid var(--brand-text); border-left-width: 4px; border-radius: var(--r); }   /* 팁(민트 면)과 갈리게 테두리를 두른다 */
.notice-body blockquote.nb-callout { color: var(--ink); margin-left: 0; margin-right: 0; }
.notice-body .nb-lead { font-size: var(--text-lg); line-height: var(--leading-normal); color: var(--ink); font-weight: 500; }
.notice-body .nb-muted { color: var(--sub); }
.notice-body p.nb-muted { font-size: var(--text-md); }
.notice-body ol.nb-steps { list-style: none; padding-left: 0; counter-reset: nb-step; display: grid; gap: var(--space-3); }
/* li 를 grid 로 두면 안의 글 조각(strong·글·a·em)이 각각 다른 칸이 되어 흩어진다(운영 버그 2026-10-04) — li 는 그대로 글 흐름, 칩만 왼쪽 여백에 띄운다 */
.notice-body ol.nb-steps > li { counter-increment: nb-step; position: relative; min-height: 28px; padding: 2px 0 0 calc(28px + var(--space-3)); }
.notice-body ol.nb-steps > li::before { content: counter(nb-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-full); background: var(--brand); color: var(--on-brand); font-size: var(--text-sm); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.notice-body a.nb-button { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h-md); padding: 0 var(--space-5); border-radius: var(--r); background: var(--brand); color: var(--on-brand); font-weight: 600; text-decoration: none; transition: filter .15s ease; }
.notice-body a.nb-button:hover { filter: brightness(1.08); }
.notice-body a.nb-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.notice-body figure.nb-hero { margin-left: 0; margin-right: 0; }
.notice-body figure.nb-hero img { width: 100%; border-radius: var(--r-lg); }
@media (prefers-reduced-motion: reduce) { .notice-body a.nb-button { transition: none; } }

/* ── 사용자 목록 ── */
.notice-search { max-width: 560px; }
.notice-rows, .notice-recent-list { list-style: none; margin: 0; padding: 0; }
.notice-rows { display: grid; overflow: hidden; }
.notice-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-1); padding: var(--space-4); min-height: var(--control-h-lg); color: var(--ink); text-decoration: none; }
.notice-rows > li + li .notice-row { border-top: 1px solid var(--line); }
.notice-row:hover { background: var(--surface-2); }
.notice-row:focus-visible { outline-offset: -2px; }
.notice-row-title { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-base); font-weight: 600; line-height: var(--leading-tight); }
.notice-row-title > span:last-child { overflow-wrap: anywhere; }
.notice-row-sum { font-size: var(--text-md); color: var(--sub); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.notice-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); font-size: var(--text-sm); color: var(--sub); }
.notice-meta > span { display: inline-flex; align-items: center; gap: var(--space-1); }
.notice-row.is-pinned { background: var(--brand-soft); }
.notice-row.is-pinned:hover { background: var(--surface-2); }
.notice-pin { display: inline-flex; align-items: center; color: var(--brand-text); flex: none; }
.notice-pin .ico-sm { margin-top: 2px; }
@media (min-width: 600px) {
  .notice-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-5); padding: var(--space-4) var(--space-5); }
  .notice-row-sum { grid-column: 1; }
  .notice-row .notice-meta { grid-column: 2; grid-row: 1 / span 2; justify-content: flex-end; }
}

/* ── 사용자 본문 ── */
.notice-article { display: grid; gap: var(--space-5); max-width: 760px; }
.notice-article-head { display: grid; gap: var(--space-2); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.notice-article-head h2 { font-size: var(--font-h2); line-height: var(--leading-tight); overflow-wrap: anywhere; text-wrap: balance; }
.notice-files { display: grid; gap: var(--space-2); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.notice-files h3 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-md); }
.notice-files .file-list a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-h-sm); overflow-wrap: anywhere; }
.notice-nav { display: grid; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.notice-nav a, .notice-nav > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); min-height: var(--control-h-lg); color: var(--ink); text-decoration: none; }
.notice-nav > * + * { border-top: 1px solid var(--line); }
.notice-nav a:hover { background: var(--surface-2); }
.notice-nav-label { font-size: var(--text-sm); color: var(--sub); white-space: nowrap; }
.notice-nav-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-md); }
.notice-nav > div { color: var(--sub); }
.notice-draft-note { justify-self: start; }

/* ── 최근 공지 카드(대시보드·고객센터) ── */
.notice-recent { padding: var(--space-4) var(--space-5); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); min-width: 0; }
.notice-recent .card-head h2 { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-base); }
.notice-recent .card-head .ico-sm { color: var(--brand-text); }
.notice-recent-list { display: grid; grid-template-columns: minmax(0, 1fr); }
.notice-recent-list > li { min-width: 0; }
.notice-recent-list a { display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-h-sm); padding: var(--space-1) 0; color: var(--ink); text-decoration: none; font-size: var(--text-md); }
.notice-recent-list a:hover .notice-recent-title { text-decoration: underline; text-underline-offset: 2px; }
.notice-recent-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-recent-list time { flex: none; }
.notice-recent-list .badge { flex: none; }

/* ── 관리자 목록 ── */
.notice-admin-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); align-items: end; }
.notice-admin-bar > .btn { justify-self: start; }
@media (min-width: 600px) {
  .notice-admin-bar { grid-template-columns: minmax(0, 1fr) auto; }
}
.notice-table .td-main .row-link { display: inline-flex; align-items: flex-start; gap: var(--space-1); }
.notice-files-count { display: inline-flex; align-items: center; gap: var(--space-1); margin-left: var(--space-2); }
.notice-show { font-size: var(--text-sm); color: var(--sub); white-space: nowrap; }
.notice-show s { color: var(--sub); }   /* 줄 그은 것만으로 「숨김」이 보인다 — 흐리게(opacity)까지 하면 3.3:1 로 미달(2026-10-05) */

/* 공지 본문은 읽고 쓰는 화면(body.content--narrow) — 본문 열 880 이 읽기 폭이라 안쪽 760 상자가 왼쪽에 붙지 않게 열을 채운다(DESIGN §15-2) */
body.content--narrow .notice-article { max-width: none; }
