/* Стили для Quill в Wagtail админке */
.quill-wrapper {
    margin-bottom: 15px;
}

.quill-wrapper textarea[data-quill-editor] {
    display: none !important; /* Прячем оригинальное поле */
}

.quill-container {
    min-height: 200px;
    background: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Интеграция с темой Wagtail */
.ql-snow {
    border: 1px solid #d0d2d3;
    border-radius: 3px;
}

.ql-snow .ql-toolbar {
    border-bottom: 1px solid #d0d2d3;
    background: #f8f9fa;
    padding: 8px;
}

.ql-snow .ql-editor {
    min-height: 150px;
    padding: 12px 15px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.ql-snow .ql-editor.ql-blank::before {
    color: #999;
    font-style: italic;
}

/* Стили для кнопок тулбара */
.ql-toolbar .ql-formats {
    margin-right: 15px;
}

.ql-toolbar button {
    border-radius: 3px;
}

.ql-toolbar button:hover {
    background: #e6e7e8;
}

.ql-toolbar .ql-active {
    background: #007cba;
    color: white;
}

/* Адаптация под StreamField */
.sequence-member .quill-wrapper {
    margin: 10px 0;
}

.struct-block .quill-wrapper {
    margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .ql-toolbar {
        flex-wrap: wrap;
    }

    .ql-toolbar .ql-formats {
        margin-right: 8px;
        margin-bottom: 8px;
    }

    .ql-container {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

/* Стили для контента на фронтенде */
.quill-content,
.advanced-quill-content {
    line-height: 1.6;
}

.quill-content h1, .advanced-quill-content h1,
.quill-content h2, .advanced-quill-content h2,
.quill-content h3, .advanced-quill-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.quill-content p, .advanced-quill-content p {
    margin-bottom: 1em;
}

.quill-content blockquote, .advanced-quill-content blockquote {
    border-left: 4px solid #ccc;
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
}

.quill-content ul, .advanced-quill-content ul,
.quill-content ol, .advanced-quill-content ol {
    padding-left: 2em;
    margin-bottom: 1em;
}
