@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css');

/* 1. 전체 본문 + 프리뷰 + 에디터 + 테마 폰트 지정 */
body,
.markdown-preview-view,
.markdown-rendered,
.markdown-preview-section,
.theme-light,
.theme-dark,
.markdown-source-view,
.workspace-leaf-content,
.markdown-preview-view .markdown-preview-sizer,
.markdown-preview-section .markdown-preview-content,
.cm-s-obsidian,
.mermaid,
.mermaid *,
.mermaid text,
.mermaid svg {
  font-family: 'Pretendard', 'Inter', 'Apple SD Gothic Neo', 'Malgun Gothic', Arial, sans-serif !important;
}

/* 2. 메타데이터(YAML 프론트매터) 및 속성(Property UI) 폰트도 통일 */
.cm-hmd-frontmatter,
.metadata-property,
.metadata-property-key,
.metadata-property-value,
.property-view,
.property-item,
.property-key,
.property-value {
  font-family: 'Pretendard', 'Inter', 'Apple SD Gothic Neo', 'Malgun Gothic', Arial, sans-serif !important;
}

/* 2-1. 코드 블록 폰트 (프리뷰 + 에디터) */
.markdown-preview-view code,
.markdown-preview-view pre,
.markdown-rendered code,
.markdown-rendered pre,
.cm-line,
.cm-code,
.cm-inline-code,
.HyperMD-codeblock,
.HyperMD-codeblock-begin,
.HyperMD-codeblock-end {
  font-family: 'Pretendard', 'Courier New', monospace !important;
  font-size: 13px !important;
}

/* 3. 제목 굵기 */
h1, h2, h3, h4, h5, h6 { font-weight: 700 !important; }
h3, h4, h5, h6 { font-weight: 600 !important; }

/* 4. 기존 h2 밑줄 스타일 강제 제거 */
h2::after, .markdown-preview-section h2::after, .markdown-rendered h2::after {
  content: none !important;
}

/* 5. publish-article-heading 전용 밑줄 스타일 */
h2.publish-article-heading {
  position: relative;
  padding-bottom: 0.25em;
}
h2.publish-article-heading::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: #e5e7eb;
  margin-top: 0.2em;
  border-radius: 1px;
}

/* 머메이드 다이어그램 전체 크기 조정 (Obsidian 1.5~ 기준) */
.markdown-preview-view .mermaid,
.markdown-rendered .mermaid {
  max-width: 400px;   /* 원하는 최대 가로 사이즈 */
  font-size: 12px;    /* 글씨 크기도 축소 */
}

/* ========== 테이블 스타일 초기화 (인라인 HTML용) ========== */
.markdown-preview-view table,
.markdown-rendered table,
.publish-article-content table {
  border: none !important;
  border-collapse: collapse !important;
  background: transparent !important;
  box-shadow: none !important;
}

.markdown-preview-view table td,
.markdown-preview-view table th,
.markdown-rendered table td,
.markdown-rendered table th,
.publish-article-content table td,
.publish-article-content table th {
  border: none !important;
  background: transparent !important;
  padding: inherit !important;
}

.markdown-preview-view table tr,
.markdown-rendered table tr,
.publish-article-content table tr {
  border: none !important;
  background: transparent !important;
}