@import url("https://fonts.googleapis.com/css2?family=Nanum+Gothic:wght@400;700&family=Nanum+Myeongjo:wght@400;700&family=Noto+Sans+KR:wght@400;700&family=Noto+Serif+KR:wght@400;700&display=swap");
/* ↑ 에디터 글꼴 목록의 한국어 웹 글꼴(본고딕·본명조·나눔고딕·나눔명조) — 본문에 고른 글꼴이 공개 화면에서도 같게 보이도록 [사용자 2026-11-17].
   영어 글꼴(Arial 등)은 기기 기본 글꼴이라 받지 않는다. 사이트가 글꼴을 따로 받으면 이 줄을 지운 사본을 쓴다. */
/* 게시판 본문 블록 모양 — 인용구 6종·출처·코드 블록 언어 표시·이미지 가운데 [사용자 2026-11-17].
 *
 * 편집 화면(.note-editable)과 공개 화면(.board-content)이 같은 파일을 쓴다 — 고른 모양이 그대로 보인다.
 *   - 템플릿형 사이트: common_site/base_public.html 이 이 파일을 넣는다(사이트가 덮어썼다면 <link> 한 줄 추가).
 *   - 별도 프론트(Next.js): 이 파일을 프론트로 복사하고 본문을 감싸는 요소에 class="board-content" 를 단다.
 * 저장되는 HTML 은 의미 태그 그대로다: <blockquote class="quote-…"> + <cite>(출처), <pre data-lang="…">.
 * 모양 class 가 없는 인용구는 세로선형과 같게 보인다(이전 글).
 */

/* ── 인용구 공통 ── */
:is(.board-content, .note-editable) blockquote {
  position: relative;
  margin: 1.25em 0;
  padding: .75em 1.25em;
  border: 0;
  border-left: 4px solid #374151;
  background: transparent;
  color: #1f2937;
  border-radius: 0;
  font-style: normal;
}
:is(.board-content, .note-editable) blockquote > :last-child { margin-bottom: 0; }
:is(.board-content, .note-editable) blockquote cite {
  display: block;
  margin-top: .6em;
  font-size: .875em;
  font-style: normal;
  color: #6b7280;
}
/* 편집 화면에서만: 빈 출처 칸 안내(저장할 때 빈 출처는 빠진다) */
.note-editable blockquote cite:empty::before,
.note-editable blockquote cite:has(> br:only-child)::before { content: "출처 입력"; color: #9ca3af; }

/* 1) 따옴표형 — 가운데, 위아래 큰 따옴표 */
:is(.board-content, .note-editable) blockquote.quote-marks {
  border: 0; text-align: center; padding: 2.75em 1.5em; font-size: 1.125em; line-height: 1.7;
}
:is(.board-content, .note-editable) blockquote.quote-marks::before,
:is(.board-content, .note-editable) blockquote.quote-marks::after {
  position: absolute; left: 50%; transform: translateX(-50%);
  font: 700 3em/1 Georgia, "Times New Roman", serif; color: #c4c4c4;
}
:is(.board-content, .note-editable) blockquote.quote-marks::before { content: "\201C"; top: .15em; }
:is(.board-content, .note-editable) blockquote.quote-marks::after { content: "\201D"; bottom: -.25em; }
:is(.board-content, .note-editable) blockquote.quote-marks cite { font-size: .8em; }

/* 2) 세로선형 — 왼쪽 굵은 선(기본) */
:is(.board-content, .note-editable) blockquote.quote-line { border-left: 4px solid #374151; }

/* 말풍선·메모지·괄호 — 가운데 놓인 작은 상자, 모양마다 알맞은 폭·높이 [사용자 2026-11-17]
   (편집 화면의 선택 테두리는 본문 폭 그대로 — block_tools.js) */
:is(.board-content, .note-editable) blockquote:is(.quote-bubble, .quote-note, .quote-bracket) {
  margin-left: auto; margin-right: auto; text-align: center; box-sizing: border-box;
}

/* 3) 말풍선형 — 굵은(6px) 옅은 직각 테두리 + 아래 꼬리. 좁고 높은 말풍선 [사용자 2026-11-17] */
:is(.board-content, .note-editable) blockquote.quote-bubble {
  width: 54%; padding: 2.4em 2em; border: 6px solid #cbd5e1; border-radius: 0; margin-bottom: 2.4em; background: #fff;
}
:is(.board-content, .note-editable) blockquote.quote-bubble::after {
  content: ""; position: absolute; left: 2.25em; bottom: -17px; width: 24px; height: 24px;
  background: #fff; border-right: 6px solid #cbd5e1; border-bottom: 6px solid #cbd5e1; transform: rotate(45deg);
}

/* 4) 밑줄 따옴표형 — 왼쪽 위 따옴표 + 아래 밑줄, 옅은 색 [사용자 2026-11-17] */
:is(.board-content, .note-editable) blockquote.quote-underline {
  border: 0; border-bottom: 2px solid #cbd5e1; padding: 2.4em .25em .9em;
}
:is(.board-content, .note-editable) blockquote.quote-underline::before {
  content: "\201C"; position: absolute; left: 0; top: .05em; font: 700 2.6em/1 Georgia, "Times New Roman", serif; color: #cbd5e1;
}

/* 5) 메모지형 — 연한 노란 바탕 + 접힌 모서리. 정사각에 가까운 쪽지 */
:is(.board-content, .note-editable) blockquote.quote-note {
  width: 46%; min-height: 11em; padding: 2em 1.8em; display: flex; flex-direction: column; justify-content: center;
  border: 1px solid #e5e7eb; background: #fffbea; box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
:is(.board-content, .note-editable) blockquote.quote-note::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 22px; height: 22px;
  background: linear-gradient(135deg, #f3e8b6 50%, #fff 50%); border-top: 1px solid #e5e7eb; border-left: 1px solid #e5e7eb;
}

/* 6) 괄호형 — 왼쪽 위 「, 오른쪽 아래 」 */
:is(.board-content, .note-editable) blockquote.quote-bracket { width: 62%; padding: 2.2em 2.6em; border: 0; }  /* 괄호 안 한 문장 */
:is(.board-content, .note-editable) blockquote.quote-bracket::before,
:is(.board-content, .note-editable) blockquote.quote-bracket::after {   /* 크고 굵은 「 」 [사용자 2026-11-17] */
  content: ""; position: absolute; width: 28px; height: 28px; border-color: #374151; border-style: solid;
}
:is(.board-content, .note-editable) blockquote.quote-bracket::before { left: 0; top: 0; border-width: 4px 0 0 4px; }
:is(.board-content, .note-editable) blockquote.quote-bracket::after { right: 0; bottom: 0; border-width: 0 4px 4px 0; }

@media (max-width: 640px) {   /* 좁은 화면은 가득 */
  :is(.board-content, .note-editable) blockquote:is(.quote-bubble, .quote-note, .quote-bracket) { width: 100%; min-height: 0; padding: 1.4em 1.2em; }
}

/* ── 코드 블록: 오른쪽 위 언어 표시 ── */
:is(.board-content, .note-editable) pre {
  position: relative;
  background: #1f2937; color: #f9fafb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875rem; line-height: 1.6;
  padding: .9em 1.1em; border-radius: .375rem; white-space: pre-wrap; overflow-x: auto; margin: 1em 0;
}
:is(.board-content, .note-editable) pre[data-lang] { padding-top: 2em; }
:is(.board-content, .note-editable) pre[data-lang]::before {
  content: attr(data-lang); position: absolute; top: .45em; right: .8em;
  font: 600 .7rem/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .03em; color: #9ca3af; text-transform: uppercase;
}

/* ── 이미지 위아래 여백 [사용자 2026-11-17] ── */
:is(.board-content, .note-editable) img { margin-top: .75em; margin-bottom: .75em; }

/* ── 이미지 정렬(인라인 style 로도 저장되지만 class 로 한 번 더) ──
   줄 정렬(한글 '자리 차지'): 이미지 혼자 한 줄. 내부 정렬(한글 '어울림'): 글이 이미지 옆으로 이어진다 */
:is(.board-content, .note-editable) img.img-left { display: block; margin-left: 0; margin-right: auto; float: none; }
:is(.board-content, .note-editable) img.img-center { display: block; margin-left: auto; margin-right: auto; float: none; }
:is(.board-content, .note-editable) img.img-right { display: block; margin-left: auto; margin-right: 0; float: none; }
:is(.board-content, .note-editable) img.img-full { display: block; width: 100%; height: auto; margin-left: 0; margin-right: 0; float: none; }
:is(.board-content, .note-editable) img.note-float-left { margin: .25em 1em .5em 0; }
:is(.board-content, .note-editable) img.note-float-right { margin: .25em 0 .5em 1em; }

/* ── 사진 설명(alt)을 캡션으로 [사용자 2026-11-17] ──
   편집 화면: 본문 HTML 은 <img alt> 그대로, 에디터가 아래에 겹쳐 그린다 — 그 자리를 비워 둔다.
   공개 화면: 템플릿 필터 board_captions 가 <span class="board-figure …"><img><span class="board-caption">설명</span></span> 로 감싼다.
   정렬 class(img-left·img-center·img-right·img-full·note-float-left·note-float-right)는 감싸는 쪽으로 옮겨 온다. */
.note-editable img[alt]:not([alt=""]) { margin-bottom: 2.4em; }
.note-editable img.board-img-editing { margin-bottom: 3em; }   /* 설명 칸(32px)이 열린 동안 */
.board-content .board-figure { display: inline-table; max-width: 100%; margin: .75em 0; vertical-align: top; }
.board-content .board-figure > img { display: block; margin: 0 !important; float: none !important; max-width: 100%; }
.board-content .board-figure > .board-caption { display: table-caption; caption-side: bottom; padding-top: .45em; text-align: center; font-size: .875em; color: #6b7280; }
.board-content .board-figure.img-left { display: table; margin-left: 0; margin-right: auto; }
.board-content .board-figure.img-center { display: table; margin-left: auto; margin-right: auto; }
.board-content .board-figure.img-right { display: table; margin-left: auto; margin-right: 0; }
.board-content .board-figure.img-full { display: table; width: 100%; }
.board-content .board-figure.img-full > img { width: 100% !important; }
.board-content .board-figure.note-float-left { float: left; margin: .25em 1em .5em 0; }
.board-content .board-figure.note-float-right { float: right; margin: .25em 0 .5em 1em; }

/* ── 사진 캐러셀 — 치료사례 상세(공개·관리 화면) [사용자 2026-11-17] ──
   한 장씩, 폭 가득·사진은 제 비율대로(자르지 않음) — 높이는 지금 사진에 맞춰 바뀐다(JS) [사용자 2026-11-17].
   너무 긴 세로 사진은 화면 높이 80% 까지. 마크업: boards/_carousel.html */
.board-carousel { position: relative; margin: 0 0 1.5em; }
.board-carousel-track {
  display: flex; align-items: flex-start; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  border-radius: .5rem; background: #f3f4f6; scrollbar-width: none; outline: none; transition: height .25s ease;
}
.board-carousel-track::-webkit-scrollbar { display: none; }
.board-carousel-track:focus-visible { box-shadow: 0 0 0 3px #93c5fd; }
.board-carousel-slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; position: relative; display: flex; justify-content: center; }
.board-carousel-slide img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; margin: 0; }
.board-carousel-slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .6em 1em; text-align: center;
  font-size: .875em; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.board-carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 2.5rem; height: 2.5rem; border-radius: 9999px; border: 0;
  background: rgba(255, 255, 255, .9); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); font-size: 1.75rem; line-height: 1; color: #111827; cursor: pointer;
}
.board-carousel-nav:disabled { opacity: .35; cursor: default; }
.board-carousel-prev { left: .75rem; }
.board-carousel-next { right: .75rem; }
.board-carousel-count {
  position: absolute; top: .75rem; right: .75rem; padding: .15em .6em; border-radius: 9999px;
  background: rgba(17, 24, 39, .7); color: #fff; font-size: .75rem;
}
.board-carousel-dots { display: flex; justify-content: center; gap: .4rem; margin-top: .6rem; }
.board-carousel-dots button { width: .5rem; height: .5rem; padding: 0; border: 0; border-radius: 9999px; background: #d1d5db; cursor: pointer; }
.board-carousel-dots button[aria-current="true"] { background: #111827; width: 1.25rem; }

/* 캐러셀 아래 사진 목록(갤러리 상세) — 누르면 그 사진으로, 지금 사진은 테두리 */
.board-carousel-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; margin: .75rem 0 1.5rem; padding: 0; list-style: none; }
.board-carousel-thumbs button { position: relative; display: block; width: 100%; padding: 0; border: 2px solid transparent; border-radius: .375rem; overflow: hidden; background: #f3f4f6; cursor: pointer; }
.board-carousel-thumbs button[aria-current="true"] { border-color: #111827; }
.board-carousel-thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; margin: 0; }
.board-carousel-thumbs span { position: absolute; left: 0; right: 0; bottom: 0; padding: .15em .3em; font-size: .7rem; color: #fff; background: rgba(17, 24, 39, .6); text-align: center; }

/* ── 전후사진 대표 미리보기 — 등록 화면에서 저장 전에만 [사용자 2026-11-17] ──
   저장하면 서버가 같은 배치로 한 장을 만든다(boards/cover.py: 위 띠 = 제목 한 줄, 아래 띠 = 전·후 표시, 가운데 흰 선).
   목록·상세·API 는 그 파일을 쓴다. 마크업: gallery_form.html 의 drawPreview */
.board-pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; overflow: hidden; background: #fff; aspect-ratio: 4 / 3; }
.board-pair > img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; margin: 0; }
.board-pair-title, .board-pair-cap { position: absolute; left: 0; right: 0; color: #fff; font-weight: 600; line-height: 1.2; text-align: center; pointer-events: none; background: rgba(17, 24, 39, .59); }
.board-pair-title { top: 0; padding: .55em .8em; font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-pair-cap { bottom: 0; display: grid; grid-template-columns: 1fr 1fr; font-size: .8em; }
.board-pair-cap > span { padding: .5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
