.archive-detail-contents .toastui-editor-contents {
  /* 브랜드색 (하드코딩 금지) */
  --art-primary-soft: color-mix(in srgb, var(--color-primary) 40%, transparent); /* 링크 밑줄 */
  --art-primary-dark: color-mix(in srgb, var(--color-primary) 76%, #000);        /* 링크 hover + 인라인 코드 */
  /* 중립색 */
  --art-ink:        #2a3342; /* 본문 */
  --art-quote-ink:  #344256; /* 인용문 */
  --art-muted:      #7d8aa0; /* 이미지 캡션 */
  --art-rule:       #d9e1ec; /* 구분선: 표 테두리, hr */
  --art-surface:    #f4f8fd; /* 틴트 배경: 인용문, 표 줄무늬, 이미지 placeholder */
  --art-code-bg:    #eef2fb; /* 인라인 코드 칩 */
  --art-ph-frame:   #bcccea; /* placeholder 점선 테두리 */
  --art-ph-icon:    #9fb3d4; /* placeholder 아이콘 */
}

/* 본문 영역 */
.archive-detail-contents .toastui-editor-contents {
  font-family: var(--font-ko);
  font-size: 20px;
  color: var(--art-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.archive-detail-contents .toastui-editor-contents :not(table) {
  box-sizing: border-box;
  line-height: 1.85;
}

/* 본문 텍스트 */
.archive-detail-contents .toastui-editor-contents p {
  margin: 0 0 20px;
  color: var(--art-ink);
  letter-spacing: -0.003em;
}

.archive-detail-contents .toastui-editor-contents strong {
  font-weight: 700;
  color: var(--color-dark);
}

/* 제목 */
.archive-detail-contents .toastui-editor-contents h1,
.archive-detail-contents .toastui-editor-contents h2,
.archive-detail-contents .toastui-editor-contents h3,
.archive-detail-contents .toastui-editor-contents h4,
.archive-detail-contents .toastui-editor-contents h5,
.archive-detail-contents .toastui-editor-contents h6 {
  font-family: var(--font-ko);
  color: var(--color-dark);
  border: 0;            /* TOAST의 이중/회색 테두리 제거 */
  background: none;
}

/* 섹션 제목 */
.archive-detail-contents .toastui-editor-contents h2 {
  position: relative;
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 800;
  line-height: 1.35;
  margin: 60px 0 22px;
  padding: 0 0 14px;
}
.archive-detail-contents .toastui-editor-contents h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 52px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary);
}
.archive-detail-contents .toastui-editor-contents > h2:first-child {
  margin-top: 8px;
}

/* 하위 섹션 */
.archive-detail-contents .toastui-editor-contents h3 {
  position: relative;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.45;
  margin: 42px 0 12px;
  padding-left: 16px;
}
.archive-detail-contents .toastui-editor-contents h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  bottom: 0.18em;
  width: 4px;
  border-radius: 2px;
  background: var(--color-primary);
}

.archive-detail-contents .toastui-editor-contents h4 {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  margin: 30px 0 8px;
}

.archive-detail-contents .toastui-editor-contents h5 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin: 26px 0 6px;
  color: var(--color-primary);
}

.archive-detail-contents .toastui-editor-contents h6 {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.04em;
  margin: 24px 0 6px;
  color: var(--color-primary);
}

/* 순서 없는 목록 */
.archive-detail-contents .toastui-editor-contents ul {
  list-style: none;
  margin: 0 0 22px;
  padding-left: 2px;
}
.archive-detail-contents .toastui-editor-contents ul > li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 11px;
}
.archive-detail-contents .toastui-editor-contents ul > li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.8em;
  width: 7px;
  height: 7px;
  margin: 0;
  border-radius: 2px;
  background: var(--color-primary);
  transform: translateY(-50%);
}

/* 순서 있는 목록 */
.archive-detail-contents .toastui-editor-contents ol {
  list-style: none;
  counter-reset: li;
  margin: 0 0 22px;
  padding-left: 2px;
}
.archive-detail-contents .toastui-editor-contents ol > li {
  position: relative;
  counter-increment: li;
  padding-left: 38px;
  margin-bottom: 11px;
}
.archive-detail-contents .toastui-editor-contents ol > li::before {
  content: counter(li);
  position: absolute;
  left: 0;
  top: 0.21em;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0;
  direction: ltr;
  text-align: center;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--color-primary);
  border-radius: 7px;
}

.archive-detail-contents .toastui-editor-contents li,
.archive-detail-contents .toastui-editor-contents li > p {
  line-height: 1.6;
}
.archive-detail-contents .toastui-editor-contents li > p {
  margin: 0;
}

.archive-detail-contents .toastui-editor-contents li > ul,
.archive-detail-contents .toastui-editor-contents li > ol {
  margin-top: 11px !important;
  margin-bottom: 0 !important;
}

/* 인용문 */
.archive-detail-contents .toastui-editor-contents blockquote {
  margin: 28px 0;
  padding: 20px 26px;
  border: 0;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 8px 8px 0;
  background: var(--art-surface);
  color: var(--art-quote-ink);
}
.archive-detail-contents .toastui-editor-contents blockquote p,
.archive-detail-contents .toastui-editor-contents blockquote ul,
.archive-detail-contents .toastui-editor-contents blockquote ol {
  margin: 0;
  color: var(--art-quote-ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.75;
}

/* 링크 */
.archive-detail-contents .toastui-editor-contents a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--art-primary-soft);
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.archive-detail-contents .toastui-editor-contents a:hover {
  color: var(--art-primary-dark);
  text-decoration-color: var(--color-primary);
}

/* 인라인 코드 */
.archive-detail-contents .toastui-editor-contents :not(pre) > code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--art-code-bg);
  color: var(--art-primary-dark);
  font-size: 0.92em;
  letter-spacing: 0;
}

/* 실제 이미지(사진 삽입 시) */
.archive-detail-contents .toastui-editor-contents img {
  display: block;
  width: 100%;
  margin: 30px auto;
  border-radius: 12px;
}

/* 이미지 placeholder */
.archive-detail-contents .toastui-editor-contents figure.img-ph {
  margin: 30px 0;
  padding: 0;
}
.archive-detail-contents .toastui-editor-contents figure.img-ph img {
  margin: 0;
}
.archive-detail-contents .toastui-editor-contents .img-ph__frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 188px;
  padding: 30px;
  text-align: center;
  background: var(--art-surface);
  border: 1px dashed var(--art-ph-frame);
  border-radius: 12px;
}
.archive-detail-contents .toastui-editor-contents .img-ph__frame svg {
  width: 34px;
  height: 34px;
  color: var(--art-ph-icon);
  flex: none;
}
.archive-detail-contents .toastui-editor-contents figcaption {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--art-muted);
}

/* 표 */
.archive-detail-contents .toastui-editor-contents table {
  width: 100%;
  margin: 26px 0;
  border-collapse: collapse;
  border: 1px solid var(--art-rule);
  font-size: 17px;
}
.archive-detail-contents .toastui-editor-contents th,
.archive-detail-contents .toastui-editor-contents td {
  height: auto;
  padding: 12px 16px;
  border: 1px solid var(--art-rule);
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}
.archive-detail-contents .toastui-editor-contents th,
.archive-detail-contents .toastui-editor-contents th p {
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}
.archive-detail-contents .toastui-editor-contents td p {
  margin: 0;
}
.archive-detail-contents .toastui-editor-contents tbody tr:nth-child(even) td {
  background: var(--art-surface);
}

/* 코드 블록 */
.archive-detail-contents .toastui-editor-contents pre {
  margin: 26px 0;
  padding: 18px 22px;
  overflow-x: auto;
  background: #0f1b30;
  color: #e6edf6;
  border-radius: 10px;
  font-size: 15px;
  line-height: 1.7;
}
.archive-detail-contents .toastui-editor-contents pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  letter-spacing: 0;
}

/* 구분선 */
.archive-detail-contents .toastui-editor-contents hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--art-rule);
}

/* 체크리스트 */
.archive-detail-contents .toastui-editor-contents ul > li.task-list-item {
  padding-left: 4px;
}
.archive-detail-contents .toastui-editor-contents ul > li.task-list-item::before {
  display: none;
}
.archive-detail-contents .toastui-editor-contents .task-list-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 9px;
  vertical-align: -2px;
  accent-color: var(--color-primary);
}

/* 첫/마지막 요소 여백 정리 */
.archive-detail-contents .toastui-editor-contents > :first-child {
  margin-top: 0;
}
.archive-detail-contents .toastui-editor-contents > :last-child {
  margin-bottom: 0;
}

/* 모바일 */
@media (max-width: 768px) {
  .archive-detail-contents .toastui-editor-contents {
    font-size: 18px;
  }
  .archive-detail-contents .toastui-editor-contents h2 {
    margin-top: 44px;
  }
}
