/**
 * Content Styles for HTML Rendering
 *
 * These styles ensure that HTML content from rich text editors
 * is displayed correctly in the frontend.
 */

/* Base styles for prose content */
.prose {
    color: var(--color-text-primary);
    max-width: 65ch;
    font-size: 1rem;
    line-height: 1.75;
}

.prose-invert {
    color: var(--color-text-primary);
}

/* Headings */
.prose h1 {
    font-size: 2rem;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 700;
    line-height: 1.3;
}

.prose h2 {
    font-size: 1.5rem;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 700;
    line-height: 1.3;
}

.prose h3 {
    font-size: 1.25rem;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 600;
    line-height: 1.3;
}

.prose h4 {
    font-size: 1.125rem;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    font-weight: 600;
    line-height: 1.3;
}

/* Paragraphs */
.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
}

/* Lists */
.prose ul {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
    list-style-type: disc !important;
    display: block !important;
}

.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
    list-style-type: decimal !important;
    display: block !important;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 0.375em;
    display: list-item !important;
}

.prose li::marker {
    color: var(--color-text-tertiary);
}

/* Force display of list items */
.prose ul li::before {
    content: "•";
    color: var(--color-text-tertiary);
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Nested lists */
.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

/* Blockquotes */
.prose blockquote {
    font-style: italic;
    border-left: 4px solid var(--color-primary);
    padding-left: 1em;
    margin-left: 0;
    margin-right: 0;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

/* Code blocks */
.prose pre {
    background-color: var(--color-dark-surface2);
    border-radius: 0.375rem;
    padding: 1em;
    overflow-x: auto;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
}

.prose code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background-color: var(--color-dark-surface2);
    padding: 0.2em 0.4em;
    border-radius: 0.25em;
}

/* Links */
.prose a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: var(--color-primary-light);
}

/* Images */
.prose img {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-radius: 0.375rem;
    max-width: 100%;
}

/* Tables */
.prose table {
    width: 100%;
    table-layout: auto;
    text-align: left;
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-collapse: collapse;
}

.prose thead {
    border-bottom: 1px solid var(--color-border);
}

.prose th {
    padding: 0.75em;
    font-weight: 600;
    vertical-align: bottom;
}

.prose td {
    padding: 0.75em;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}

/* Light mode overrides */
html[data-theme="light"] .prose-invert {
    color: var(--color-light-text);
}

html[data-theme="light"] .prose code,
html[data-theme="light"] .prose pre {
    background-color: var(--color-light-surface2);
}

html[data-theme="light"] .prose li::marker {
    color: var(--color-light-text-tertiary);
}

/* Max width override */
.max-w-none {
    max-width: none !important;
}
