/* Обёртка Quill в формах админки / ЛК */
.politruk-rich-wrap .politruk-quill-shell {
    min-height: 180px;
}

.politruk-rich-wrap .ql-toolbar.ql-snow {
    border-radius: 0.25rem 0.25rem 0 0;
    border-color: #ced4da;
    flex: 0 0 auto;
}

/* height:100% у Quill ломает поток — принудительно auto */
.politruk-rich-wrap .ql-container.ql-snow {
    border-radius: 0 0 0.25rem 0.25rem;
    border-color: #ced4da;
    font-size: 16px;
    height: auto !important;
    min-height: 200px;
}

.politruk-rich-wrap .ql-editor {
    height: auto !important;
    min-height: 200px;
    max-height: none;
    overflow-y: visible;
    line-height: 1.6 !important;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
}

/* Абзацы строго блочные — не накладываются */
.politruk-rich-wrap .ql-editor p,
.politruk-rich-wrap .ql-editor ol,
.politruk-rich-wrap .ql-editor ul,
.politruk-rich-wrap .ql-editor pre,
.politruk-rich-wrap .ql-editor blockquote,
.politruk-rich-wrap .ql-editor h1,
.politruk-rich-wrap .ql-editor h2,
.politruk-rich-wrap .ql-editor h3,
.politruk-rich-wrap .ql-editor h4,
.politruk-rich-wrap .ql-editor h5,
.politruk-rich-wrap .ql-editor h6 {
    display: block !important;
    position: static !important;
    float: none !important;
    clear: none;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 1.6em;
    line-height: 1.6 !important;
    transform: none !important;
}

.ql-font-sans {
    font-family: Arial, Helvetica, sans-serif;
}

.ql-font-serif {
    font-family: Georgia, 'Times New Roman', serif;
}

.ql-font-mono {
    font-family: Consolas, 'Courier New', monospace;
}

/* Кнопка «плейсхолдер изображения» */
.politruk-rich-wrap .ql-snow .ql-toolbar button.ql-newsPlaceholder {
    width: 28px;
    height: 24px;
}

.politruk-rich-wrap .ql-snow .ql-toolbar button.ql-newsPlaceholder svg {
    display: none;
}

.politruk-rich-wrap .ql-snow .ql-toolbar button.ql-newsPlaceholder::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    background: center / contain no-repeat
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Crect fill='none' stroke='%23444444' stroke-width='1.4' x='2' y='3' width='14' height='12' rx='1'/%3E%3Ccircle fill='%23444444' cx='6.2' cy='7' r='1.3'/%3E%3Cpath fill='none' stroke='%23444444' stroke-width='1.4' d='M3.5 13.5l3.8-4.2 2.4 2.6 2.3-3.1 2.5 4.7'/%3E%3C/svg%3E");
}

.politruk-rich-wrap .ql-snow .ql-toolbar button.ql-newsPlaceholder:hover::before {
    filter: brightness(0.7);
}

/* Квадратик номера картинки — обычный inline-block внутри текста */
.politruk-rich-wrap .ql-editor span.ql-news-img-placeholder {
    display: inline-block !important;
    box-sizing: border-box;
    min-width: 1.55em;
    margin: 0 0.15em;
    padding: 0.05em 0.4em;
    border: 1px solid var(--site-brown-deep, #7c3a17);
    border-radius: 3px;
    background: var(--site-cream, #fff9ed);
    color: var(--site-brown, #5c4033);
    font-size: 0.9em;
    font-weight: 700;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.3 !important;
    vertical-align: baseline;
    white-space: nowrap;
    float: none !important;
    position: static !important;
    cursor: text;
}

/* Вывод сохранённого HTML на сайте */
.rich-text-content {
    line-height: 1.55;
    word-wrap: break-word;
}

.rich-text-content p {
    margin-bottom: 0.5rem;
}

.rich-text-content p:last-child {
    margin-bottom: 0;
}

.rich-text-content ul,
.rich-text-content ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.rich-text-content a {
    text-decoration: underline;
}
