/*
 * Стили контента CKEditor на фронте.
 * Применяются только внутри блока с классом .ckeditor-content
 */

/* ——— 1. Фото: обтекание и позиционирование ——— */

.ckeditor-content figure {
    margin: 1em 0;
}

.ckeditor-content figure img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* Обтекание: картинка слева */
.ckeditor-content figure.image-style-align-left {
    float: left;
    margin: 0 1.25em 1em 0;
    max-width: 50%;
}

/* Обтекание: картинка справа */
.ckeditor-content figure.image-style-align-right {
    float: right;
    margin: 0 0 1em 1.25em;
    max-width: 50%;
}

/* По центру */
.ckeditor-content figure.image-style-align-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Блок слева / справа (без обтекания) */
.ckeditor-content figure.image-style-block-align-left {
    margin-right: auto;
}

.ckeditor-content figure.image-style-block-align-right {
    margin-left: auto;
}

/* Подпись под изображением */
.ckeditor-content figure figcaption {
    font-size: 0.9em;
    color: #666;
    margin-top: 0.5em;
    text-align: center;
}

/* Сброс обтекания после figure */
.ckeditor-content figure::after {
    content: '';
    display: table;
    clear: both;
}


/* ——— 2. Цитаты ——— */

.ckeditor-content blockquote {
    margin: 1em 0;
    padding: 0.75em 1.25em;
    border-left: 4px solid #ccc;
    background: #f9f9f9;
    color: #444;
    font-style: italic;
}

.ckeditor-content blockquote p:last-child {
    margin-bottom: 0;
}


/* ——— 3. Таблицы ——— */

.ckeditor-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

.ckeditor-content th,
.ckeditor-content td {
    border: 1px solid #ddd;
    padding: 0.5em 0.75em;
    text-align: left;
}

.ckeditor-content th {
    background: #f0f0f0;
    font-weight: 600;
}

.ckeditor-content tbody tr:nth-child(even) {
    background: #fafafa;
}

.ckeditor-content table caption {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 0.5em;
    text-align: left;
}


/* ——— 4. Списки ——— */

.ckeditor-content ul,
.ckeditor-content ol {
    margin: 0.75em 0;
    padding-left: 1.5em;
}

.ckeditor-content ul {
    list-style-type: disc;
}

.ckeditor-content ol {
    list-style-type: decimal;
}

.ckeditor-content li {
    margin: 0.35em 0;
}

.ckeditor-content ul ul,
.ckeditor-content ol ol,
.ckeditor-content ul ol,
.ckeditor-content ol ul {
    margin: 0.35em 0;
}


/* ——— 5. Размер текста ——— */

.ckeditor-content .text-tiny {
    font-size: 0.75em;
}

.ckeditor-content .text-small {
    font-size: 0.875em;
}

.ckeditor-content .text-big {
    font-size: 1.25em;
}

.ckeditor-content .text-huge {
    font-size: 1.5em;
}


/* ——— 6. Список с отмеченными пунктами (todo-list) ——— */

.ckeditor-content ul.todo-list {
    list-style: none;
    padding-left: 0;
    margin: 0.75em 0;
}

.ckeditor-content ul.todo-list li {
    margin: 0.5em 0;
}

.ckeditor-content .todo-list__label {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
    cursor: default;
}

.ckeditor-content .todo-list__label input[type="checkbox"] {
    margin: 0.25em 0 0 0;
    flex-shrink: 0;
    width: 1.15em;
    height: 1.15em;
    accent-color: var(--primary-color);
}

.ckeditor-content .todo-list__label__description {
    flex: 1;
}

/* Выполненный пункт: в цветах сайта, без зачёркивания */
.ckeditor-content .todo-list__label:has(input:checked) {
    padding: 0.35em 0.6em;
    margin: 0 -0.6em;
    border-radius: 6px;
    background: var(--bg-secondary);
    border-left: 3px solid var(--primary-color);
}
