/* ── Ghost Prose: rendered markdown content styling for V2 ── */

/* Paragraphs */
.ghost-prose p {
    margin: 0 0 0.5rem 0;
}
.ghost-prose p:last-child {
    margin-bottom: 0;
}

/* Headers */
.ghost-prose h1,
.ghost-prose h2,
.ghost-prose h3,
.ghost-prose h4,
.ghost-prose h5,
.ghost-prose h6 {
    margin: 0.75rem 0 0.25rem 0;
    font-weight: 600;
    color: var(--ghost-text);
}
.ghost-prose h1 { font-size: 1.35rem; }
.ghost-prose h2 { font-size: 1.2rem; }
.ghost-prose h3 { font-size: 1.08rem; }
.ghost-prose h4 { font-size: 1rem; }

/* Bold / Strong */
.ghost-prose strong {
    font-weight: 700;
    color: var(--ghost-text);
}

/* Italic */
.ghost-prose em {
    font-style: italic;
}

/* Strikethrough */
.ghost-prose del {
    text-decoration: line-through;
    opacity: 0.6;
}

/* Links */
.ghost-prose a {
    color: var(--ghost-accent);
    text-decoration: none;
    transition: text-decoration 0.15s;
}
.ghost-prose a:hover {
    text-decoration: underline;
}

/* Lists */
.ghost-prose ul,
.ghost-prose ol {
    margin: 0.25rem 0 0.5rem 0;
    padding-left: 1.5rem;
}
.ghost-prose ul { list-style-type: disc; }
.ghost-prose ol { list-style-type: decimal; }
.ghost-prose ul ul { list-style-type: circle; }
.ghost-prose ol ol { list-style-type: lower-alpha; }
.ghost-prose li {
    margin-bottom: 0.15rem;
}

/* Horizontal rule */
.ghost-prose hr {
    border: none;
    border-top: 1px solid var(--ghost-border);
    margin: 0.75rem 0;
}

/* Inline code */
.ghost-prose code {
    background-color: var(--ghost-surface);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--ghost-text);
}

/* Code blocks (pre) */
.ghost-prose pre {
    background-color: var(--ghost-bg);
    border: 1px solid var(--ghost-border);
    border-radius: 0 0 8px 8px;
    padding: 0.75rem 1rem;
    margin: 0;
    overflow-x: auto;
}
.ghost-prose pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.82em;
    color: var(--ghost-muted);
}

/* Code block wrapper (header bar + copy button) */
.ghost-prose .code-block-wrapper {
    margin: 0.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--ghost-border);
}
.ghost-prose .code-block-wrapper pre {
    border: none;
    border-radius: 0;
    margin: 0;
}
.ghost-prose .code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.75rem;
    background-color: var(--ghost-surface);
    font-size: 0.75rem;
}
.ghost-prose .code-lang {
    color: var(--ghost-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.ghost-prose .code-copy-btn {
    background: none;
    border: 1px solid var(--ghost-border);
    border-radius: 4px;
    color: var(--ghost-muted);
    font-size: 0.7rem;
    padding: 0.1rem 0.5rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.ghost-prose .code-copy-btn:hover {
    color: var(--ghost-text);
    border-color: var(--ghost-muted);
}

/* KaTeX display blocks */
.ghost-prose .katex-display {
    margin: 0.75rem 0;
    overflow-x: auto;
}

/* KaTeX pending (fallback before JS renders) */
.ghost-prose .katex-pending {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85em;
    color: var(--ghost-muted);
}
