/*
 * Typography for rendered /insights article bodies.
 *
 * show.php used to tag the body with Tailwind Typography classes
 * (prose prose-stone prose-lg), but the typography plugin is not part of the
 * app.css build, so every article rendered as unstyled running text: no
 * heading sizes, no paragraph spacing, no list bullets. "max-w-none" also
 * cancelled the max-w-3xl reading column, so copy ran the full window width.
 *
 * This is hand written so it does not depend on the Tailwind build. Palette
 * matches the site: stone for text, primary (copper) for links.
 */

.article-body {
    color: var(--color-stone-700, #44403c);
    font-size: 1.0625rem;
    line-height: 1.75;
}

.article-body > *:first-child {
    margin-top: 0;
}

.article-body p {
    margin: 1.25em 0;
}

.article-body h2 {
    margin: 2.25em 0 0.75em;
    font-size: 1.6rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--color-stone-900, #1c1917);
    scroll-margin-top: 6rem;
}

.article-body h3 {
    margin: 1.75em 0 0.6em;
    font-size: 1.25rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--color-stone-900, #1c1917);
    scroll-margin-top: 6rem;
}

.article-body h4 {
    margin: 1.5em 0 0.5em;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-stone-900, #1c1917);
    scroll-margin-top: 6rem;
}

.article-body ul,
.article-body ol {
    margin: 1.25em 0;
    padding-left: 1.5rem;
}

.article-body ul { list-style: disc outside; }
.article-body ol { list-style: decimal outside; }

.article-body li {
    margin: 0.5em 0;
    padding-left: 0.25rem;
}

.article-body li::marker {
    color: var(--color-stone-400, #a8a29e);
}

.article-body li > ul,
.article-body li > ol {
    margin: 0.5em 0;
}

.article-body a {
    color: var(--color-primary-600, #9a5d28);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--color-primary-200, #f5d0a9);
    transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.article-body a:hover {
    color: var(--color-primary-700, #7c4a20);
    text-decoration-color: currentColor;
}

.article-body strong {
    font-weight: 700;
    color: var(--color-stone-900, #1c1917);
}

.article-body em { font-style: italic; }

.article-body blockquote {
    margin: 1.75em 0;
    padding: 0.25em 0 0.25em 1.25rem;
    border-left: 3px solid var(--color-primary-200, #f5d0a9);
    color: var(--color-stone-600, #57534e);
    font-style: italic;
}

.article-body blockquote p:first-child { margin-top: 0; }
.article-body blockquote p:last-child { margin-bottom: 0; }

.article-body code {
    padding: 0.15em 0.4em;
    border-radius: 0.35rem;
    background: var(--color-stone-100, #f5f5f4);
    color: var(--color-stone-800, #292524);
    font-size: 0.9em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.article-body pre {
    margin: 1.5em 0;
    padding: 1rem 1.15rem;
    border-radius: 0.75rem;
    background: var(--color-stone-900, #1c1917);
    color: #f5f5f4;
    overflow-x: auto;
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-body pre code {
    padding: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

/* Tables can be wider than the column, so let them scroll rather than
   forcing a horizontal scrollbar on the whole page. */
.article-body table {
    display: block;
    width: 100%;
    margin: 1.75em 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.article-body th,
.article-body td {
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--color-cb, #e7e5e4);
    text-align: left;
    vertical-align: top;
}

.article-body th {
    background: var(--color-stone-50, #fafaf9);
    font-weight: 600;
    color: var(--color-stone-900, #1c1917);
}

.article-body img {
    max-width: 100%;
    height: auto;
    margin: 1.75em 0;
    border-radius: 0.75rem;
}

.article-body hr {
    margin: 2.5em 0;
    border: 0;
    border-top: 1px solid var(--color-cb, #e7e5e4);
}

@media (min-width: 640px) {
    .article-body { font-size: 1.125rem; }
    .article-body h2 { font-size: 1.875rem; }
    .article-body h3 { font-size: 1.375rem; }
}
