/* AstroClassifieds forum rich-text composer and safe post formatting */
.forum-composer {
    border: 1px solid #d9e0ea;
    border-radius: 0.85rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.forum-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.65rem;
    border-bottom: 1px solid #e5eaf1;
    background: linear-gradient(180deg, #f9fbfd 0%, #f3f6fa 100%);
}

.forum-editor-btn {
    width: 2.35rem;
    height: 2.2rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.forum-editor-btn:hover,
.forum-editor-btn:focus-visible {
    background: #fff;
    border-color: #cfd8e5;
    color: var(--color-primary, #0d6efd);
    outline: none;
}

.forum-editor-divider {
    width: 1px;
    height: 1.6rem;
    background: #d8e0ea;
    margin: 0 0.2rem;
}

.forum-color-control {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.2rem;
    padding: 0 0.45rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    color: #334155;
}

.forum-color-control:hover {
    background: #fff;
    border-color: #cfd8e5;
}

.forum-color-control select {
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.forum-editor-textarea.form-control {
    border: 0;
    border-radius: 0;
    min-height: 11rem;
    resize: vertical;
    box-shadow: none !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    padding: 0.9rem 1rem;
}

.forum-editor-textarea.form-control:focus {
    background: #fff;
}

.forum-editor-help {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    padding: 0.55rem 0.8rem;
    border-top: 1px solid #edf1f5;
    background: #fbfcfe;
    color: #64748b;
    font-size: 0.76rem;
}

.forum-editor-help i {
    color: #198754;
    margin-right: 0.2rem;
}

.forum-post-content {
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: normal;
}

.forum-post-content p {
    margin: 0 0 0.9rem;
}

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

.forum-post-content a {
    color: var(--color-primary, #0d6efd);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.forum-post-content a:hover {
    text-decoration-thickness: 2px;
}

.forum-post-content ul,
.forum-post-content ol {
    margin: 0.7rem 0 0.9rem 1.35rem;
    padding-left: 0.7rem;
}

.forum-post-content li + li {
    margin-top: 0.25rem;
}

.forum-post-content blockquote {
    margin: 0.9rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--color-primary, #0d6efd);
    border-radius: 0 0.55rem 0.55rem 0;
    background: #f7f9fc;
    color: #475569;
}

.forum-post-content strong {
    font-weight: 700;
}

@media (max-width: 576px) {
    .forum-editor-toolbar {
        gap: 0.2rem;
        padding: 0.45rem;
    }

    .forum-editor-btn {
        width: 2.15rem;
        height: 2.05rem;
    }

    .forum-editor-divider {
        margin: 0 0.05rem;
    }

    .forum-color-control {
        padding: 0 0.25rem;
    }

    .forum-color-control select {
        max-width: 5rem;
    }

    .forum-editor-help {
        display: block;
    }

    .forum-editor-help span {
        display: block;
        margin-bottom: 0.2rem;
    }
}

/* Safe rich-text content inside classified listing descriptions. */
.listing-description {
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: normal;
    color: var(--color-text, #1e293b);
}

.listing-description p {
    margin: 0 0 0.9rem;
}

.listing-description p:last-child {
    margin-bottom: 0;
}

.listing-description a {
    color: var(--color-primary, #0d6efd);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.listing-description a:hover {
    text-decoration-thickness: 2px;
}

.listing-description ul,
.listing-description ol {
    margin: 0.7rem 0 0.9rem 1.35rem;
    padding-left: 0.7rem;
}

.listing-description li + li {
    margin-top: 0.25rem;
}

.listing-description blockquote {
    margin: 0.9rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--color-primary, #0d6efd);
    border-radius: 0 0.55rem 0.55rem 0;
    background: #f7f9fc;
    color: #475569;
}

.listing-description strong {
    font-weight: 700;
}

