/**
 * ============================================================================
 * TITAN BOARD
 * TITAN WYSIWYG EDITOR
 * ============================================================================
 *
 * CKEditor 5 Base Layout + TITAN Dark Theme
 *
 * Wichtig:
 * Diese Datei enthält bewusst auch die grundlegenden CKEditor-Layoutregeln.
 * Dadurch funktioniert der Editor auch dann korrekt, wenn das CKEditor-Bundle
 * seine CSS-Dateien nicht automatisch mitliefert.
 *
 * ============================================================================
 */


/* ============================================================================
   TITAN EDITOR VARIABLES
   ============================================================================ */

:root {

    --titan-editor-bg:
        #0d0d14;

    --titan-editor-panel:
        #15151f;

    --titan-editor-panel-2:
        #1b1b27;

    --titan-editor-panel-3:
        #222231;

    --titan-editor-border:
        #2b2b39;

    --titan-editor-border-light:
        #39394a;

    --titan-editor-text:
        #f2f2f5;

    --titan-editor-muted:
        #a4a4b0;

    --titan-editor-accent:
        #5865f2;

    --titan-editor-accent-hover:
        #6875ff;

    --titan-editor-danger:
        #ef4444;

    --titan-editor-radius:
        8px;

}


/* ============================================================================
   CKEDITOR BASE
   ============================================================================ */

.ck {

    box-sizing:
        border-box;

}

.ck *,
.ck *::before,
.ck *::after {

    box-sizing:
        border-box;

}


/* ============================================================================
   EDITOR CONTAINER
   ============================================================================ */

.ck.ck-editor {

    position:
        relative;

    display:
        flex;

    flex-direction:
        column;

    width:
        100%;

    border:
        1px solid var(--titan-editor-border);

    border-radius:
        10px;

    overflow:
        hidden;

    background:
        var(--titan-editor-bg);

    color:
        var(--titan-editor-text);

    font-family:
        inherit;

}


/* ============================================================================
   EDITOR MAIN
   ============================================================================ */

.ck.ck-editor__main {

    position:
        relative;

    display:
        block;

    width:
        100%;

}


/* ============================================================================
   TOOLBAR
   ============================================================================ */

.ck.ck-toolbar {

    position:
        relative;

    display:
        flex;

    flex-direction:
        row;

    align-items:
        center;

    flex-wrap:
        wrap;

    width:
        100%;

    min-height:
        46px;

    padding:
        7px !important;

    gap:
        3px;

    background:
        var(--titan-editor-panel) !important;

    border:
        0 !important;

    border-bottom:
        1px solid var(--titan-editor-border) !important;

    color:
        var(--titan-editor-text);

    box-shadow:
        none !important;

}


/* ============================================================================
   TOOLBAR GROUPS
   ============================================================================ */

.ck.ck-toolbar__items {

    display:
        flex;

    align-items:
        center;

    flex-wrap:
        wrap;

    gap:
        3px;

    width:
        100%;

}


/* ============================================================================
   TOOLBAR SEPARATOR
   ============================================================================ */

.ck.ck-toolbar__separator {

    display:
        block;

    width:
        1px;

    min-width:
        1px;

    height:
        24px;

    margin:
        0 4px;

    background:
        var(--titan-editor-border-light) !important;

}


/* ============================================================================
   BUTTON BASE
   ============================================================================ */

.ck.ck-button {

    position:
        relative;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    min-width:
        32px;

    min-height:
        32px;

    padding:
        5px 7px;

    border:
        0 !important;

    border-radius:
        6px !important;

    background:
        transparent !important;

    color:
        var(--titan-editor-text) !important;

    cursor:
        pointer;

    font-family:
        inherit;

    font-size:
        13px;

    line-height:
        1;

    text-decoration:
        none;

    white-space:
        nowrap;

    box-shadow:
        none !important;

}


/* ============================================================================
   BUTTON HOVER
   ============================================================================ */

.ck.ck-button:hover {

    background:
        var(--titan-editor-panel-2) !important;

    color:
        #ffffff !important;

}


/* ============================================================================
   BUTTON ACTIVE
   ============================================================================ */

.ck.ck-button.ck-on {

    background:
        var(--titan-editor-accent) !important;

    color:
        #ffffff !important;

}


/* ============================================================================
   BUTTON FOCUS
   ============================================================================ */

.ck.ck-button:focus,
.ck.ck-button:focus-visible {

    outline:
        none !important;

    box-shadow:
        0 0 0 2px rgba(88, 101, 242, .25) !important;

}


/* ============================================================================
   BUTTON LABEL
   ============================================================================ */

.ck.ck-button .ck-button__label {

    display:
        inline-block;

    color:
        inherit !important;

    font-family:
        inherit;

    font-size:
        inherit;

    font-weight:
        inherit;

    line-height:
        1.2;

    white-space:
        nowrap;

}


/* ============================================================================
   BUTTON ICON
   ============================================================================ */

.ck.ck-button .ck-icon {

    display:
        block;

    width:
        20px;

    height:
        20px;

    min-width:
        20px;

    min-height:
        20px;

    margin:
        0;

    fill:
        currentColor;

}


.ck.ck-button .ck-icon + .ck-button__label {

    margin-left:
        6px;

}


/* ============================================================================
   SVG ICONS
   ============================================================================ */

.ck .ck-icon {

    display:
        block;

    width:
        20px;

    height:
        20px;

    line-height:
        1;

    overflow:
        hidden;

}


.ck .ck-icon svg {

    display:
        block;

    width:
        100%;

    height:
        100%;

}


/* ============================================================================
   DROPDOWN BUTTON
   ============================================================================ */

.ck.ck-dropdown {

    position:
        relative;

    display:
        inline-flex;

    vertical-align:
        middle;

}


/* ============================================================================
   DROPDOWN ARROW
   ============================================================================ */

.ck.ck-dropdown .ck-dropdown__arrow {

    width:
        10px;

    height:
        10px;

    margin-left:
        5px;

    transform:
        rotate(45deg);

    border-right:
        1px solid currentColor;

    border-bottom:
        1px solid currentColor;

}


/* ============================================================================
   DROPDOWN PANEL
   ============================================================================ */

.ck.ck-dropdown__panel {

    position:
        absolute;

    z-index:
        1000;

    min-width:
        180px;

    max-width:
        400px;

    padding:
        6px;

    background:
        var(--titan-editor-panel) !important;

    border:
        1px solid var(--titan-editor-border) !important;

    border-radius:
        8px;

    color:
        var(--titan-editor-text) !important;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, .45);

}


/* ============================================================================
   DROPDOWN PANEL POSITION
   ============================================================================ */

.ck.ck-dropdown__panel.ck-dropdown__panel_se {

    top:
        100%;

    left:
        0;

    margin-top:
        5px;

}


/* ============================================================================
   LIST
   ============================================================================ */

.ck.ck-list {

    display:
        flex;

    flex-direction:
        column;

    width:
        100%;

    margin:
        0;

    padding:
        4px;

    list-style:
        none;

    background:
        var(--titan-editor-panel) !important;

    border:
        0;

}


/* ============================================================================
   LIST ITEM
   ============================================================================ */

.ck.ck-list__item {

    display:
        block;

    width:
        100%;

    margin:
        0;

    padding:
        0;

    list-style:
        none;

}


/* ============================================================================
   LIST ITEM BUTTON
   ============================================================================ */

.ck.ck-list__item .ck-button {

    display:
        flex;

    justify-content:
        flex-start;

    width:
        100%;

    min-height:
        34px;

    padding:
        7px 10px;

    border-radius:
        5px !important;

    text-align:
        left;

}


/* ============================================================================
   LIST ITEM HOVER
   ============================================================================ */

.ck.ck-list__item .ck-button:hover {

    background:
        var(--titan-editor-panel-2) !important;

}


/* ============================================================================
   LIST ITEM ACTIVE
   ============================================================================ */

.ck.ck-list__item .ck-button.ck-on {

    background:
        var(--titan-editor-accent) !important;

    color:
        #ffffff !important;

}


/* ============================================================================
   LIST ITEM LABEL
   ============================================================================ */

.ck.ck-list__item .ck-button__label {

    display:
        block;

    width:
        100%;

    color:
        inherit !important;

}


/* ============================================================================
   EDITABLE AREA
   ============================================================================ */

.ck-editor__editable_inline {

    display:
        block;

    width:
        100%;

    min-height:
        280px;

    padding:
        22px !important;

    background:
        var(--titan-editor-bg) !important;

    color:
        var(--titan-editor-text) !important;

    border:
        0 !important;

    outline:
        none !important;

    font-family:
        inherit;

    font-size:
        15px;

    line-height:
        1.7;

    overflow-x:
        auto;

}


/* ============================================================================
   EDITABLE FOCUS
   ============================================================================ */

.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused {

    border:
        0 !important;

    box-shadow:
        none !important;

}


/* ============================================================================
   EDITOR FOCUS
   ============================================================================ */

.ck.ck-editor.ck-focused {

    border-color:
        var(--titan-editor-accent);

    box-shadow:
        0 0 0 2px rgba(88, 101, 242, .18);

}


/* ============================================================================
   PLACEHOLDER
   ============================================================================ */

.ck.ck-editor__editable.ck-placeholder::before,
.ck.ck-editor__editable .ck-placeholder::before {

    color:
        var(--titan-editor-muted) !important;

    opacity:
        1;

}


/* ============================================================================
   CONTENT
   ============================================================================ */

.ck-content {

    color:
        var(--titan-editor-text);

    font-family:
        inherit;

    font-size:
        15px;

    line-height:
        1.7;

}


/* ============================================================================
   PARAGRAPH
   ============================================================================ */

.ck-content p {

    margin:
        0 0 12px;

    line-height:
        1.7;

}


/* ============================================================================
   HEADINGS
   ============================================================================ */

.ck-content h2 {

    margin:
        24px 0 14px;

    font-size:
        1.7rem;

    line-height:
        1.25;

    color:
        #ffffff;

}


.ck-content h3 {

    margin:
        20px 0 12px;

    font-size:
        1.4rem;

    line-height:
        1.3;

    color:
        #ffffff;

}


.ck-content h4 {

    margin:
        18px 0 10px;

    font-size:
        1.15rem;

    line-height:
        1.35;

    color:
        #ffffff;

}


/* ============================================================================
   LINKS
   ============================================================================ */

.ck-content a {

    color:
        #6d7cff;

    text-decoration:
        underline;

}


.ck-content a:hover {

    color:
        #8b96ff;

}


/* ============================================================================
   BLOCKQUOTE
   ============================================================================ */

.ck-content blockquote {

    margin:
        18px 0;

    padding:
        12px 18px;

    background:
        var(--titan-editor-panel);

    border-left:
        4px solid var(--titan-editor-accent);

    border-radius:
        0 6px 6px 0;

    color:
        #d7d7df;

}


/* ============================================================================
   INLINE CODE
   ============================================================================ */

.ck-content code {

    padding:
        2px 6px;

    border-radius:
        4px;

    background:
        #20202b;

    color:
        #f3c969;

    font-family:
        Consolas,
        Monaco,
        monospace;

}


/* ============================================================================
   CODE BLOCK
   ============================================================================ */

.ck-content pre {

    margin:
        18px 0;

    padding:
        18px;

    background:
        #09090e;

    border:
        1px solid var(--titan-editor-border);

    border-radius:
        8px;

    overflow:
        auto;

}


.ck-content pre code {

    padding:
        0;

    background:
        transparent;

    color:
        #e5e5ea;

}


/* ============================================================================
   LISTS
   ============================================================================ */

.ck-content ul,
.ck-content ol {

    margin:
        12px 0;

    padding-left:
        30px;

}


.ck-content li {

    margin:
        5px 0;

}


/* ============================================================================
   TABLE
   ============================================================================ */

.ck-content figure.table {

    margin:
        18px 0;

}


.ck-content table {

    width:
        100%;

    border-collapse:
        collapse;

}


.ck-content table td,
.ck-content table th {

    padding:
        9px 12px;

    border:
        1px solid var(--titan-editor-border-light);

}


.ck-content table th {

    background:
        var(--titan-editor-panel);

    color:
        #ffffff;

    font-weight:
        700;

}


.ck-content table td {

    background:
        var(--titan-editor-bg);

}


/* ============================================================================
   HORIZONTAL RULE
   ============================================================================ */

.ck-content hr {

    margin:
        25px 0;

    border:
        0;

    border-top:
        1px solid var(--titan-editor-border);

}


/* ============================================================================
   FONT DROPDOWNS
   ============================================================================ */

.ck-font-family-dropdown .ck-button {

    min-width:
        150px;

}


.ck-font-size-dropdown .ck-button {

    min-width:
        105px;

}


/* ============================================================================
   COLOR DROPDOWNS
   ============================================================================ */

.ck-color-grid {

    display:
        grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap:
        4px;

    padding:
        6px;

}


.ck-color-grid .ck-button {

    min-width:
        30px;

    width:
        30px;

    height:
        30px;

    padding:
        0;

}


/* ============================================================================
   SOURCE EDITING
   ============================================================================ */

.ck-source-editing-area {

    display:
        block;

    width:
        100%;

    background:
        #08080d !important;

}


.ck-source-editing-area textarea {

    display:
        block;

    width:
        100%;

    min-height:
        280px;

    margin:
        0;

    padding:
        20px;

    background:
        #08080d !important;

    color:
        #e7e7ec !important;

    border:
        0 !important;

    outline:
        none !important;

    resize:
        vertical;

    font-family:
        Consolas,
        Monaco,
        monospace !important;

    font-size:
        14px !important;

    line-height:
        1.6 !important;

}


/* ============================================================================
   MENTION DROPDOWN
   ============================================================================ */

.ck.ck-mentions {

    min-width:
        220px;

    max-width:
        320px;

    padding:
        5px;

    background:
        var(--titan-editor-panel) !important;

    border:
        1px solid var(--titan-editor-border) !important;

    border-radius:
        8px;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, .45);

}


.ck.ck-mentions .ck-list {

    background:
        var(--titan-editor-panel) !important;

}


.ck.ck-mentions .ck-list__item .ck-button {

    color:
        var(--titan-editor-text) !important;

}


/* ============================================================================
   SPOILER - EDITOR
   ============================================================================ */

.titan-editor-spoiler {

    display:
        block;

    margin:
        18px 0;

    padding:
        0;

    border:
        1px solid var(--titan-editor-border);

    border-radius:
        8px;

    background:
        var(--titan-editor-panel);

    overflow:
        hidden;

}


.titan-editor-spoiler__header {

    display:
        block;

    padding:
        11px 14px;

    background:
        var(--titan-editor-panel-2);

    color:
        var(--titan-editor-text);

    font-weight:
        700;

}


/* ============================================================================
   SPOILER - OUTPUT
   ============================================================================ */

.titan-wysiwyg-spoiler {

    display:
        block;

    margin:
        18px 0;

    padding:
        12px 15px;

    border:
        1px solid var(--titan-editor-border);

    border-radius:
        8px;

    background:
        var(--titan-editor-panel);

}


.titan-wysiwyg-spoiler summary {

    cursor:
        pointer;

    color:
        var(--titan-editor-text);

    font-weight:
        700;

    user-select:
        none;

}


.titan-wysiwyg-spoiler[open] summary {

    padding-bottom:
        10px;

    margin-bottom:
        12px;

    border-bottom:
        1px solid var(--titan-editor-border);

}


/* ============================================================================
   SELECTION
   ============================================================================ */

.ck-content ::selection {

    background:
        rgba(88, 101, 242, .35);

}


/* ============================================================================
   UPLOAD / ATTACHMENTS
   ============================================================================ */

.titan-editor-attachments {

    margin-top:
        15px;

}


/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 900px) {

    .ck.ck-toolbar {

        overflow-x:
            auto;

        flex-wrap:
            nowrap;

    }

    .ck.ck-toolbar__items {

        flex-wrap:
            nowrap;

        width:
            max-content;

    }

}


@media (max-width: 600px) {

    .ck-editor__editable_inline {

        min-height:
            220px;

        padding:
            15px !important;

    }

    .ck.ck-toolbar {

        min-height:
            42px;

        padding:
            5px !important;

    }

    .ck.ck-button {

        min-width:
            30px;

        min-height:
            30px;

        padding:
            4px 6px;

    }

    .ck.ck-button .ck-icon {

        width:
            18px;

        height:
            18px;

        min-width:
            18px;

        min-height:
            18px;

    }

}
/* TITAN Board Rev7: keep inline images readable inside the editor canvas. */
.ck-content img.titan-inline-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 8px;
}
