/*
 * 기사 본문(에디터 산출물) 스타일.
 *
 * ⚠ src/styles/articleContent.css 와 내용이 같아야 한다.
 *   그쪽은 React 경로(media-components.css 배럴)가, 이 파일은 Liquid 전용 렌더
 *   경로(renderLiquidPage)가 <link> 로 싣는다. 수정 시 양쪽을 함께 바꿀 것.
 *   React 경로가 은퇴하면 그쪽을 지우고 이 파일만 남긴다.
 */
/* ==========================================================================
   기사 본문 렌더링 전용 CSS
   - articleView, boardPostView 등 본문 콘텐츠가 표시되는 페이지에서만 import
   - 에디터(admin) 전용 스타일은 src/app/globals.css에 유지
   ========================================================================== */

/* --------------------------------------------------------------------------
   ProseMirror 렌더링 (프론트 기사 본문용)
   .article-content.ProseMirror 클래스로 렌더링됨
   -------------------------------------------------------------------------- */

.article-content.ProseMirror {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--foreground);
}

.article-content.ProseMirror > * + * {
  margin-top: 1em;
}

.article-content.ProseMirror p.align-left { text-align: left; }
.article-content.ProseMirror p.align-center { text-align: center; }
.article-content.ProseMirror p.align-right { text-align: right; }

.article-content.ProseMirror ul,
.article-content.ProseMirror ol {
  padding: 0 0 0 24px;
  margin: 1em 0;
  position: relative;
}

.article-content.ProseMirror h1,
.article-content.ProseMirror h2 {
  font-size: 1.3em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.4em;
  color: var(--foreground);
}

.article-content.ProseMirror h3 {
  font-size: 1.3em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.4em;
  color: var(--foreground);
}

.article-content.ProseMirror h4 {
  font-size: 1.1em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.4em;
  color: var(--foreground);
}

.article-content.ProseMirror h5 {
  font-size: 1em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.4em;
  color: var(--foreground);
}

.article-content.ProseMirror h6 {
  font-size: 0.9em;
  font-weight: 600;
  margin-top: 1em;
  margin-bottom: 0.4em;
  color: var(--foreground);
}

.article-content.ProseMirror p {
  margin-bottom: 32px;
  line-height: 1.8;
}

.article-content.ProseMirror p + p {
  margin-top: 0 !important;
}

.article-content.ProseMirror figure {
  margin: 50px 0;
}

.article-content.ProseMirror img {
  max-width: 100%;
  height: auto;
}

article iframe {
  max-width: 100%;
}

.article-content.ProseMirror a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content.ProseMirror a:hover {
  color: var(--primary-hover);
}

.article-content.ProseMirror strong {
  color: inherit !important;
  font-weight: 600 !important;
}

.article-content.ProseMirror blockquote {
  border-left: none;
}

.article-content.ProseMirror pre {
  background: var(--muted);
  border-radius: 0.5rem;
  color: var(--foreground);
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  padding: 0.75em 1em;
  margin: 1em 0;
  overflow-x: auto;
}

.article-content.ProseMirror code {
  background: var(--muted);
  border-radius: 0.25rem;
  padding: 0.2em 0.4em;
  font-family: "Menlo", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
}

.article-content.ProseMirror .tableWrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1em 0;
}

.article-content.ProseMirror table {
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
  overflow: visible;
  width: 100%;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.article-content.ProseMirror table td,
.article-content.ProseMirror table th {
  border: 1px solid var(--border);
  box-sizing: border-box;
  min-width: 1em;
  padding: 8px 10px;
  position: relative;
}

.article-content.ProseMirror table th {
  font-weight: 600;
}

.article-content.ProseMirror table tr:not([style*="background"]) > th:not([bgcolor]):not([style*="background"]) {
  background-color: var(--muted);
}

.article-content.ProseMirror .blockquote-style {
  margin: 1.5rem 0;
  position: relative;
  overflow: visible;
}

.article-content.ProseMirror .blockquote-style p {
  margin-bottom: 0.5em;
}

.article-content.ProseMirror .blockquote-style p:last-child {
  margin-bottom: 0;
}

.article-content.ProseMirror [data-style-blockquote] {
  margin: 1.5rem 0;
}

/* --------------------------------------------------------------------------
   SE 인용구 스타일 (네이버 스마트에디터 호환)
   -------------------------------------------------------------------------- */

.se-quotation {
  margin: 1.5rem 0;
  position: relative;
  overflow: visible;
}

.se-quotation-container {
  position: relative;
  margin-bottom: 0.5rem;
}

.se-section-quotation {
  position: relative;
  margin: 10px 0;
}

.se-module.se-quote {
  position: relative;
}

.se-module.se-quote span,
.se-module.se-quote p {
  display: block;
  min-height: 1.5em;
}

.content-wrapper {
  font-family: inherit;
}

.se-l-quotation_default .content-wrapper {
  font-family: "Nanum Myeongjo", serif;
  text-align: center;
  font-style: italic;
}

.se-l-quotation_bubble .content-wrapper,
.se-l-quotation_line .content-wrapper,
.se-l-quotation_underline .content-wrapper,
.se-l-quotation_corner .content-wrapper,
.se-l-quotation_postit .content-wrapper,
.se-l-quotation_gradient .content-wrapper,
.se-l-quotation_dash .content-wrapper,
.se-l-quotation_highlight .content-wrapper,
.se-l-quotation_modern .content-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
}

.se-module.se-cite {
  font-size: 0.9em;
  opacity: 0.9;
}

.se-module.se-cite span {
  display: block;
  min-height: 1.2em;
}

/* 1. 버티컬 라인 스타일 (line) */
.se-l-quotation_line .se-quotation-container {
  border-left: 4px solid var(--primary);
  padding-left: 1.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  color: var(--foreground);
}

/* 2. 따옴표 스타일 (default) */
.se-l-quotation_default .se-quotation-container {
  padding: 1.5rem 3rem;
  position: relative;
  font-style: italic;
  color: var(--foreground);
  text-align: center;
  max-width: 460px;
  margin: 0 auto;
}

.se-l-quotation_default .se-quote {
  text-align: center;
  width: 100%;
}

.se-l-quotation_default .se-quote p {
  text-align: center !important;
  width: 100%;
}

.se-l-quotation_default .se-quote .content-wrapper {
  text-align: center !important;
  width: 100%;
}

.se-component.se-quotation.se-l-quotation_default::before,
.se-component.se-quotation.se-l-quotation_default::after {
  font-family: Georgia, serif !important;
  color: var(--primary, #0070f3) !important;
  font-size: 5rem !important;
  line-height: 1 !important;
  position: absolute !important;
  display: block !important;
  z-index: 10 !important;
  opacity: 0.8 !important;
  pointer-events: none !important;
  transform: translateX(-50%) !important;
}

.se-component.se-quotation.se-l-quotation_default::before {
  content: "\201C" !important;
  top: -15px !important;
  left: 50% !important;
}

.se-component.se-quotation.se-l-quotation_default::after {
  content: "\201D" !important;
  bottom: -60px !important;
  left: 50% !important;
}

/* 3. 말풍선 스타일 (bubble) */
.se-l-quotation_bubble .se-quotation-container {
  max-width: 460px;
  margin: 0 auto 1.5rem;
  padding: 1.5rem 2rem;
  border: 3px solid #d0d0d0;
  border-radius: 0;
  background: var(--card-background, #fff);
  color: var(--foreground);
  position: relative;
  text-align: center;
}

.se-l-quotation_bubble .se-quotation-container::before {
  content: "";
  position: absolute;
  bottom: -22px;
  left: 22%;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 35px solid transparent;
  border-top: 22px solid #d0d0d0;
}

.se-l-quotation_bubble .se-quotation-container::after {
  content: "";
  position: absolute;
  bottom: -18px;
  left: calc(22% + 3px);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 32px solid transparent;
  border-top: 18px solid var(--card-background, #fff);
}

/* 4. 라인&따옴표 스타일 (underline) */
.se-l-quotation_underline .se-quotation-container {
  padding: 1rem 2rem 1rem 1.5rem;
  position: relative;
  color: var(--foreground);
  font-style: italic;
}

.se-l-quotation_underline .se-section-quotation::after {
  content: "" !important;
  display: block;
  width: calc(100% - 2rem);
  height: 2px;
  background-color: var(--primary);
  margin-top: 10px;
  margin-left: 1rem;
}

.se-component.se-quotation.se-l-quotation_underline::before {
  content: "\201C" !important;
  font-family: Georgia, serif !important;
  color: var(--primary, #0070f3) !important;
  font-size: 3rem !important;
  line-height: 1 !important;
  position: absolute !important;
  display: block !important;
  z-index: 10 !important;
  opacity: 0.8 !important;
  pointer-events: none !important;
  top: 0 !important;
  left: 15px !important;
}

/* 5. 페이퍼 스타일 (postit) */
.se-l-quotation_postit .se-quotation-container {
  position: relative;
  padding: 1.5rem 2rem;
  border: 3px solid #d0d0d0;
  background: var(--card-background, #fff);
  color: var(--foreground);
  max-width: 460px;
  margin: 0 auto;
}

.se-l-quotation_postit .se-quotation-container::after {
  content: "";
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #ccc 50%, var(--background, #f5f5f5) 50%);
}

/* 6. 꺾쇠 스타일 (corner) */
.se-l-quotation_corner .se-quotation-container {
  position: relative;
  padding: 1.5rem 2rem;
  color: var(--foreground);
  max-width: 460px;
  margin: 0 auto;
}

.se-l-quotation_corner .se-quotation-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border-top: 4px solid #333;
  border-left: 4px solid #333;
}

.se-l-quotation_corner .se-quotation-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-bottom: 4px solid #333;
  border-right: 4px solid #333;
}

/* 9. 그라디언트 좌측 바 스타일 (gradient) */
.se-l-quotation_gradient .se-quotation-container {
  border-left: 4px solid transparent;
  border-image: linear-gradient(180deg, #6366f1, #ec4899) 1;
  padding: 1.5rem 2rem;
  background: rgba(99, 102, 241, 0.04);
  color: var(--foreground);
}

/* 10. 대시 구분선 스타일 (dash) */
.se-l-quotation_dash .se-quotation-container {
  padding: 1.5rem 2rem;
  text-align: center;
  position: relative;
  color: var(--foreground);
  max-width: 460px;
  margin: 0 auto;
}

.se-l-quotation_dash .se-quotation-container::before,
.se-l-quotation_dash .se-quotation-container::after {
  content: "\2014\2014\2014";
  display: block;
  color: #999;
  letter-spacing: 0.3em;
  font-size: 0.85rem;
}

.se-l-quotation_dash .se-quotation-container::before { margin-bottom: 1rem; }
.se-l-quotation_dash .se-quotation-container::after { margin-top: 1rem; }

/* 11. 하이라이트 배경 스타일 (highlight) */
.se-l-quotation_highlight .se-quotation-container {
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(147, 51, 234, 0.08));
  border-left: 4px solid #3b82f6;
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--foreground);
}

/* 12. 모던 상하선 스타일 (modern) */
.se-l-quotation_modern .se-quotation-container {
  padding: 1.5rem 2rem;
  text-align: center;
  border-top: 2px solid #333;
  border-bottom: 2px solid #333;
  color: var(--foreground);
  max-width: 460px;
  margin: 0 auto;
}

/* 다크 모드 인용구 */
.dark .se-l-quotation_bubble .se-quotation-container { border-color: #555; }
.dark .se-l-quotation_bubble .se-quotation-container::before { border-top-color: #555; }
.dark .se-l-quotation_bubble .se-quotation-container::after { border-top-color: var(--card-background, #1a1a1a); }
.dark .se-l-quotation_postit .se-quotation-container { border-color: #555; }
.dark .se-l-quotation_postit .se-quotation-container::after { background: linear-gradient(135deg, #555 50%, var(--background, #1a1a1a) 50%); }
.dark .se-l-quotation_corner .se-quotation-container::before,
.dark .se-l-quotation_corner .se-quotation-container::after { border-color: #aaa; }
.dark .se-l-quotation_gradient .se-quotation-container { background: rgba(99, 102, 241, 0.08); }
.dark .se-l-quotation_dash .se-quotation-container::before,
.dark .se-l-quotation_dash .se-quotation-container::after { color: #666; }
.dark .se-l-quotation_highlight .se-quotation-container { background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(147, 51, 234, 0.12)); border-left-color: #60a5fa; }
.dark .se-l-quotation_modern .se-quotation-container { border-color: #aaa; }

/* SE 출처/폰트/정렬 */
.se-cite span { font-style: italic; color: #777; }
.se-ff-nanummyeongjo { font-family: "Nanum Myeongjo", serif; font-weight: 500; }
.se-ff-nanumbarungothic,
.se-ff-nanumgothic { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.se-text-paragraph { margin-bottom: 0 !important; }
.se-text-paragraph-align-center { text-align: center; }
.se-text-paragraph-align-left { text-align: left; }

/* 소셜 버튼 */
.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.social-button svg { transition: all 0.2s ease; }

.social-button.social-colored svg {
  color: inherit !important;
  fill: currentColor !important;
}

.social-button.social-colored:hover svg {
  color: inherit !important;
  fill: currentColor !important;
}

/* --------------------------------------------------------------------------
   이미지 플로팅
   -------------------------------------------------------------------------- */

.image-with-caption.float-left,
.photo-layout.image.float-left {
  float: left;
  max-width: 70%;
  margin: 0 1.5rem 1rem 0;
  clear: none;
}

.image-with-caption.float-right,
.photo-layout.image.float-right {
  float: right;
  max-width: 70%;
  margin: 0 0 1rem 1.5rem;
  clear: none;
}

/* 비-float 이미지는 항상 중앙 정렬(이미지의 좌/우 배치는 float 기능 사용).
   정렬 모델: 이미지 위치 = float(없음→중앙, left/right) / 캡션 정렬 = figcaption 자체 text-align(=alignment).
   과거 버그: renderHTML이 캡션용 alignment를 figure text-align(이미지 박스 위치)에도 적용해,
   캡션을 left로 두면 이미지(100% 미만)까지 왼쪽으로 쏠렸음. (에디터는 늘 중앙으로 보여줬는데 발행만 어긋남)

   - text-align:center !important → 단일 이미지의 inline-flex 박스 중앙.
     !important인 이유: 과거 저장글 figure에 인라인 text-align:left/right가 박혀 있어 이를 덮어야 함.
   - margin:0 auto → 갤러리처럼 figure가 고정폭(width:Npx)일 때 figure 자체를 중앙으로.
   figcaption은 자기 text-align(=alignment)을 유지하므로 캡션 정렬은 독립적으로 보존됨.

   ⚠️ 소급(retroactive) 주의: 이 규칙은 신규 기사뿐 아니라 기존 발행 기사에도 즉시 적용됨.
      → 과거에 비-float인데 좌/우로 보이던 이미지가 전부 중앙으로 이동함(에디터 표시와 일치시키는 교정).
      영향 범위는 작지만(대부분 이미 중앙), 기사별 검토 없이 일괄 변경되는 점을 인지하고 의도적으로 유지함.
      만약 기존 기사를 절대 변경하지 않으려면 위 !important 두 줄을 제거하고
      신규 저장본(ImageWithCaption.ts renderHTML이 이미 text-align:center 출력)에만 의존하면 됨. */
.image-with-caption:not(.float-left):not(.float-right) {
  clear: both;
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (max-width: 768px) {
  .image-with-caption.float-left,
  .image-with-caption.float-right {
    float: none;
    max-width: 100%;
    margin: 1rem 0;
  }
}

/* --------------------------------------------------------------------------
   ImageWithCaption renderHTML — Tailwind utility class 대체
   renderHTML()이 생성하는 class를 media 페이지에서도 동작하게 함
   -------------------------------------------------------------------------- */

.image-with-caption .relative {
  position: relative;
}

.image-with-caption .inline-flex {
  display: inline-flex;
  /* 박스 내부 이미지 중앙 (items-center 클래스 없는 과거 저장글도 커버) */
  align-items: center;
}

.image-with-caption .inline-block {
  display: inline-block;
}

/* 이미지가 컨테이너(또는 float 70% 박스)를 넘치지 않도록 — 에디터(.ProseMirror img)와 동일 */
.image-with-caption img {
  max-width: 100%;
  height: auto;
}

/* 캡션이 이미지 너비로 펴져 자체 text-align(=alignment)이 보이게 (에디터 textarea self-stretch와 동일) */
.image-with-caption figcaption {
  align-self: stretch;
}

.image-with-caption .flex-col {
  flex-direction: column;
}

.image-with-caption .items-center {
  align-items: center;
}

.image-with-caption .items-end {
  align-items: flex-end;
}

.image-with-caption .block {
  display: block;
}

.image-with-caption figcaption.mt-2 {
  margin-top: 0.5rem;
}

.image-with-caption figcaption.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.image-with-caption figcaption.text-gray-600 {
  color: #4b5563;
}

.image-with-caption figcaption.border-none {
  border: none;
}

.image-with-caption figcaption.px-1 {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.image-with-caption figcaption.whitespace-pre-wrap {
  white-space: pre-wrap;
}

.image-with-caption figcaption.min-h-\[24px\] {
  min-height: 24px;
}

/* --------------------------------------------------------------------------
   GenericIframe renderHTML — Tailwind utility class 대체
   ⚠️ 반드시 프론트 기사 컨테이너로 스코프할 것. bare `.w-full`은 layer 밖(unlayered)
      규칙이라 Tailwind의 @layer utilities(.lg:w-[420px] 등)를 전부 이겨, App Router
      CSS 청크 누수 시 어드민 에디터 페이지의 반응형 width를 깨뜨린다.
   -------------------------------------------------------------------------- */

:is(.article-content, #articleContent, #article-content-flobi, #article-member-content) .w-full {
  width: 100%;
}

/* --------------------------------------------------------------------------
   #article-content-flobi — 기사 본문 래퍼
   -------------------------------------------------------------------------- */

#article-content-flobi {
  word-break: normal;
  overflow-wrap: anywhere;
}

:lang(ko) #article-content-flobi p,
:lang(ko) #article-content-flobi p * {
  word-break: break-all;
}

:lang(ja) #article-content-flobi p,
:lang(ja) #article-content-flobi p * {
  text-align: justify;
}

:lang(zh) #article-content-flobi p,
:lang(zh) #article-content-flobi p * {
  text-align: justify;
}

#article-content-flobi .code-snippet-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
}

#article-content-flobi .code-snippet-scroll svg {
  max-width: 100% !important;
  height: auto !important;
}

#article-content-flobi .code-snippet-scroll > * {
  margin-left: auto;
  margin-right: auto;
}

#article-content-flobi table {
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1em 0;
  width: 100%;
  border: 1px solid var(--border, #e5e7eb);
}

#article-content-flobi table td,
#article-content-flobi table th {
  border: 1px solid var(--border, #e5e7eb);
  box-sizing: border-box;
  padding: 8px 10px;
}

#article-content-flobi table th {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   #articleContent / #article-member-content 공통 (프론트 본문)
   -------------------------------------------------------------------------- */

/* Clearfix */
.article-content.ProseMirror::after,
#articleContent::after,
.article-content::after,
#article-content-flobi::after,
#article-member-content::after {
  content: "";
  display: table;
  clear: both;
}

#articleContent ul,
#article-content-flobi ul,
#article-member-content ul {
  list-style: disc;
  padding-left: 1.25rem;
  margin: 1rem 0;
}

#articleContent li::marker,
#article-content-flobi li::marker,
#article-member-content li::marker {
  color: #d1d5db;
}

#articleContent li p,
#article-content-flobi li p,
#article-member-content li p {
  margin-bottom: 6px;
  margin-top: 6px;
}

#articleContent ol,
#article-content-flobi ol,
#article-member-content ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

#articleContent figure,
#article-content-flobi figure,
#article-member-content figure {
  margin-bottom: 24px;
}

#articleContent pre,
#article-content-flobi pre,
#article-member-content pre {
  background: #f3f4f6;
  font-family: Menlo, Monaco, Courier New, monospace;
  border-radius: .5rem;
  color: #111827;
  padding: .75em 1em;
  margin: 1em 0;
  overflow-x: auto;
  white-space: pre-line;
}

#articleContent .se-component,
#article-content-flobi .se-component,
#article-member-content .se-component {
  white-space: pre-line;
}

#articleContent hr,
#article-content-flobi hr,
#article-member-content hr {
  margin: 2rem 0;
}

/* --------------------------------------------------------------------------
   테이블 래퍼 (프론트 반응형)
   -------------------------------------------------------------------------- */

.table-scroll-wrapper > table {
  width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 768px) {
  .table-scroll-wrapper > table {
    table-layout: auto;
    width: 100% !important;
  }
  .table-scroll-wrapper > table col {
    width: auto !important;
  }
  .table-scroll-wrapper > table td,
  .table-scroll-wrapper > table th {
    word-break: break-all;
    white-space: normal !important;
  }
}

/* --------------------------------------------------------------------------
   제목 white-space
   -------------------------------------------------------------------------- */

.artitle-title,
.artitle-subtitle {
  white-space: pre-line;
}

/* --------------------------------------------------------------------------
   관련 기사 프리뷰
   -------------------------------------------------------------------------- */

.related-article-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--card-background);
  padding: 16px;
  margin: 18px 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}

.related-article-preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--foreground);
}

.related-article-preview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.related-article-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background-color: var(--muted);
}

.related-article-preview-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background-color: var(--card-background);
  border: 1px solid var(--border);
}

.related-article-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-article-preview-body {
  flex: 1;
  min-width: 0;
}

.related-article-preview-link {
  color: var(--foreground);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  width: 100%;
}

.related-article-preview-link:hover {
  text-decoration: underline;
}

.related-article-preview-text {
  color: var(--foreground);
  font-weight: 500;
}

.related-article-preview-empty {
  font-size: 0.95rem;
  color: var(--muted-foreground);
  margin: 0;
}

/* --------------------------------------------------------------------------
   링크 프리뷰
   -------------------------------------------------------------------------- */

.link-preview-wrapper {
  margin: 1rem 0;
}

.link-preview-card {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.link-preview-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.link-preview-image {
  flex-shrink: 0;
  width: 140px;
  height: 100px;
  background: #f3f4f6;
  overflow: hidden;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.link-preview-image img {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  margin: auto !important;
}

.link-preview-content {
  flex: 1;
  padding: 12px 16px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.link-preview-site {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #6b7280;
}

.link-preview-favicon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.link-preview-title {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.link-preview-card:hover .link-preview-title {
  color: #3b82f6;
}

.link-preview-description {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-preview-url {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .link-preview-card { flex-direction: column; }
  .link-preview-image { width: 100%; height: 160px; }
  .link-preview-content { padding: 12px; }
}

/* 다크모드 링크 프리뷰 */
.dark .link-preview-card,
[data-theme="dark"] .link-preview-card { background: #1f2937; border-color: #374151; }
.dark .link-preview-card:hover,
[data-theme="dark"] .link-preview-card:hover { border-color: #4b5563; }
.dark .link-preview-image,
[data-theme="dark"] .link-preview-image { background: #374151; }
.dark .link-preview-title,
[data-theme="dark"] .link-preview-title { color: #f9fafb; }
.dark .link-preview-site,
.dark .link-preview-description,
[data-theme="dark"] .link-preview-site,
[data-theme="dark"] .link-preview-description { color: #9ca3af; }
.dark .link-preview-url,
[data-theme="dark"] .link-preview-url { color: #6b7280; }

.prose-sm :where(img):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
  margin: 0 !important;
}
