/*
 * Copyright (c) Yurii Temniuk 2026-2026.
 */
.editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.editor-pane {
    position: relative;
    min-width: 0;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 4px;
    overflow: hidden;
}

.editor-pane-header {
    padding: 10px 12px;
    background: #f0f0f0;
    border-bottom: 1px solid #ccc;
    font-weight: 600;
}

.editor-pane textarea {
    display: block;
    width: 100%;
    min-height: 600px;
    padding: 16px;
    border: 0;
    border-radius: 0;
    resize: vertical;
    font-family: monospace;
    line-height: 1.5;
}

.wiki-link-suggestions {
    position: absolute;
    left: 12px;
    right: 12px;
    top: 56px;
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.wiki-link-suggestion {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid #eee;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.wiki-link-suggestion:last-child {
    border-bottom: 0;
}

.wiki-link-suggestion:hover,
.wiki-link-suggestion.selected {
    background: #f0f0f0;
}

.wiki-link-suggestion-title {
    font-weight: 600;
}

.wiki-link-suggestion-slug {
    margin-top: 2px;
    color: #777;
    font-size: 12px;
    font-family: monospace;
}

.preview-placeholder {
    color: #999;
}

.preview-error {
    color: #b00020;
}

@media (max-width: 800px) {
    .editor {
        grid-template-columns: 1fr;
    }

    .editor-pane textarea {
        min-height: 400px;
    }
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
}


/* Long-article editing: keep the editor and preview large and aligned. */
.editor {
    align-items: stretch;
}

.editor-pane {
    display: flex;
    flex-direction: column;
    height: 78vh;
    min-height: 620px;
    max-height: 1100px;
}

.editor-pane-header,
.editor-toolbar {
    flex: 0 0 auto;
}

.editor-toolbar {
    flex-wrap: wrap;
}

.editor-pane textarea {
    flex: 1 1 0;
    width: 100%;
    height: 0;
    min-height: 0;
    resize: none;
    overflow: auto;
    box-sizing: border-box;
}

.editor-pane .markdown-body {
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    overflow: auto;
    box-sizing: border-box;
}

@media (max-width: 800px) {
    .editor-pane {
        height: 70vh;
        min-height: 460px;
        max-height: none;
    }
}
