/* ---------------------------------------------------------------------------------------------------------------------
   글 본문 공유 스타일 — 에디터(관리자 글쓰기)·미리보기·사용자 글 페이지가 **같은 파일**을 쓴다 (app-note note-editor-content 방식, 2026-09-02).
   · 기본 타이포(글자·행간·제목·목록)는 .post-content 스코프 — 글 본문(post__body)과 에디터(.tiptap.post-content)에만
   · 블록 컴포넌트(콜아웃·유튜브·북마크·파일·CTA·표·인용색·제목배경·체크리스트·형광펜)는 data-속성·class 기반이라 스코프 없이 —
     페이지 섹션(CUSTOM)에서도 같은 블록이 쓰이기 때문
   · 에디터 전용 UI(툴바·핸들·팝업)는 editor.css, 여기엔 두지 않는다. 사용자 페이지 그 밖의 스타일은 site.css
   --------------------------------------------------------------------------------------------------------------------- */

/* ── 기본 타이포 (app-note note-editor-content 이식: 16px · 1.7 · gray-800, 제목 스케일 1.55/1.3/1.15) ── */
/* 변수 계약 — 병원은 static/css/post-vars.css 에서 :root 변수만 덮어쓴다(사용자 페이지와 에디터가 같은 파일을 읽어 항상 일치) */
:root {
	--post-fs: 1rem;      --post-lh: 1.7;      --post-color: #1f2937;
	--post-h2-fs: 1.55em; --post-h2-mt: .9em;  --post-h3-fs: 1.3em; --post-h3-mt: .8em; --post-h4-fs: 1.15em; --post-h4-mt: .7em;
	--post-gap: .6em;
}
.post-content { font-size: var(--post-fs); line-height: var(--post-lh); color: var(--post-color); word-break: keep-all; overflow-wrap: anywhere; }
/* 문단 — 스킨/병원 CSS 의 전역 p 규칙(17px·1.9 등)이 본문을 덮지 않게, 본문 타이포는 .post-content 가 단일 권위 */
.post-content p { font-size: inherit; line-height: inherit; color: inherit; text-wrap: pretty; }
.post-content strong, .post-content b { color: #111827; font-weight: 700; }
/* 색상 span 안의 strong/mark/code 는 지정색을 우선 */
.post-content span[style*='color:'] strong, .post-content span[style*='color:'] b,
.post-content span[style*='color:'] mark, .post-content span[style*='color:'] code { color: inherit; }
/* 블록 간격 — 문단·제목·목록·표 등 모두 margin 0, 이웃 간격은 한 규칙으로 (app-note 와 동일) */
.post-content > * { margin-top: 0; margin-bottom: 0; }
.post-content > * + * { margin-top: var(--post-gap); }
.post-content h2 { font-size: var(--post-h2-fs); font-weight: 700; line-height: 1.3; margin-top: var(--post-h2-mt); }
.post-content h3 { font-size: var(--post-h3-fs); font-weight: 650; line-height: 1.35; margin-top: var(--post-h3-mt); }
.post-content h4 { font-size: var(--post-h4-fs); font-weight: 650; margin-top: var(--post-h4-mt); }
.post-content ul { list-style: disc; padding-left: 1.4em; }
.post-content ol { list-style: decimal; padding-left: 1.4em; }
.post-content li { margin: .2em 0; }
.post-content li > p { margin: 0; }
.post-content hr { border: 0; border-top: 1px solid #e5e7eb; margin: 1.2em 0; }
.post-content code { font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: .9em; background: #f3f4f6; border-radius: 4px; padding: .1em .35em; }
.post-content img { max-width: 100%; height: auto; }
.post-content a { color: var(--primary, #2b6cb0); }
/* 표 — 에디터(columnResizing)와 사용자 페이지 공통. 열 너비는 colwidth→style width(서버) / colgroup(에디터) */
.post-content table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.post-content th, .post-content td { border: 1px solid #d1d5db; padding: .5rem .75rem; min-width: 80px; position: relative; vertical-align: top; }
.post-content th { background: #f3f4f6; font-weight: 600; text-align: left; }
.post-content th p, .post-content td p { margin: 0; }
.post-content td p + p, .post-content th p + p { margin-top: .3em; }

/* ── 포스팅 본문 콜아웃 — 에디터(data-callout-type) 저장 HTML 표시용 (React 불필요) ── */
[data-type="callout"] {
	display: flex; gap: .75rem; align-items: flex-start;
	border-left: 3px solid transparent; border-radius: 6px; padding: 12px 16px; margin: 8px 0;
}
[data-type="callout"]::before { content: attr(data-callout-icon); }
[data-type="callout"]:not([data-callout-icon])[data-callout-type="default"]::before { content: "💬"; }
[data-type="callout"]:not([data-callout-icon])[data-callout-type="info"]::before    { content: "ℹ️"; }
[data-type="callout"]:not([data-callout-icon])[data-callout-type="note"]::before    { content: "📝"; }
[data-type="callout"]:not([data-callout-icon])[data-callout-type="success"]::before { content: "✅"; }
[data-type="callout"]:not([data-callout-icon])[data-callout-type="warning"]::before { content: "⚠️"; }
[data-type="callout"]:not([data-callout-icon])[data-callout-type="danger"]::before  { content: "🚨"; }
[data-type="callout"] > :last-child { margin-bottom: 0; }
[data-type="callout"][data-callout-type="default"] { background: #f7f7f5; border-left-color: #9ca3af; }
[data-type="callout"][data-callout-type="info"] { background: #e8f0fe; border-left-color: #3b82f6; }
[data-type="callout"][data-callout-type="note"] { background: #f3e8ff; border-left-color: #8b5cf6; }
[data-type="callout"][data-callout-type="success"] { background: #ecfdf5; border-left-color: #10b981; }
[data-type="callout"][data-callout-type="warning"] { background: #fffbeb; border-left-color: #f59e0b; }
[data-type="callout"][data-callout-type="danger"] { background: #fef2f2; border-left-color: #ef4444; }

/* ── 포스팅 본문 YouTube — 에디터 저장 마크업(yt-embed / yt-card / yt-inline)을 React 없이 렌더링 ── */
[data-type="youtube"] { margin: 1rem 0; }
.yt-embed { border: 1px solid #e2e8f0; border-radius: .6rem; overflow: hidden; background: #fff; }
.yt-embed-container { position: relative; aspect-ratio: 16/9; background: #000; }
.yt-embed-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-embed-info { display: flex; gap: .7rem; padding: .7rem .9rem; border-top: 1px solid #e2e8f0; }
.yt-embed-info::before { content: "▶"; color: #ef4444; font-size: .8rem; padding-top: .15rem; }
.yt-embed-info-right { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.yt-embed-info-title { font-weight: 600; font-size: .92rem; color: #0f172a; }
.yt-embed-info-desc { font-size: .82rem; color: #64748b; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-embed-info-meta { display: flex; gap: .5rem; font-size: .76rem; color: #94a3b8; min-width: 0; }
.yt-embed-info-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.yt-card {
	display: flex; gap: .8rem; align-items: stretch; text-decoration: none; color: inherit;
	border: 1px solid #e2e8f0; border-radius: .6rem; overflow: hidden; background: #fff;
}
a.yt-card:hover { background: #f8fafc; }
.yt-card-text { flex: 1; display: flex; flex-direction: column; gap: .2rem; padding: .8rem 1rem; min-width: 0; }
.yt-card-title { font-weight: 600; color: #0f172a; }
.yt-card-desc { font-size: .85rem; color: #64748b; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yt-card-url-row { margin-top: auto; font-size: .78rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yt-card-url-row::before { content: "▶ "; color: #ef4444; }
.yt-card-thumb { width: 180px; flex-shrink: 0; background: #f1f5f9; }
.yt-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.yt-inline {
	display: inline-flex; align-items: center; gap: .3rem; background: #fef2f2; border: 1px solid #fecaca; border-radius: 1rem;
	padding: 0 .6rem; font-size: .9em; text-decoration: none; color: #b91c1c; white-space: nowrap; max-width: 100%;
}
a.yt-inline::before { content: "▶"; font-size: .75em; }

/* ── 포스팅 본문 북마크 — bookmark-card / bookmark-inline (app-note 규격, 에디터·사용자 페이지 공용) ── */
[data-type="bookmark"] { margin: 1rem 0; }
a.bookmark-card, a.bookmark-card:hover { color: inherit; text-decoration: none; }
.bookmark-card { display: flex; align-items: stretch; border: 1px solid #e8e8e6; border-radius: 6px; overflow: hidden; background: #fff; }
.bookmark-card:hover { background: #f7f6f5; }
.bookmark-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 14px; }
.bookmark-card-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.4; color: #37352f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: 12px; line-height: 1.4; color: #787774; }
.bookmark-card-url { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #787774; min-width: 0; }
.bookmark-card-url span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-card-favicon { width: 16px; height: 16px; border-radius: 2px; flex-shrink: 0; }
.bookmark-card-image { width: 160px; flex-shrink: 0; background: #f1f5f9; }
.bookmark-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.bookmark-inline {
	display: inline-flex; align-items: center; gap: .3rem; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 1rem;
	padding: 0 .6rem; font-size: .9em; text-decoration: none; color: #1d4ed8; white-space: nowrap; max-width: 100%;
}
a.bookmark-inline::before { content: "🔗"; font-size: .8em; }
@media (max-width: 640px) {
	.bookmark-card-image { width: 96px; }
	.bookmark-card-desc { -webkit-line-clamp: 1; }
	a.yt-card { flex-direction: column-reverse; }
	.yt-card-thumb { width: 100%; aspect-ratio: 16/9; }
}

/* ── 포스팅 본문 이미지 (figure) ── */
figure[data-type="image"] { margin: 1.2rem auto; max-width: 100%; }
figure[data-type="image"][data-align="left"]  { margin-left: 0; }
figure[data-type="image"][data-align="right"] { margin-left: auto; margin-right: 0; }
/* height:auto — width/height 속성(CLS 방지용 비율 예약)이 표시 크기를 왜곡하지 않게 */
figure[data-type="image"] img { width: 100%; height: auto; border-radius: .35rem; display: block; }
figure[data-type="image"] img[data-rotate="90"]  { transform: rotate(90deg); }
figure[data-type="image"] img[data-rotate="180"] { transform: rotate(180deg); }
figure[data-type="image"] img[data-rotate="270"] { transform: rotate(270deg); }
figure[data-type="image"] img[data-flip="horizontal"] { transform: scaleX(-1); }
figure[data-type="image"] img[data-flip="vertical"]   { transform: scaleY(-1); }
figure[data-type="image"] img[data-flip="both"]       { transform: scale(-1, -1); }
figure[data-type="image"] figcaption { text-align: center; font-size: .88rem; color: #64748b; padding-top: .4rem; }

/* ── 포스팅 본문 첨부 파일 — file-block-card / file-inline ── */
[data-type="file-block"] { margin: 1rem 0; }
a.file-block-card {
	display: flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit;
	border: 1px solid #e2e8f0; border-radius: .6rem; padding: .7rem .9rem; background: #fff;
}
a.file-block-card:hover { background: #f8fafc; }
.file-block-card-icon { width: 40px; height: 40px; border-radius: .5rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; }
.file-block-card-icon::after { content: attr(data-category); text-transform: uppercase; }
.file-block-card-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.file-block-card-name { font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-block-card-desc { font-size: .85rem; color: #64748b; }
.file-block-card-meta { display: flex; gap: .5rem; font-size: .76rem; color: #94a3b8; }
a.file-inline {
	display: inline-flex; align-items: center; gap: .3rem; background: #f1f5f9; border: 1px solid #cbd5e0; border-radius: 1rem;
	padding: 0 .6rem; font-size: .9em; text-decoration: none; color: #334155; white-space: nowrap; max-width: 100%;
}
a.file-inline::before { content: "📎"; font-size: .8em; }


/* ---------------------------------------------------------------------------------------------------------------------
   프로그램 CTA 블록 — 에디터 미리보기와 사용자 페이지가 같은 클래스를 쓴다.
   (사용자 페이지용 복사본은 static/css/site.css 에 동일 내용이 들어간다 — 수정 시 양쪽을 함께 고친다)
   --------------------------------------------------------------------------------------------------------------------- */
.clinic-cta {
	display: block; margin: 1.6rem 0; border: 1px solid #e2e8f0; border-radius: 1rem;
	overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.clinic-cta__layout { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); }
.clinic-cta__visual { position: relative; margin: 0; background: #f1f5f9; min-height: 200px; }
.clinic-cta__visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clinic-cta__placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: #94a3b8; font-size: .9rem; }
.clinic-cta__chip {
	position: absolute; left: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .1rem;
	color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.55); font-size: .82rem;
}
.clinic-cta__chip span { font-weight: 700; }
.clinic-cta__content { padding: 1.6rem 1.8rem; display: flex; flex-direction: column; gap: .7rem; }
.clinic-cta__kicker { display: flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 700; color: #475569; }
.clinic-cta__kicker::before { content: ""; width: 1.6rem; height: 2px; background: #334155; display: inline-block; }
.clinic-cta__headline { font-size: 1.5rem; line-height: 1.35; margin: 0; font-weight: 800; color: #0f172a; }
.clinic-cta__body { margin: 0; color: #475569; font-size: .95rem; line-height: 1.7; }
.clinic-cta__benefits { list-style: none; margin: .3rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.clinic-cta__benefits li { display: flex; gap: .7rem; align-items: flex-start; }
.clinic-cta__num {
	flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #f1f5f9; color: #334155;
	display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700;
}
.clinic-cta__benefits strong { display: block; font-size: .93rem; color: #0f172a; }
.clinic-cta__benefits small { display: block; color: #64748b; font-size: .85rem; margin-top: .1rem; }
.clinic-cta__note {
	margin: .3rem 0 0; background: #f8fafc; border-radius: .5rem; padding: .7rem .9rem;
	color: #475569; font-size: .85rem; line-height: 1.6;
}
.clinic-cta__actions { display: flex; align-items: center; gap: 1.2rem; margin-top: .4rem; flex-wrap: wrap; }
.clinic-cta__primary {
	background: #0f172a; color: #fff; border-radius: 2rem; padding: .7rem 1.4rem;
	font-weight: 700; font-size: .92rem; text-decoration: none; display: inline-block;
}
.clinic-cta__primary::after { content: " ›"; }
.clinic-cta__secondary { color: #0f172a; font-weight: 600; font-size: .9rem; text-decoration: underline; }
.clinic-cta__price { margin: 0; color: #94a3b8; font-size: .82rem; }

@media (max-width: 720px) {
	.clinic-cta__layout { grid-template-columns: 1fr; }
	.clinic-cta__visual { min-height: 180px; }
	.clinic-cta__content { padding: 1.2rem; }
	.clinic-cta__headline { font-size: 1.28rem; }
}

/* 미리보기 배지 — /admin 글쓰기 미리보기에서만 노출된다 (사용자 페이지에는 이 요소가 없다) */
.preview-badge {
	margin: 0 0 1rem; padding: .55rem .9rem; border-radius: .5rem;
	background: #fef9c3; border: 1px solid #fde047; color: #713f12; font-size: .85rem;
}

/* 제목 폰트 - 폰트 관리의 "제목" 역할(비우면 본문 폰트 상속) */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading, inherit); }


/* ── 에디터 블록 색 프리셋 (app-note 이식 — 본문 HTML 의 data-* 를 여기서 색으로) ── */
/* 인용 기본 룩 — 좌측 선 + 연한 배경 (프리셋 data-quote-color / 자유색 data-quote-border·bg 가 덮어쓴다) */
blockquote { border-left: 3px solid #c2795a; background: #faf8f5; margin: 1rem 0; padding: .5em .9em; border-radius: 0 6px 6px 0; }
blockquote > p { margin: .3em 0; }
blockquote > p:first-child { margin-top: 0; }
blockquote > p:last-child { margin-bottom: 0; }
blockquote[data-quote-color] { padding: .5em .9em; border-radius: 0 6px 6px 0; }
blockquote[data-quote-color='gray']   { border-left-color: #9ca3af; background: #f4f4f5; }
blockquote[data-quote-color='blue']   { border-left-color: #3b82f6; background: #e8f0fe; }
blockquote[data-quote-color='purple'] { border-left-color: #8b5cf6; background: #f3e8ff; }
blockquote[data-quote-color='green']  { border-left-color: #10b981; background: #ecfdf5; }
blockquote[data-quote-color='amber']  { border-left-color: #f59e0b; background: #fffbeb; }
blockquote[data-quote-color='red']    { border-left-color: #ef4444; background: #fef2f2; }
:is(h2, h3, h4)[data-h-bg] { padding: .35em .5em; border-radius: 6px; }
:is(h2, h3, h4)[data-h-bg='gray']   { background: #f1f2f4; }
:is(h2, h3, h4)[data-h-bg='blue']   { background: #e8f0fe; }
:is(h2, h3, h4)[data-h-bg='purple'] { background: #f3e8ff; }
:is(h2, h3, h4)[data-h-bg='green']  { background: #ecfdf5; }
:is(h2, h3, h4)[data-h-bg='amber']  { background: #fffbeb; }
:is(h2, h3, h4)[data-h-bg='red']    { background: #fef2f2; }
ul[data-type='taskList'] { list-style: none; padding-left: .2em; }
ul[data-type='taskList'] li { display: flex; align-items: flex-start; gap: .5em; }
ul[data-type='taskList'] li > label { margin-top: .28em; }
ul[data-type='taskList'] li > div { flex: 1 1 auto; min-width: 0; }
ul[data-type='taskList'] li[data-checked='true'] > div { opacity: .55; text-decoration: line-through; }
ul[data-type='taskList'] input[type='checkbox'] { accent-color: var(--primary, #2563eb); pointer-events: none; }
mark { border-radius: 2px; padding: 0 1px; }

[data-type="callout"][data-callout-bg] { border-left-width: 3px; }

/* ── 포스팅 본문 테이블 (app-note 커스텀 테이블 저장 마크업 — JS 없이 렌더) ── */
table[data-type="table"] { border-collapse: collapse; }
table[data-alignment="center"] { margin-left: auto; margin-right: auto; }
table[data-alignment="right"] { margin-left: auto; }
table[data-caption]:not([data-caption=""])::after {
	content: attr(data-caption); display: table-caption; caption-side: bottom;
	padding-top: .4rem; text-align: center; font-size: .82rem; color: #94a3b8;
}
