/* 게시글 본문: Quill / CKEditor / Toast UI / TinyMCE / Jodit / SunEditor 에서 저장된 서식 표시 */

/* ---------- 공통 ---------- */
.post-content ul,
.post-content ol {
    padding-left: 1.6em;
    margin: 0.5rem 0;
}
.post-content table {
    border-collapse: collapse;
    margin: 1rem 0;
}
.post-content table td,
.post-content table th {
    border: 1px solid var(--border-color, #d0d7de);
    padding: 0.4rem 0.6rem;
    min-width: 2em;
    vertical-align: top;
}
.post-content table th {
    background: var(--bg-muted, rgba(127, 127, 127, 0.08));
    font-weight: 600;
}
.post-content blockquote {
    margin: 1rem 0;
    padding: 0.25rem 1rem;
    border-left: 4px solid var(--border-color, #d0d7de);
    color: var(--text-light, inherit);
}
.post-content :not(pre) > code {
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    background: var(--bg-muted, rgba(127, 127, 127, 0.12));
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.9em;
}
.post-content hr {
    border: 0;
    border-top: 1px solid var(--border-color, #d0d7de);
    margin: 1.5rem 0;
}
.post-content iframe {
    max-width: 100%;
}
.post-content .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
}

/* ---------- Quill ---------- */
.post-content .ql-align-center { text-align: center; }
.post-content .ql-align-right { text-align: right; }
.post-content .ql-align-justify { text-align: justify; }
.post-content .ql-direction-rtl { direction: rtl; text-align: inherit; }
.post-content .ql-size-small { font-size: 0.75em; }
.post-content .ql-size-large { font-size: 1.5em; }
.post-content .ql-size-huge { font-size: 2.5em; }
.post-content .ql-font-serif { font-family: Georgia, 'Times New Roman', serif; }
.post-content .ql-font-monospace { font-family: Monaco, 'Courier New', monospace; }
.post-content .ql-indent-1 { padding-left: 3em; }
.post-content .ql-indent-2 { padding-left: 6em; }
.post-content .ql-indent-3 { padding-left: 9em; }
.post-content .ql-indent-4 { padding-left: 12em; }
.post-content .ql-indent-5 { padding-left: 15em; }
.post-content .ql-indent-6 { padding-left: 18em; }
.post-content .ql-indent-7 { padding-left: 21em; }
.post-content .ql-indent-8 { padding-left: 24em; }
.post-content li.ql-indent-1 { margin-left: 1.5em; padding-left: 0; }
.post-content li.ql-indent-2 { margin-left: 3em; padding-left: 0; }
.post-content li.ql-indent-3 { margin-left: 4.5em; padding-left: 0; }
.post-content li.ql-indent-4 { margin-left: 6em; padding-left: 0; }
.post-content li.ql-indent-5 { margin-left: 7.5em; padding-left: 0; }
.post-content li.ql-indent-6 { margin-left: 9em; padding-left: 0; }
.post-content li.ql-indent-7 { margin-left: 10.5em; padding-left: 0; }
.post-content li.ql-indent-8 { margin-left: 12em; padding-left: 0; }
.post-content ul.ql-checklist,
.post-content ul[data-checked] {
    list-style: none;
    padding-left: 0.5em;
}
.post-content ul.ql-checklist > li::before,
.post-content ul[data-checked] > li::before {
    display: inline-block;
    width: 1.4em;
    content: '\2610';
}
.post-content ul.ql-checklist > li[data-list="checked"]::before,
.post-content ul[data-checked="true"] > li::before {
    content: '\2611';
}
.post-content ul.ql-checklist > li[data-list="checked"],
.post-content ul[data-checked="true"] > li {
    color: var(--text-light, inherit);
    text-decoration: line-through;
}
.post-content iframe.ql-video {
    display: block;
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}
.post-content table.ql-table-better p.ql-table-block {
    margin: 0;
}

/* ---------- CKEditor 5 ---------- */
.post-content figure.image {
    display: table;
    clear: both;
    margin: 1rem auto;
    text-align: center;
    max-width: 100%;
}
.post-content figure.image img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    min-width: 100%;
}
.post-content figure.image_resized,
.post-content img.image_resized {
    max-width: 100%;
    display: block;
    box-sizing: border-box;
}
.post-content figure.image_resized img {
    width: 100%;
}
.post-content figure.image_resized > figcaption {
    display: block;
}
.post-content figure.image > figcaption,
.post-content figure.table > figcaption {
    display: table-caption;
    caption-side: bottom;
    padding: 0.4rem;
    font-size: 0.875em;
    color: var(--text-light, #666);
    text-align: center;
    word-break: break-word;
}
.post-content figure.table > figcaption {
    caption-side: top;
}
.post-content img.image-style-align-left,
.post-content figure.image-style-align-left,
.post-content figure.image-style-side,
.post-content img.image-style-side {
    float: left;
    margin: 0.25rem 1.25rem 0.75rem 0;
    max-width: 50%;
}
.post-content figure.image-style-side,
.post-content img.image-style-side {
    float: right;
    margin: 0.25rem 0 0.75rem 1.25rem;
}
.post-content img.image-style-align-right,
.post-content figure.image-style-align-right {
    float: right;
    margin: 0.25rem 0 0.75rem 1.25rem;
    max-width: 50%;
}
.post-content figure.image-style-block-align-left { margin-left: 0; margin-right: auto; }
.post-content figure.image-style-block-align-right { margin-left: auto; margin-right: 0; }
.post-content figure.image-style-align-center { margin-left: auto; margin-right: auto; }
.post-content figure.table {
    display: table;
    margin: 1rem auto;
    max-width: 100%;
    overflow-x: auto;
}
.post-content figure.table table {
    width: 100%;
    height: 100%;
    border: 1px double var(--border-color, #b3b3b3);
}
.post-content figure.media {
    clear: both;
    margin: 1rem 0;
    display: block;
    min-width: 15em;
}
.post-content ul.todo-list {
    list-style: none;
    padding-left: 0.5em;
}
.post-content ul.todo-list li {
    position: relative;
    margin-bottom: 0.2em;
}
.post-content ul.todo-list .todo-list__label > input {
    margin-right: 0.5em;
    vertical-align: middle;
}
.post-content ul.todo-list .todo-list__label > input[checked] ~ .todo-list__label__description {
    text-decoration: line-through;
    color: var(--text-light, inherit);
}
.post-content .marker-yellow { background-color: #fdfd77; color: #222; }
.post-content .marker-green { background-color: #62f962; color: #222; }
.post-content .marker-pink { background-color: #fc7899; color: #222; }
.post-content .marker-blue { background-color: #72ccfd; color: #222; }
.post-content .pen-red { color: #e71313; background-color: transparent; }
.post-content .pen-green { color: #128a00; background-color: transparent; }
.post-content .text-tiny { font-size: 0.7em; }
.post-content .text-small { font-size: 0.85em; }
.post-content .text-big { font-size: 1.4em; }
.post-content .text-huge { font-size: 1.8em; }
.post-content .page-break {
    position: relative;
    clear: both;
    margin: 1.5rem 0;
    border-top: 2px dashed var(--border-color, #c4c4c4);
    height: 0;
}
.post-content .page-break > span { display: none; }
.post-content ol[reversed] { counter-reset: none; }

/* ---------- Toast UI ---------- */
.post-content li.task-list-item {
    list-style: none;
    position: relative;
    margin-left: -1.2em;
    padding-left: 1.6em;
}
.post-content li.task-list-item::before {
    position: absolute;
    left: 0;
    content: '\2610';
}
.post-content li.task-list-item.checked::before {
    content: '\2611';
}
.post-content li.task-list-item.checked {
    color: var(--text-light, inherit);
    text-decoration: line-through;
}

/* ---------- TinyMCE ---------- */
.post-content details {
    border: 1px solid var(--border-color, #ddd);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0;
}
.post-content details > summary {
    cursor: pointer;
    font-weight: 600;
}

/* ---------- SunEditor ---------- */
.post-content div.se-component {
    display: flex;
    margin: 0 0 10px;
    max-width: 100%;
}
.post-content span.se-inline-component {
    display: inline-block;
    max-width: 100%;
    vertical-align: middle;
}
.post-content .se-component > figure {
    margin: 0;
    padding: 0;
    max-width: 100%;
}
.post-content .se-image-container img {
    max-width: 100%;
    height: auto;
}
.post-content .__se__float-left {
    float: left;
    margin-right: 1em;
}
.post-content .__se__float-right {
    float: right;
    margin-left: 1em;
}
.post-content .__se__float-center > figure {
    margin: 0 auto;
}
.post-content .se-video-container {
    width: 100%;
}
.post-content .se-video-container figure {
    position: relative;
    width: 100%;
}
.post-content .se-video-container figure iframe,
.post-content .se-video-container figure video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.post-content figure figcaption {
    padding: 0.5em;
    font-size: 0.9em;
    color: var(--text-light, inherit);
    text-align: center;
}
.post-content span.se-math {
    display: inline-block;
}

@media print {
    .post-content .page-break {
        border: 0;
        page-break-after: always;
    }
}
