/* =========================================================
   꾸민 글 모양 (.rich 안). rich-text.js 로 거른 HTML 을 그리는 곳.
   허용 목록: _도구\관리자화면\관리자화면_설정_순서.md 12절
   글꼴은 사이트 글꼴을 그대로 받음(둥근 글씨). 본문 18px, 크게 24px, 아주 크게 32px
   (관리자 편집기 숫자 18·24·32 와 맞춤).
   쪽 CSS(예: page-story.css .view-body p)가 더 자세히 정한 값이 있으면 그쪽이 먼저.
   ========================================================= */

/* ① ② ③ 번호 목록: 브라우저에 없는 이름이라 여기서 만듦 (12절) */
@counter-style circled-decimal {
  system: fixed;
  symbols: '①' '②' '③' '④' '⑤' '⑥' '⑦' '⑧' '⑨' '⑩' '⑪' '⑫' '⑬' '⑭' '⑮' '⑯' '⑰' '⑱' '⑲' '⑳';
  suffix: ' ';
  fallback: decimal;
}

.rich {
  color: #000;
  font-size: 18px;
  line-height: 32px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.rich p,
.rich h2,
.rich h3,
.rich li,
.rich blockquote { white-space: normal; }   /* 꾸민 글은 HTML 줄바꿈(<br>)만 씀 */

.rich p { margin: 0; padding: 0 0 27px; }
.rich p:empty { padding-bottom: 0; }

/* 제목: 관리자 편집기(css.html .rte__area h2·h3)와 같은 크기·굵기 → 쓴 대로 보이게 */
.rich h2 {
  margin: 10px 0 0;
  padding: 0 0 16px;
  font-size: 26px;
  line-height: 1.4;
  font-weight: 800;
  color: #000;
}
.rich h3 {
  margin: 8px 0 0;
  padding: 0 0 14px;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 800;
  color: #000;
}

.rich strong { font-weight: 700; }
.rich em { font-style: italic; }
.rich u { text-decoration: underline; text-underline-offset: 3px; }
.rich s { text-decoration: line-through; }

/* 글자 크기: 관리자 편집기 "크게"·"아주 크게" */
.rich span[style*="font-size:x-large"] { font-size: 24px !important; line-height: 1.5; }
.rich span[style*="font-size:xx-large"] { font-size: 32px !important; line-height: 1.4; }

/* 형광펜: 글자 뒤 바탕색. 줄이 바뀌어도 줄마다 바탕이 이어지게
   위 여백 .055em: 나눔스퀘어 네오 한글(받침 있는 글자)은 칠 안에서 아래가 약 .055em 더 비어 보여서 위를 그만큼 늘림.
   (11/26 재어 봄: 18·24·32px 모두 위아래 차 약 1.8px → 맞춘 뒤 0.8px 이내. 글자 위치·줄 간격은 안 바뀜) */
.rich span[style*="background-color"] {
  padding: .055em 2px 0;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* 링크: 사이트 파랑 + 밑줄(파랑 글자색과 헷갈리지 않게) */
.rich a {
  color: #0072a3;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.rich a:hover { color: var(--accent, #009fe3); }

/* 목록: 기본 ● · 1., 고르면 ○ ■ / 가. ① (style 의 list-style-type 이 정함) */
.rich ul,
.rich ol { margin: 0 0 27px; padding: 0 0 0 32px; }
.rich ul { list-style-type: disc; }
.rich ol { list-style-type: decimal; }
.rich ol[style*="hangul"] { padding-left: 40px; }
.rich ol[style*="circled-decimal"] { padding-left: 36px; }
.rich li { margin: 0; padding: 0 0 4px; }
.rich li::marker { color: #444; }
.rich li > ul,
.rich li > ol { margin: 4px 0 0; }

/* 인용: 관리자 편집기와 같은 모양(왼쪽 파란 줄 + 옅은 바탕) */
.rich blockquote {
  margin: 0 0 27px;
  padding: 10px 18px;
  border-left: 4px solid var(--accent, #009fe3);
  border-radius: 0 10px 10px 0;
  background: #f2f9fd;
}
.rich blockquote p:last-child { padding-bottom: 0; }

/* 가로줄 */
.rich hr {
  margin: 10px 0 37px;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, .12);
}

/* 사진: 글 폭을 넘지 않게(관리자 편집기처럼 왼쪽부터, 둥근 모서리) */
.rich img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 8px 0 27px;
  border-radius: 12px;
}
.rich p img { margin-bottom: 8px; }
.rich p[style*="text-align:center"] img { margin-left: auto; margin-right: auto; }
