/* CKEditor Tailwind CSS Reset Overrides */
.ck-editor__editable_inline {
    /* Set minimum height */
    min-height: 200px;

    /* Ensure paragraphs have margins */
    & p {
        margin-top: revert;
        margin-bottom: revert;
    }
    /* Ensure list styling isn't removed */
    & ul {
        list-style: revert;
        margin: revert;
        padding: revert;
    }
    & ol {
        list-style: revert;
        margin: revert;
        padding: revert;
    }
    & li {
        display: revert;
        padding-left: revert;
    }
    /* Ensure bold/strong renders correctly */
    & strong, & b {
        font-weight: revert;
    }
    /* Ensure italic/em renders correctly */
    & em, & i {
        font-style: revert;
    }
    /* Ensure headings render correctly */
    & h1, & h2, & h3, & h4, & h5, & h6 {
         font-size: revert;
         font-weight: revert;
         margin-top: revert;
         margin-bottom: revert;
    }
    /* Revert hyperlink styling */
    & a {
        color: revert;
        text-decoration: revert;
    }
}

/* Style CKEditor container to match other inputs */
.ck.ck-editor {
    border-radius: 0.375rem; /* rounded-md */
}
.ck.ck-editor__main > div {
     border: 2px solid #D1D5DB; /* border-2 border-gray-300 */
     border-radius: 0.375rem; /* rounded-md */
     /* Remove the top border radius if toolbar is above */
}
 .ck.ck-editor__top .ck-sticky-panel .ck-toolbar {
    border: 2px solid #D1D5DB; /* border-2 border-gray-300 */
    border-bottom: 1px solid #D1D5DB; /* Add separator */
    border-top-left-radius: 0.375rem; /* rounded-md */
    border-top-right-radius: 0.375rem; /* rounded-md */
 }
 .ck.ck-editor__main > div {
    border-top: none; /* Remove double border */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
 }

/* Match site font inside CKEditor (content and UI) */
:root {
    /* Apply site font to CKEditor UI where supported */
    --ck-font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}

.ck.ck-editor,
.ck.ck-toolbar,
.ck.ck-editor__main,
.ck.ck-button,
.ck.ck-dropdown {
    font-family: var(--ck-font-family);
}

/* Apply the same font to the editable content */
.ck.ck-editor__main .ck-content,
.ck-editor__editable_inline,
.ck-content {
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Noto Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
    font-size: 0.875rem; /* match Tailwind text-base */
    line-height: 1.5; /* match Tailwind leading-normal */
}