/* Darstellung formatierter Freitexte (Rich-Text-Editor, Kap. 22).
 *
 * Tailwinds Preflight-Reset entfernt Listenpunkte und Absatzabstände.
 * Diese Datei stellt sie für die beiden betroffenen Kontexte wieder her:
 *   1. den Editor selbst ([data-richtext-area], contenteditable)
 *   2. die Anzeige gespeicherter Inhalte (.prose — das Typography-Plugin
 *      ist nicht installiert, die Klasse dient nur als Marker)
 * Als statische Datei ausgeliefert, damit kein Asset-Build nötig ist;
 * die CSP (style-src 'self') erlaubt eigene Stylesheets.
 */

[data-richtext-area] ul,
.prose ul {
    list-style: disc outside;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

[data-richtext-area] ol,
.prose ol {
    list-style: decimal outside;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

[data-richtext-area] li,
.prose li {
    margin: 0.125rem 0;
}

[data-richtext-area] li > ul,
[data-richtext-area] li > ol,
.prose li > ul,
.prose li > ol {
    margin: 0.125rem 0;
}

[data-richtext-area] p,
.prose p {
    margin: 0.5rem 0;
}

[data-richtext-area] > :first-child,
.prose > :first-child {
    margin-top: 0;
}

[data-richtext-area] > :last-child,
.prose > :last-child {
    margin-bottom: 0;
}

/* --- Tag-Auswahl (Chips + Suchvorschläge, public/tag-select.js) --- */

.tagselect { position: relative; }

.tagselect-box {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    margin-top: 0.25rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--color-border, #d4d4d4);
    border-radius: 0.25rem;
    background: var(--color-surface, #fff);
    cursor: text;
}

.tagselect-box:focus-within {
    border-color: var(--color-accent, #b91c1c);
    outline: 1px solid var(--color-accent, #b91c1c);
}

.tagselect-chips { display: contents; }

.tagselect-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem 0.125rem 0.5rem;
    border-radius: 9999px;
    background: var(--color-accent-subtle, #fee2e2);
    color: var(--color-accent, #991b1b);
    font-size: 0.85rem;
    line-height: 1.4;
}

.tagselect-remove {
    border: 0;
    background: none;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.125rem;
}

.tagselect-remove:hover { opacity: 0.7; }

.tagselect-input {
    flex: 1;
    min-width: 8rem;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    padding: 0.125rem;
    color: inherit;
}

.tagselect-list {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    margin: 0.25rem 0 0;
    padding: 0.25rem;
    list-style: none;
    border: 1px solid var(--color-border, #d4d4d4);
    border-radius: 0.25rem;
    background: var(--color-surface, #fff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    max-height: 14rem;
    overflow-y: auto;
}

.tagselect-option {
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.tagselect-option:hover,
.tagselect-option.is-active {
    background: var(--color-accent-subtle, #fee2e2);
    color: var(--color-accent, #991b1b);
}
