/* ---------------------------------------------------------------------------------------------------------------------
   사용자 페이지 기본 스타일 — Phase 1 은 심플 시맨틱 HTML, 디자인은 추후 병원별 오버라이드로 입힌다.
   병원 전용 CSS 는 hospitals/<병원코드>/static/css/site.css 로 이 파일을 대체한다.
   --------------------------------------------------------------------------------------------------------------------- */
:root {
	--primary: #2b6cb0;
}

body {
	margin: 0 auto;
	max-width: 60rem;
	padding: 0 1rem;
	font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
	line-height: 1.6;
	color: #1a202c;
}

header nav ul, footer ul {
	list-style: none;
	padding: 0;
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
}

a { color: var(--primary); }

table { border-collapse: collapse; }
th, td { border: 1px solid #cbd5e0; padding: .4rem .8rem; }

form label { display: block; font-weight: 600; }
input, textarea { width: 100%; max-width: 30rem; padding: .4rem; }
button { padding: .5rem 1.5rem; cursor: pointer; }

.error { color: #c53030; }

/* ── 게시판 웹진형 ─────────────────────────────────────────────────────────── */
.webzine-list { display: flex; flex-direction: column; gap: 2rem; }
.webzine-card img { width: 100%; max-height: 320px; object-fit: cover; border-radius: .4rem; }
.webzine-card a { text-decoration: none; color: inherit; }
.webzine-card h2 { margin: .5rem 0 .3rem; }

/* ── 게시판 갤러리형 ───────────────────────────────────────────────────────── */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gallery-item { display: block; text-decoration: none; color: inherit; }
.gallery-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: .4rem; background: #edf2f7; }
.gallery-item__title { display: block; margin-top: .4rem; font-weight: 600; }

/* ── 포스팅 본문 콜아웃 — 에디터(data-callout-type) 저장 HTML 표시용 (React 불필요) ── */
[data-type="callout"] {
	display: flex; gap: .6rem; align-items: flex-start;
	border: 1px solid; border-radius: .4rem; padding: .7rem .9rem; margin: .8rem 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: #f8fafc; border-color: #cbd5e0; }
[data-type="callout"][data-callout-type="info"]    { background: #eff6ff; border-color: #93c5fd; }
[data-type="callout"][data-callout-type="note"]    { background: #faf5ff; border-color: #d8b4fe; }
[data-type="callout"][data-callout-type="success"] { background: #ecfdf5; border-color: #6ee7b7; }
[data-type="callout"][data-callout-type="warning"] { background: #fffbeb; border-color: #fcd34d; }
[data-type="callout"][data-callout-type="danger"]  { background: #fef2f2; border-color: #fca5a5; }

/* ── 포스팅 본문 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 ── */
[data-type="bookmark"] { margin: 1rem 0; }
a.bookmark-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.bookmark-card:hover { background: #f8fafc; }
.bookmark-card-text { flex: 1; display: flex; flex-direction: column; gap: .2rem; padding: .8rem 1rem; min-width: 0; }
.bookmark-card-title { font-weight: 600; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-card-desc { font-size: .85rem; color: #64748b; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bookmark-card-url { margin-top: auto; display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: #94a3b8; }
.bookmark-card-favicon { width: 16px; height: 16px; border-radius: 3px; }
.bookmark-card-image { width: 180px; 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) {
	a.yt-card, a.bookmark-card { flex-direction: column-reverse; }
	.yt-card-thumb, .bookmark-card-image { 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; }
figure[data-type="image"] img { width: 100%; 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; }

/* ── 글 작성자 배지 ── */
.post-author { display: flex; align-items: center; gap: .6rem; margin: .6rem 0 1.2rem; }
.post-author img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.post-author span { display: flex; flex-direction: column; }
.post-author small { color: #64748b; font-size: .82rem; }
/* ---------------------------------------------------------------------------------------------------------------------
   프로그램 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;
}
