/* CKEditor Content Styling */
.ckeditor-content p {
    margin-bottom: 1rem !important;
    line-height: 1.6;
}

.ckeditor-content p:last-child {
    margin-bottom: 0 !important;
}

.ckeditor-content ul,
.ckeditor-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.ckeditor-content li {
    margin-bottom: 0.5rem;
}

.ckeditor-content h1,
.ckeditor-content h2,
.ckeditor-content h3,
.ckeditor-content h4,
.ckeditor-content h5,
.ckeditor-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.ckeditor-content h1:first-child,
.ckeditor-content h2:first-child,
.ckeditor-content h3:first-child,
.ckeditor-content h4:first-child,
.ckeditor-content h5:first-child,
.ckeditor-content h6:first-child {
    margin-top: 0;
}

.ckeditor-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #007bff;
    background-color: #f8f9fa;
    font-style: italic;
}

.ckeditor-content a {
    color: #007bff;
    text-decoration: underline;
}

.ckeditor-content a:hover {
    color: #0056b3;
}

.ckeditor-content strong {
    font-weight: 600;
}

.ckeditor-content em {
    font-style: italic;
}

/* Ensure proper spacing for nested elements */
.ckeditor-content div {
    margin-bottom: 1rem;
}

.ckeditor-content div:last-child {
    margin-bottom: 0;
}

/* Fix for empty paragraphs */
.ckeditor-content p:empty {
    display: none;
}

/* Responsive text sizing */
@media (max-width: 768px) {
    .ckeditor-content {
        font-size: 0.95rem;
    }

    .ckeditor-content h1 {
        font-size: 1.75rem;
    }

    .ckeditor-content h2 {
        font-size: 1.5rem;
    }

    .ckeditor-content h3 {
        font-size: 1.25rem;
    }
}