/* ==========================================================================
   글 본문 꾸미기 — 사이트 글(.post-body.rich)과 글쓰기 화면(.doc.rich)이 같이 쓴다.

   정렬 · 글자 색 · 형광펜 · 글꼴 · 사진 설명 · 사진 나란히/슬라이드 · 동영상 ·
   링크 카드 · 스티커. 원고 문법은 assets/postmd.js 맨 위에 있다.
   한 파일을 같이 쓰므로 글쓰기 화면에서 보이는 모양이 곧 사이트 모양이다. (CLAUDE.md §11)
   ========================================================================== */

/* ----- 글꼴 — 네이버 '한글한글 아름답게' 무료 글꼴 (OFL) ------------------- */
/* @font-face 는 선언만으로는 내려받지 않는다. 글에서 그 글꼴을 실제로 쓸 때만 받는다. */

@font-face { font-family: 'MD MaruBuri'; font-weight: 400; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.woff2) format('woff2'); }
@font-face { font-family: 'MD MaruBuri'; font-weight: 700; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Bold.woff2) format('woff2'); }
@font-face { font-family: 'MD NanumMyeongjo'; font-weight: 400; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumMyeongjo/NanumMyeongjo.woff) format('woff'); }
@font-face { font-family: 'MD NanumMyeongjo'; font-weight: 700; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumMyeongjo/NanumMyeongjoBold.woff) format('woff'); }
@font-face { font-family: 'MD NanumGothic'; font-weight: 400; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumGothic/NanumGothic.woff) format('woff'); }
@font-face { font-family: 'MD NanumSquare'; font-weight: 400; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquare/NanumSquareR.woff) format('woff'); }
@font-face { font-family: 'MD NanumSquare'; font-weight: 700; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquare/NanumSquareB.woff) format('woff'); }
@font-face { font-family: 'MD NanumSquareRound'; font-weight: 400; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareRound/NanumSquareRoundR.woff2) format('woff2'); }
@font-face { font-family: 'MD NanumSquareRound'; font-weight: 700; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumSquareRound/NanumSquareRoundB.woff2) format('woff2'); }
@font-face { font-family: 'MD NanumPen'; font-weight: 400; font-display: swap;
  src: url(https://hangeul.pstatic.net/hangeul_static/webfont/NanumBrush/NanumPen.woff) format('woff'); }

.rich .ff-maruburi { font-family: 'MD MaruBuri', serif; }
.rich .ff-myeongjo { font-family: 'MD NanumMyeongjo', serif; }
.rich .ff-gothic   { font-family: 'MD NanumGothic', sans-serif; }
.rich .ff-square   { font-family: 'MD NanumSquare', sans-serif; }
.rich .ff-round    { font-family: 'MD NanumSquareRound', sans-serif; }
.rich .ff-pen      { font-family: 'MD NanumPen', cursive; font-size: 1.3em; }

/* ----- 정렬 -------------------------------------------------------------- */

.rich .al-center { text-align: center; }
.rich .al-right  { text-align: right; }
.rich .al-center ul, .rich .al-center ol,
.rich .al-right ul, .rich .al-right ol { list-style-position: inside; padding-left: 0; }

/* ----- 글자 색 · 형광펜 — 값은 assets/postmd.js 의 COLORS · HIGHLIGHTS 와 같다 ----- */

.rich .tc-red    { color: #ff0010; }
.rich .tc-orange { color: #ef7d33; }
.rich .tc-gold   { color: #b8862e; }
.rich .tc-green  { color: #1d8a45; }
.rich .tc-blue   { color: #004aad; }
.rich .tc-navy   { color: #0b1624; }
.rich .tc-gray   { color: #8a95a5; }
/* 색을 입힌 글자 안의 굵은 글씨는 그 색을 따른다. (예전에는 'strong 안의 색 글자'까지 inherit 로 덮어
   <strong><span class="tc-red"> 이 사이트에서 검정으로 나왔다. 2026-10-13) */
.rich [class*="tc-"] strong { color: inherit; }

.rich [class*="hl-"] { padding: 0 .12em; border-radius: 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rich .hl-yellow { background: #fff8b2; }
.rich .hl-green  { background: #dcf5cf; }
.rich .hl-blue   { background: #d8e8ff; }
.rich .hl-pink   { background: #ffdde4; }
.rich .hl-gray   { background: #e9edf2; }

/* ----- 사진 설명(캡션) ---------------------------------------------------- */

.rich .fig { margin: 28px 0; text-align: center; }
.rich .fig img { margin: 0 auto; }
.rich .fig figcaption,
.rich .img-cap {
  display: block;
  margin-top: 10px;
  font-size: .86em;
  line-height: 1.6;
  color: #8a95a5;
  text-align: center;
  word-break: keep-all;
}

/* ----- 스티커 — 문단 정렬을 따라간다 ---------------------------------------- */

.rich img.sticker {
  display: inline-block;
  width: 120px;
  max-width: 40%;
  min-width: 0;
  height: auto;
  margin: 6px 0;
  border-radius: 0;
  vertical-align: middle;
}

/* ----- 사진 나란히 · 슬라이드 ------------------------------------------------ */

.rich .gal { margin: 28px 0; }
.rich .gal img { display: block; width: 100%; height: auto; margin: 0; border-radius: 4px; min-width: 0; }
.rich .gal figcaption { margin-top: 10px; font-size: .86em; line-height: 1.6; color: #8a95a5; text-align: center; word-break: keep-all; }

/* 나란히 — 2장은 반반, 4장은 2×2, 나머지는 한 줄에 3장 */
.rich .gal-row .gal-in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; align-items: start; }
.rich .gal-row[data-n="1"] .gal-in { grid-template-columns: minmax(0, 1fr); }
.rich .gal-row[data-n="2"] .gal-in,
.rich .gal-row[data-n="4"] .gal-in { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* 슬라이드 — 손가락으로 밀거나 화살표로 넘긴다 (화살표 동작은 assets/post.js) */
.rich .gal-stage { position: relative; }
.rich .gal-slide .gal-in {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  border-radius: 4px;
  background: #f4f5f7;
}
.rich .gal-slide .gal-in::-webkit-scrollbar { display: none; }
.rich .gal-slide .gal-item {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rich .gal-slide .gal-item img { width: auto; max-width: 100%; max-height: min(72vh, 640px); border-radius: 0; }
.rich .gal-nav {
  position: absolute;
  top: 50%;
  width: 40px; height: 40px;
  margin-top: -20px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 22, 36, .55);
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.rich .gal-nav:hover { background: rgba(11, 22, 36, .8); }
.rich .gal-nav[disabled] { opacity: 0; pointer-events: none; }
.rich .gal-nav::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  border: solid #fff;
  border-width: 2px 2px 0 0;
}
.rich .gal-prev { left: 10px; }
.rich .gal-next { right: 10px; }
.rich .gal-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.rich .gal-next::before { transform: translate(-70%, -50%) rotate(45deg); }
.rich .gal-count {
  position: absolute;
  top: 10px; right: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(11, 22, 36, .55);
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: .02em;
}
.rich .gal-count b { color: #fff; font-weight: 700; }
@media (hover: none) {
  .rich .gal-nav { width: 46px; height: 46px; margin-top: -23px; }   /* 터치 영역 46px (CLAUDE.md §5) */
}

/* ----- 동영상 ------------------------------------------------------------- */

.rich .vid {
  position: relative;
  margin: 28px 0;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}
.rich .vid iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rich .vid-v { aspect-ratio: 9 / 16; max-width: 340px; margin-left: auto; margin-right: auto; }

/* ----- 링크 카드 ----------------------------------------------------------- */

.rich a.ogc {
  display: flex;
  align-items: stretch;
  max-width: 520px;
  margin: 26px auto;
  border: 1px solid #e3e7ec;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  color: #131c28;
  text-align: left;
  text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.rich a.ogc:hover { color: #131c28; border-color: #c9d1db; box-shadow: 0 4px 14px rgba(11, 22, 36, .08); }
.rich .ogc-img { flex: 0 0 128px; background: #f4f5f7; }
.rich .ogc-img img { display: block; width: 100%; height: 100%; min-height: 104px; object-fit: cover; margin: 0; border-radius: 0; }
.rich .ogc-body { flex: 1 1 auto; min-width: 0; padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.rich .ogc-title {
  font-size: 15px; font-weight: 700; line-height: 1.45; letter-spacing: -.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rich .ogc-desc {
  font-size: 13px; line-height: 1.55; color: #8a95a5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rich .ogc-host { font-size: 12.5px; line-height: 1.5; color: #1d8a45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .rich .ogc-img { flex-basis: 96px; }
  .rich .ogc-body { padding: 12px 14px; }
  .rich .ogc-title { font-size: 14px; }
  .rich .ogc-desc { -webkit-line-clamp: 1; }
}

/* ==========================================================================
   네이버 블로그 본문 결 (2026-10-17 대표 요청)
   기준 글: blog.naver.com/moby2023/224247830461
   - 본문은 한 크기(16px)로 담백하게. 강조는 크기가 아니라 색 · 굵게 · 형광펜 · 밑줄로
   - 한 문장(또는 두세 줄)씩 끊고 문단 사이를 넉넉히 띄운다
   - 말풍선 인용구 = 굵은 회색 테두리 + 나눔명조 / 포스트잇 = 회색 상자 + 위아래 선
   blog.css · admin.css 의 같은 선택자보다 우선하도록 .rich 를 겹쳐 쓴다.
   ========================================================================== */

.rich.post-body, .rich.doc {
  font-size: 16px;
  line-height: 1.85;
  color: #111;
  letter-spacing: -.01em;
}
.rich.post-body p, .rich.doc p { margin: 0 0 30px; }
.rich.post-body img, .rich.doc img { border-radius: 0; }
.rich.post-body .fig, .rich.doc .fig { margin: 44px 0; }
.rich .fig figcaption, .rich .img-cap { font-size: 13px; color: #777; margin-top: 12px; }

/* 밑줄 */
.rich .u-line, .rich u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* ----- 말풍선 — 굵은 회색 테두리 + 아래 왼쪽 꼬리, 나눔명조 ----- */
.rich .q.q-bubble {
  position: relative;
  max-width: 460px;
  margin: 50px auto 76px;
  padding: 22px 24px 26px;
  border: 4px solid #e3e3e3;
  border-radius: 0;
  background: #fff;
  text-align: center;
  font-family: 'MD NanumMyeongjo', 'Nanum Myeongjo', serif;
  font-size: 19px;
  font-weight: 700;
  color: #111;
  letter-spacing: -.02em;
}
.rich .q.q-bubble p { line-height: 1.8; word-break: keep-all; }
/* 아래 테두리를 조금 끊고(::after) 그 자리에서 왼쪽 아래로 꼬리(::before) */
.rich .q.q-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 30%;
  width: 36px;
  height: 4px;
  margin-top: 0;
  border: 0;
  background: #fff;
}
.rich .q.q-bubble::before {
  content: '';
  position: absolute;
  top: 100%;
  left: calc(30% + 32px);
  width: 4px;
  height: 34px;
  border: 0;
  background: #e3e3e3;
  transform-origin: top left;
  transform: skewX(-45deg);
}
@media (max-width: 480px) {
  .rich .q.q-bubble { font-size: 17px; padding: 18px 16px 22px; }
}

/* ----- 포스트잇 — 회색 상자 + 위아래 선 (네이버 표 상자 모양) ----- */
.rich .q.q-postit {
  margin: 40px 0;
  padding: 20px 18px;
  border-radius: 0;
  border-top: 1px solid #8c8c8c;
  border-bottom: 1px solid #8c8c8c;
  background: #f7f7f7;
  color: #111;
  text-align: left;
}
.rich .q.q-postit::after { content: none; }
.rich .q.q-postit p { line-height: 1.85; word-break: normal; }

/* ----- 라인따옴표 — 위아래 선 + 나눔명조 ----- */
.rich .q.q-lineq {
  margin: 44px 0;
  border-top: 1px solid #555;
  border-bottom: 1px solid #555;
  font-family: 'MD NanumMyeongjo', 'Nanum Myeongjo', serif;
  font-weight: 700;
  font-size: 17px;
}
