/* Article text — posts, portal pages (privacy, terms, about) and tenant pages.
   Loaded by templates/base.html and templates/common/head.html through
   {% header_asset 'css/article.css' %} (TASK.md Task 52). Replaces the rules that lived
   inline in common/head.html, which base.html never loaded.
   Tokens match the portal header (static/css/portal-header.css). */

.prose {
    --art-ink: #232323;
    --art-body: #2f3237;
    --art-mute: #6b6f76;
    --art-rule: #e6e6e4;
    --art-wash: #f6f6f4;
    --art-seal: #b81828;
    --art-link: #1f5fbf;
    --art-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --art-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", STSong, SimSun,
        Georgia, serif;

    max-width: 42em !important;
    color: var(--art-body) !important;
    font-family: var(--art-sans) !important;
    font-size: 1.0625rem !important; /* 17px */
    line-height: 1.85 !important;
    letter-spacing: 0.01em;
    overflow-wrap: break-word;
}

.prose.max-w-none {
    max-width: 42em !important;
}

/* ---- Paragraphs and inline text ---- */

.prose p {
    margin: 0 0 1.2em !important;
    line-height: 1.85 !important;
    color: var(--art-body);
}

.prose > :first-child {
    margin-top: 0 !important;
}

.prose > :last-child {
    margin-bottom: 0 !important;
}

.prose strong,
.prose b {
    color: var(--art-ink) !important;
    font-weight: 600 !important;
}

.prose a,
.prose a:visited {
    color: var(--art-link) !important;
    text-decoration: underline !important;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

.prose a:hover {
    color: var(--art-seal) !important;
}

.prose s,
.prose strike,
.prose del {
    color: #9ca3af;
    text-decoration: line-through;
}

/* ---- Headings ---- */

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    margin: 2em 0 0.7em !important;
    color: var(--art-ink) !important;
    font-family: var(--art-serif) !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    letter-spacing: 0.02em !important;
}

.prose h1 { font-size: 1.85rem !important; }
.prose h2 {
    padding-bottom: 0.4em;
    border-bottom: 1px solid var(--art-rule);
    font-size: 1.5rem !important;
}
.prose h3 {
    padding-left: 0.6em;
    border-left: 3px solid var(--art-seal);
    font-size: 1.25rem !important;
}
.prose h4 { font-size: 1.125rem !important; }
.prose h5,
.prose h6 {
    color: var(--art-mute) !important;
    font-size: 1rem !important;
}

/* A heading straight after a divider does not need the extra space. */
.prose hr + h2,
.prose hr + h3 {
    margin-top: 0.5em !important;
}

/* ---- Lists (Tailwind's reset removes the markers) ---- */

.prose ul,
.prose ol {
    margin: 0.4em 0 1.3em !important;
    padding-left: 1.6em !important;
}

.prose ul {
    list-style-type: disc !important;
}

.prose ol {
    list-style-type: decimal !important;
}

.prose li {
    display: list-item !important;
    margin: 0 0 0.5em !important;
    padding-left: 0.25em;
    line-height: 1.8 !important;
}

.prose li::marker {
    color: var(--art-seal);
}

.prose ol > li::marker {
    font-weight: 600;
}

.prose li > ul,
.prose li > ol {
    margin: 0.5em 0 0.2em !important;
}

.prose ul ul { list-style-type: circle !important; }
.prose ul ul ul { list-style-type: square !important; }

/* ---- Block elements ---- */

.prose hr {
    margin: 2.2em 0 !important;
    border: 0 !important;
    border-top: 1px solid var(--art-rule) !important;
}

.prose blockquote {
    margin: 1.5em 0 !important;
    padding: 0.8em 1.2em !important;
    border-left: 3px solid var(--art-seal) !important;
    background: var(--art-wash);
    color: #4a4e55 !important;
    font-style: normal !important;
}

.prose blockquote p:last-child {
    margin-bottom: 0 !important;
}

.prose code {
    padding: 0.15em 0.4em;
    border-radius: 4px;
    background: #f1f2f4;
    color: #b0213a;
    font-family: Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
}

.prose pre {
    margin: 1.5em 0 !important;
    padding: 1em 1.2em;
    overflow-x: auto;
    border-radius: 6px;
    background: #1f2328;
    color: #e6e6e6;
    font-size: 0.88em;
    line-height: 1.6;
}

.prose pre code {
    padding: 0;
    background: none;
    color: inherit;
}

.prose table {
    display: block;
    width: 100%;
    margin: 1.5em 0 !important;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95em;
}

.prose th,
.prose td {
    padding: 0.55em 0.8em;
    border: 1px solid var(--art-rule);
    text-align: left;
    vertical-align: top;
}

.prose th {
    background: var(--art-wash);
    color: var(--art-ink);
    font-weight: 600;
}

/* ---- Images and figures ---- */

.prose img {
    max-width: 100%;
    height: auto;
    margin: 1.8em auto !important;
    border-radius: 6px;
}

.prose figure.custom-editor-figure {
    display: table;
    max-width: 100%;
    margin: 1.8em auto !important;
}

.prose figure.custom-editor-figure img {
    margin: 0 !important;
}

.prose figcaption,
.prose figcaption.custom-editor-caption {
    margin-top: 0.6em;
    color: var(--art-mute) !important;
    font-size: 0.8125rem !important;
    line-height: 1.5;
    text-align: center;
}

/* ---- Protected email links (static/js/email-protect.js) ---- */

.prose .js-email {
    white-space: nowrap;
}

/* ---- Small screens ---- */

@media (max-width: 768px) {
    .prose {
        font-size: 1rem !important;
        line-height: 1.8 !important;
    }

    .prose h1 { font-size: 1.6rem !important; }
    .prose h2 { font-size: 1.35rem !important; }
    .prose h3 { font-size: 1.15rem !important; }
}
