/*
 * CKEditor 저장 HTML 출력 전용 스타일.
 * 이 파일은 편집기 UI가 아니라 @Html.Raw(...)로 렌더링하는 요소에 사용한다.
 * 출력 컨테이너에는 반드시 .ck-content를 함께 지정한다.
 */
.ck-content {
    --editor-line: var(--line-strong, #cfd3da);
    --editor-line-light: var(--line-light, #e7e9ed);
    --editor-surface: var(--surface-panel, #fff);
    --editor-surface-subtle: var(--surface-subtle, #f2f3f5);
    --editor-text: var(--text-body, #373b41);
    --editor-text-strong: var(--text-strong, #17191c);
    --editor-text-muted: var(--text-muted, #767d87);
    --editor-link: var(--brand-600, #3c63ce);
    --editor-image-spacing: 1.5em;
    color: var(--editor-text);
    font: inherit;
    line-height: 1.75;
    overflow-wrap: anywhere;
    word-break: normal;
}

.ck-content::after {
    display: block;
    clear: both;
    content: "";
}

.ck-content,
.ck-content * {
    box-sizing: border-box;
}

.ck-content > :first-child {
    margin-top: 0;
}

.ck-content > :last-child {
    margin-bottom: 0;
}

.ck-content p,
.ck-content ul,
.ck-content ol,
.ck-content blockquote,
.ck-content pre,
.ck-content figure {
    margin-top: 0;
    margin-bottom: 1em;
}

.ck-content h2,
.ck-content h3,
.ck-content h4 {
    margin: 1.35em 0 .55em;
    color: var(--editor-text-strong);
    font-weight: 700;
    line-height: 1.35;
    word-break: keep-all;
}

.ck-content h2 { font-size: 1.75em; }
.ck-content h3 { font-size: 1.45em; }
.ck-content h4 { font-size: 1.2em; }

.ck-content a {
    color: var(--editor-link);
    text-decoration: underline;
    text-underline-offset: .18em;
}

.ck-content strong,
.ck-content b {
    color: var(--editor-text-strong);
    font-weight: 700;
}

.ck-content .text-tiny { font-size: .7em; }
.ck-content .text-small { font-size: .85em; }
.ck-content .text-big { font-size: 1.4em; }
.ck-content .text-huge { font-size: 1.8em; }

.ck-content ul,
.ck-content ol {
    padding-left: 1.6em;
}

.ck-content ul { list-style: disc; }
.ck-content ul ul { list-style: circle; }
.ck-content ul ul ul { list-style: square; }
.ck-content ol { list-style: decimal; }
.ck-content ol ol { list-style: lower-alpha; }
.ck-content ol ol ol { list-style: lower-roman; }
.ck-content li + li { margin-top: .25em; }

.ck-content blockquote {
    padding: .8em 1.1em;
    border-left: 4px solid var(--editor-line);
    border-radius: 0 8px 8px 0;
    background: var(--editor-surface-subtle);
    color: var(--editor-text-muted);
    font-style: italic;
}

.ck-content[dir="rtl"] blockquote {
    border-right: 4px solid var(--editor-line);
    border-left: 0;
    border-radius: 8px 0 0 8px;
}

.ck-content code {
    padding: .12em .35em;
    border-radius: 4px;
    background: var(--editor-surface-subtle);
    color: var(--editor-text-strong);
    font-family: Consolas, "Courier New", monospace;
    font-size: .9em;
}

.ck-content pre {
    max-width: 100%;
    padding: 1em 1.1em;
    overflow-x: auto;
    border: 1px solid var(--editor-line-light);
    border-radius: 8px;
    background: var(--editor-surface-subtle);
    color: var(--editor-text-strong);
    direction: ltr;
    tab-size: 4;
    text-align: left;
    white-space: pre-wrap;
}

.ck-content pre code {
    padding: 0;
    background: transparent;
    font-size: inherit;
}

.ck-content hr {
    height: 0;
    margin: 1.5em 0;
    border: 0;
    border-top: 1px solid var(--editor-line-light);
}

.ck-content .marker-yellow { background: #fff59d; }
.ck-content .marker-green { background: #b9f6ca; }
.ck-content .marker-pink { background: #ffb8c6; }
.ck-content .marker-blue { background: #9edcff; }
.ck-content .pen-red { color: #d71920; background: transparent; }
.ck-content .pen-green { color: #087f23; background: transparent; }

.ck-content figure.image,
.ck-content .image {
    display: table;
    clear: both;
    max-width: 100%;
    margin: 1em auto;
    text-align: center;
}

.ck-content figure.image img,
.ck-content .image img,
.ck-content > img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.ck-content .image.image_resized {
    display: block;
}

.ck-content .image.image_resized img {
    width: 100%;
}

.ck-content .image-inline {
    display: inline-flex;
    max-width: 100%;
    vertical-align: middle;
}

.ck-content .image-inline img,
.ck-content .image-inline picture {
    max-width: 100%;
}

.ck-content .image-style-side,
.ck-content .image-style-align-right {
    float: right;
    max-width: min(50%, calc(100% - var(--editor-image-spacing)));
    margin: 0 0 1em var(--editor-image-spacing);
}

.ck-content .image-style-align-left {
    float: left;
    max-width: min(50%, calc(100% - var(--editor-image-spacing)));
    margin: 0 var(--editor-image-spacing) 1em 0;
}

.ck-content .image-style-align-center {
    margin-right: auto;
    margin-left: auto;
}

.ck-content .image-style-block-align-left {
    margin-right: auto;
    margin-left: 0;
}

.ck-content .image-style-block-align-right {
    margin-right: 0;
    margin-left: auto;
}

.ck-content figcaption {
    display: table-caption;
    padding: .65em .8em;
    caption-side: bottom;
    background: var(--editor-surface-subtle);
    color: var(--editor-text-muted);
    font-size: .82em;
    line-height: 1.5;
    text-align: center;
    word-break: break-word;
}

.ck-content figure.table,
.ck-content .table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.ck-content .table table,
.ck-content table {
    width: 100%;
    min-width: 420px;
    border: 1px solid var(--editor-line);
    border-collapse: collapse;
    border-spacing: 0;
    background: var(--editor-surface);
}

.ck-content .table th,
.ck-content .table td,
.ck-content table th,
.ck-content table td {
    min-width: 2em;
    padding: .65em .75em;
    border: 1px solid var(--editor-line);
    text-align: left;
    vertical-align: top;
}

.ck-content .table th,
.ck-content table th {
    background: var(--editor-surface-subtle);
    color: var(--editor-text-strong);
    font-weight: 700;
}

.ck-content .table .ck-table-resized {
    table-layout: fixed;
}

.ck-content figure.table > figcaption {
    display: block;
    caption-side: top;
}

.ck-content figure.media,
.ck-content .media,
.ck-content .raw-html-embed {
    display: block;
    clear: both;
    width: 100%;
    max-width: 100%;
    margin: 1em 0;
}

.ck-content iframe,
.ck-content video {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 10px;
}

.ck-content audio {
    width: 100%;
    max-width: 100%;
}

.ck-content .todo-list {
    padding-left: 0;
    list-style: none;
}

.ck-content .todo-list .todo-list__label {
    display: flex;
    gap: .55em;
    align-items: flex-start;
}

.ck-content .todo-list input[type="checkbox"] {
    flex: 0 0 auto;
    width: 1em;
    height: 1em;
    margin-top: .35em;
    accent-color: var(--brand-500, #4f78e8);
}

.ck-content .page-break {
    position: relative;
    display: flex;
    clear: both;
    align-items: center;
    justify-content: center;
    min-height: 2.2em;
    margin: 1.5em 0;
}

.ck-content .page-break::before {
    position: absolute;
    right: 0;
    left: 0;
    border-top: 2px dashed var(--editor-line);
    content: "";
}

.ck-content .page-break__label {
    position: relative;
    z-index: 1;
    padding: .25em .65em;
    border: 1px solid var(--editor-line);
    border-radius: 5px;
    background: var(--editor-surface);
    color: var(--editor-text-muted);
    font-size: .75em;
    font-weight: 700;
}

.ck-content .mention {
    padding: .1em .3em;
    border-radius: 4px;
    background: var(--brand-100, #e5edff);
    color: var(--brand-700, #304fa8);
}

.ck-content span[lang] {
    font-style: italic;
}

@media (max-width: 600px) {
    .ck-content {
        line-height: 1.7;
    }

    .ck-content h2 { font-size: 1.5em; }
    .ck-content h3 { font-size: 1.3em; }
    .ck-content h4 { font-size: 1.15em; }

    .ck-content .image-style-side,
    .ck-content .image-style-align-left,
    .ck-content .image-style-align-right {
        float: none;
        max-width: 100%;
        margin: 1em auto;
    }

    .ck-content .table table,
    .ck-content table {
        min-width: 360px;
    }
}

@media print {
    .ck-content .page-break {
        break-after: page;
        min-height: 0;
    }

    .ck-content .page-break::before,
    .ck-content .page-break__label {
        display: none;
    }

    .ck-content figure.table,
    .ck-content .table,
    .ck-content pre {
        overflow: visible;
    }
}
