.html-editor {
  /* 기본 폰트 설정 */
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
}

.html-editor h1,
.html-editor h2,
.html-editor h3,
.html-editor h4,
.html-editor h5,
.html-editor h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: bold;
  line-height: 1.2;
  color: var(--bs-emphasis-color);
}

.html-editor p {
  margin-bottom: 1rem;
}

.html-editor a {
  color: var(--bs-link-color);
  text-decoration: none;
}

.html-editor a:hover {
  color: var(--bs-link-hover-color);
  text-decoration: underline;
}

.html-editor img {
  max-width: 100%;
  height: auto;
}

.html-editor pre {
  background-color: var(--bs-dark-bg-subtle, var(--bs-gray-100));
  color: var(--bs-emphasis-color);
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
  margin-bottom: 1rem;
  border: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
}

.html-editor code {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
  border: 1px solid var(--bs-danger-border-subtle);
}

.html-editor blockquote {
  border-left: 4px solid var(--bs-info-border-subtle);
  padding-left: 1rem;
  color: var(--bs-body-color);
  margin-bottom: 1rem;
  font-style: italic;
  background-color: var(--bs-info-bg-subtle);
  padding: 1rem;
  border-radius: 4px;
  opacity: 0.9;
}

.html-editor ul,
.html-editor ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.html-editor table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.html-editor table th,
.html-editor table td {
  border: 1px solid var(--bs-border-color);
  padding: 0.5rem;
  text-align: left;
  color: var(--bs-body-color);
}

.html-editor table th {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-emphasis-color);
  font-weight: bold;
}

/* .html 클래스에도 동일한 스타일 적용 (게시글 보기에서 사용) */
.html {
  color: var(--bs-body-color);
}

.html h1,
.html h2,
.html h3,
.html h4,
.html h5,
.html h6 {
  color: var(--bs-emphasis-color);
}

.html a {
  color: var(--bs-link-color);
}

.html a:hover {
  color: var(--bs-link-hover-color);
}

.html pre {
  background-color: var(--bs-dark-bg-subtle, var(--bs-gray-100));
  color: var(--bs-emphasis-color);
  border: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

.html code {
  background-color: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  border: 1px solid var(--bs-danger-border-subtle);
}

.html blockquote {
  border-left: 4px solid var(--bs-info-border-subtle);
  color: var(--bs-body-color);
  background-color: var(--bs-info-bg-subtle);
  padding: 1rem;
  border-radius: 4px;
  font-style: italic;
  opacity: 0.9;
}

.html table th,
.html table td {
  border-color: var(--bs-border-color);
  color: var(--bs-body-color);
}

.html table th {
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-emphasis-color);
  font-weight: bold;
}

/* ================================================================
 * Quill 정렬 클래스 (전역 적용)
 * ----------------------------------------------------------------
 * Quill.js 2.0의 기본 정렬 포맷은 AlignClass 이며,
 * `<p class="ql-align-center">` 형태로 저장된다.
 * 글 읽기 페이지에서는 quill.snow.css 를 로드하지 않으므로
 * 여기에 정렬 클래스 CSS를 직접 정의해야 정렬이 적용된다.
 *
 * `.ql-align-*` 는 Quill 전용 클래스이므로 부모 셀렉터에 의존하지
 * 않고 전역으로 적용해도 사이드 이펙트가 없다. (.html-editor,
 * .html, .adv-content 등 다양한 컨테이너에서 모두 동작)
 * ================================================================ */
.ql-align-center {
  text-align: center;
}

.ql-align-right {
  text-align: right;
}

.ql-align-justify {
  text-align: justify;
}
