/* ── WYSIWYG-Editor ──────────────────────────────────────────────────────── */

.wysiwyg-wrapper {
    background: #fff;
    overflow: hidden;
}

/* Toolbar */
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.wysiwyg-toolbar .btn-group {
    flex-shrink: 0;
}

.wysiwyg-toolbar .btn {
    padding: 2px 8px;
    font-size: 0.8rem;
    line-height: 1.5;
    border-radius: 3px !important;
    min-width: 28px;
}

.wysiwyg-toolbar .btn.active {
    background-color: #d1d3d4;
    border-color: #9a9d9f;
    color: #212529;
}

.wysiwyg-toolbar .btn:focus {
    box-shadow: none;
}

/* Editor-Bereich */
.wysiwyg-content {
    min-height: 160px;
    max-height: 420px;
    overflow-y: auto;
    padding: 10px 14px;
    outline: none;
    line-height: 1.6;
    color: #212529;
    font-size: 0.95rem;
}

.wysiwyg-content:focus {
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25) inset;
}

/* Inhalt-Elemente */
.wysiwyg-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 4px;
}

.wysiwyg-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 0.6rem;
    margin-bottom: 0.3rem;
}

.wysiwyg-content blockquote {
    border-left: 4px solid #ced4da;
    margin: 0.5rem 0;
    padding: 0.4rem 1rem;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.wysiwyg-content pre {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    overflow-x: auto;
}

.wysiwyg-content code {
    background: #f1f3f5;
    border-radius: 3px;
    padding: 0.1em 0.4em;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 85%;
}

.wysiwyg-content ul,
.wysiwyg-content ol {
    padding-left: 1.6rem;
    margin-bottom: 0.5rem;
}

.wysiwyg-content li + li {
    margin-top: 2px;
}

.wysiwyg-content a {
    color: #007bff;
    text-decoration: underline;
}

.wysiwyg-content a:hover {
    color: #0056b3;
}

.wysiwyg-content p:last-child {
    margin-bottom: 0;
}

/* Platzhalterstil wenn leer */
.wysiwyg-content:empty::before {
    content: attr(data-placeholder);
    color: #adb5bd;
    pointer-events: none;
}
