/**
 * 리치텍스트 본문 공통 스타일 — 심플 에디터(.ProseMirror)와 게시글 보기(.darkthread-richtext) 동일 규칙
 */
.notice-view-article,
.dt-simple-editor__host .ProseMirror {
    --dt-richtext-body-font-size: 18px;
    --dt-richtext-font-size-large-extra: 2px;
    font-size: var(--dt-richtext-body-font-size);
    -webkit-text-size-adjust: 100%;
}

.dt-simple-editor__host .ProseMirror,
.darkthread-richtext {
    --dt-richtext-gap: var(--dt-se-reading-paragraph-gap, var(--darkthread-reading-paragraph-gap, 1.06em));
}

.dt-simple-editor__host .ProseMirror > :first-child,
.darkthread-richtext > :first-child {
    margin-top: 0;
}

.dt-simple-editor__host .ProseMirror p,
.darkthread-richtext p {
    margin: var(--dt-richtext-gap) 0 0;
}

.dt-simple-editor__host .ProseMirror p br,
.darkthread-richtext p br {
    display: block;
    margin-top: var(--dt-richtext-gap);
}

.dt-simple-editor__host .ProseMirror :is(ul, ol) li p br,
.darkthread-richtext :is(ul, ol) li p br {
    display: inline;
    margin: 0;
}

.dt-simple-editor__host .ProseMirror :is(p, h1, h2, h3, h4, h5, h6, blockquote, ul, ol, pre, hr, table),
.darkthread-richtext :is(p, h1, h2, h3, h4, h5, h6, blockquote, ul, ol, pre, hr, table) {
    margin-top: var(--dt-richtext-gap);
    margin-bottom: 0;
}

.darkthread-richtext p:empty::before {
    content: '\00a0';
}

.dt-simple-editor__host .ProseMirror h1,
.dt-simple-editor__host .ProseMirror h2,
.dt-simple-editor__host .ProseMirror h3,
.darkthread-richtext h1,
.darkthread-richtext h2,
.darkthread-richtext h3,
.darkthread-richtext h4,
.darkthread-richtext h5,
.darkthread-richtext h6 {
    font-weight: 700;
    letter-spacing: -0.026em;
    line-height: 1.4;
    color: var(--dt-fg-strong);
}

body.darkthread-board-view-v2-page.darkthread-board-list-v2-theme-light .notice-view-article.darkthread-richtext :is(h1, h2, h3, h4, h5, h6),
body.darkthread-board-view-v2-page.darkthread-board-list-v2-theme-light .darkthread-richtext :is(h1, h2, h3, h4, h5, h6) {
    color: var(--dt-fg);
}

body.darkthread-board-view-v2-page.darkthread-board-list-v2-theme-light .notice-view-article.darkthread-richtext li::marker,
body.darkthread-board-view-v2-page.darkthread-board-list-v2-theme-light .darkthread-richtext li::marker {
    color: var(--dt-fg-muted);
}

.dt-simple-editor__host .ProseMirror h1,
.darkthread-richtext h1 {
    font-size: 1.5rem;
}

.dt-simple-editor__host .ProseMirror h2,
.darkthread-richtext h2 {
    font-size: 1.25rem;
}

.dt-simple-editor__host .ProseMirror h3,
.darkthread-richtext h3 {
    font-size: 1.1rem;
}

.dt-simple-editor__host .ProseMirror span[style*='font-size: 1.125rem'],
.dt-simple-editor__host .ProseMirror span[style*='font-size:1.125rem'],
.darkthread-richtext span[style*='font-size: 1.125rem'],
.darkthread-richtext span[style*='font-size:1.125rem'],
.notice-view-article span[style*='font-size: 1.125rem'],
.notice-view-article span[style*='font-size:1.125rem'] {
    font-size: calc(1em + var(--dt-richtext-font-size-large-extra, 2px)) !important;
}

.dt-simple-editor__host .ProseMirror ul:not([data-type='taskList']),
.darkthread-richtext ul:not([data-type='taskList']) {
    padding-left: 1.35rem;
    list-style-type: disc;
    list-style-position: outside;
}

.dt-simple-editor__host .ProseMirror ol,
.darkthread-richtext ol {
    padding-left: 1.35rem;
    list-style-type: decimal;
    list-style-position: outside;
}

.dt-simple-editor__host .ProseMirror ul:not([data-type='taskList']) ul,
.darkthread-richtext ul:not([data-type='taskList']) ul {
    list-style-type: circle;
}

.dt-simple-editor__host .ProseMirror ul:not([data-type='taskList']) ul ul,
.darkthread-richtext ul:not([data-type='taskList']) ul ul {
    list-style-type: square;
}

.dt-simple-editor__host .ProseMirror ol + ul:not([data-type='taskList']),
.darkthread-richtext ol + ul:not([data-type='taskList']) {
    margin-left: 1.35rem;
}

.dt-simple-editor__host .ProseMirror li,
.darkthread-richtext li {
    display: list-item;
    margin: 0.45rem 0;
}

.dt-simple-editor__host .ProseMirror li::marker,
.darkthread-richtext li::marker {
    color: var(--dt-fg-soft);
}

.dt-simple-editor__host .ProseMirror li > p,
.darkthread-richtext li > p {
    margin: 0;
}

.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol):has(> li[style*='text-align: center']),
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol):has(> li[style*='text-align:center']),
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol):has(> li.has-text-align-center),
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol):has(> li > p[style*='text-align: center']),
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol):has(> li > p[style*='text-align:center']),
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol):has(> li > p.has-text-align-center),
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol):has(> li :is(p, div, span).has-text-align-center),
.darkthread-richtext :is(ul:not([data-type='taskList']), ol):has(> li[style*='text-align: center']),
.darkthread-richtext :is(ul:not([data-type='taskList']), ol):has(> li[style*='text-align:center']),
.darkthread-richtext :is(ul:not([data-type='taskList']), ol):has(> li.has-text-align-center),
.darkthread-richtext :is(ul:not([data-type='taskList']), ol):has(> li > p[style*='text-align: center']),
.darkthread-richtext :is(ul:not([data-type='taskList']), ol):has(> li > p[style*='text-align:center']),
.darkthread-richtext :is(ul:not([data-type='taskList']), ol):has(> li > p.has-text-align-center),
.darkthread-richtext :is(ul:not([data-type='taskList']), ol):has(> li :is(p, div, span).has-text-align-center) {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    list-style-position: outside;
}

.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol) > li > p[style*='text-align: center'],
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol) > li > p[style*='text-align:center'],
.dt-simple-editor__host .ProseMirror :is(ul:not([data-type='taskList']), ol) > li > p.has-text-align-center,
.darkthread-richtext :is(ul:not([data-type='taskList']), ol) > li > p[style*='text-align: center'],
.darkthread-richtext :is(ul:not([data-type='taskList']), ol) > li > p[style*='text-align:center'],
.darkthread-richtext :is(ul:not([data-type='taskList']), ol) > li > p.has-text-align-center {
    display: inline;
    margin: 0;
}

.dt-simple-editor__host .ProseMirror ul[data-type='taskList'],
.darkthread-richtext ul[data-type='taskList'] {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.dt-simple-editor__host .ProseMirror ul[data-type='taskList'] li,
.darkthread-richtext ul[data-type='taskList'] li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

.dt-simple-editor__host .ProseMirror ul[data-type='taskList'] li > label,
.darkthread-richtext ul[data-type='taskList'] li > label {
    flex: 0 0 auto;
    margin-top: 0.25rem;
    user-select: none;
}

.dt-simple-editor__host .ProseMirror ul[data-type='taskList'] li > div,
.darkthread-richtext ul[data-type='taskList'] li > div {
    flex: 1 1 auto;
}

.dt-simple-editor__host .ProseMirror blockquote,
.darkthread-richtext blockquote {
    padding: 0.35rem 0 0.35rem 1rem;
    border-left: 3px solid rgba(248, 113, 113, 0.42);
    background: rgba(24, 24, 24, 0.58);
    color: var(--dt-fg-muted);
}

.dt-simple-editor__host .ProseMirror blockquote > :first-child,
.darkthread-richtext blockquote > :first-child {
    margin-top: 0;
}

.dt-simple-editor__host .ProseMirror blockquote > :last-child,
.darkthread-richtext blockquote > :last-child {
    margin-bottom: 0;
}

.dt-simple-editor__host .ProseMirror blockquote > :is(p, h1, h2, h3, ul, ol, pre) + :is(p, h1, h2, h3, ul, ol, pre),
.darkthread-richtext blockquote > :is(p, h1, h2, h3, h4, h5, h6, ul, ol, pre) + :is(p, h1, h2, h3, h4, h5, h6, ul, ol, pre) {
    margin-top: 0.72em;
}

.dt-simple-editor__host .ProseMirror hr,
.darkthread-richtext hr {
    box-sizing: border-box;
    max-width: 100%;
    border: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.32);
}

.dt-simple-editor__host .ProseMirror pre,
.darkthread-richtext pre {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #020202;
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-family: "NanumSquareRound", sans-serif;
    font-size: 0.84rem;
    overflow-x: auto;
    color: var(--dt-fg);
}

.darkthread-richtext code {
    border-radius: 0.35rem;
    background: #262626;
    padding: 0.1rem 0.35rem;
    color: var(--dt-fg);
}

.dt-simple-editor__host .ProseMirror mark,
.darkthread-richtext mark {
    border-radius: 0.2em;
    padding: 0.05em 0;
    color: inherit;
}

.dt-simple-editor__host .ProseMirror a,
.dt-simple-editor__host .ProseMirror a.dt-simple-link,
.darkthread-richtext a {
    color: var(--dt-fg-danger);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dt-simple-editor__host .ProseMirror table,
.darkthread-richtext table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dt-simple-editor__host .ProseMirror th,
.dt-simple-editor__host .ProseMirror td,
.darkthread-richtext th,
.darkthread-richtext td {
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.5rem 0.65rem;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dt-simple-editor__host .ProseMirror th,
.darkthread-richtext th {
    background: rgba(15, 23, 42, 0.45);
    font-weight: 600;
}

.dt-simple-editor__host .ProseMirror td > p,
.dt-simple-editor__host .ProseMirror th > p,
.darkthread-richtext td > p,
.darkthread-richtext th > p {
    margin: 0;
}

.dt-simple-editor__host .ProseMirror img,
.darkthread-richtext img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: calc(var(--dt-richtext-gap) * 0.95) 0 0;
    border-radius: 10px;
}

.darkthread-richtext img:not(.darkthread-richtext-image-missing) {
    cursor: zoom-in;
}

.darkthread-richtext img.darkthread-richtext-image-missing {
    display: none;
}

.darkthread-richtext-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 560px);
    max-width: 100%;
    min-height: 180px;
    box-sizing: border-box;
    margin: calc(var(--dt-richtext-gap) * 0.95) 0 0;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: rgba(9, 9, 9, 0.6);
    color: var(--dt-fg-soft);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.darkthread-richtext-image-placeholder[data-align='center'] {
    margin-left: auto;
    margin-right: auto;
}

.darkthread-richtext-image-placeholder[data-align='right'] {
    margin-left: auto;
    margin-right: 0;
}

.dt-simple-editor__host .ProseMirror iframe,
.darkthread-richtext iframe {
    display: block;
    width: min(100%, 560px);
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: calc(var(--dt-richtext-gap) * 0.95) auto 0;
    border: 0;
    border-radius: 12px;
    background: #020202;
}

.dt-simple-editor__host .ProseMirror img[data-align='center'],
.darkthread-richtext img[data-align='center'] {
    margin-left: auto;
    margin-right: auto;
}

.dt-simple-editor__host .ProseMirror img[data-align='right'],
.darkthread-richtext img[data-align='right'] {
    margin-left: auto;
    margin-right: 0;
}

.darkthread-richtext {
    min-width: 0;
    max-width: 100%;
    line-height: var(--darkthread-reading-line-height, 1.82);
    letter-spacing: var(--darkthread-reading-letter-spacing, -0.012em);
    text-rendering: optimizeLegibility;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* 라이트 테마: 리치텍스트 제목 기본(#fafafa) 덮어쓰기 — 상세 본문·에디터 공통 */
html.darkthread-board-list-v2-theme-light .dt-simple-editor__host .ProseMirror :is(h1, h2, h3, h4, h5, h6),
html.darkthread-board-list-v2-theme-light .darkthread-richtext :is(h1, h2, h3, h4, h5, h6) {
    color: var(--dt-fg);
}

html.darkthread-board-list-v2-theme-light .dt-simple-editor__host .ProseMirror li::marker,
html.darkthread-board-list-v2-theme-light .darkthread-richtext li::marker {
    color: #64748b;
}

html.darkthread-board-list-v2-theme-light .dt-simple-editor__host .ProseMirror hr,
html.darkthread-board-list-v2-theme-light .darkthread-richtext hr {
    border-top-color: rgba(15, 23, 42, 0.12);
}

html.darkthread-board-list-v2-theme-light .dt-simple-editor__host .ProseMirror .darkthread-richtext-image-placeholder,
html.darkthread-board-list-v2-theme-light .darkthread-richtext-image-placeholder {
    border-color: rgba(148, 163, 184, 0.45);
    background: var(--dt-bg-input);
    color: var(--dt-fg-soft);
}

