/*
 * Article body styles: the single source of truth for how SmartWalt blog post
 * content looks.
 *
 * Used by the website (src/app/(pages)/blog/[slug]/ArticleBody.tsx wraps the
 * post body in .article-body and emits the .ab-* wrappers below) and by the
 * admin panel's Preview, which loads this file from
 * https://www.smartwalt.com/article.css and builds the same markup. Change
 * article formatting here, and both follow.
 *
 * Values reproduce the blog's previous .prose rendering (globals.css).
 * Colours are literal so the file also works outside the website.
 */
.article-body {
    --ab-text: #15201D;
    --ab-heading: #15201D;
    --ab-muted: #5A655F;
    --ab-border: #E3DFD3;
    --ab-surface: #F7F5EF;
    --ab-surface-alt: #EFECE4;
    --ab-accent: #E8A23A;
    --ab-link: #946008;
    --ab-link-hover: #D99026;
    --ab-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    font-family: var(--font-inter, ui-sans-serif), system-ui, sans-serif;
    font-size: 1.25rem;
    line-height: 2;
    color: var(--ab-text);
    overflow-wrap: break-word;
}
/* Paragraphs are rendered as <div class="ab-p"> (avoids invalid <p> nesting). */
.article-body .ab-p {
    margin: 0 0 2rem;
    font-size: 1.25rem;
    line-height: 2;
    color: var(--ab-text);
}
.article-body :is(h2, h3, h4, h5, h6) {
    font-family: var(--font-bricolage, var(--font-inter, ui-sans-serif)), sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ab-heading);
}
.article-body h2 { font-size: 1.5rem; line-height: 1.3; margin: 2.5rem 0 1rem; }
.article-body h3 { font-size: 1.375rem; line-height: 1.35; margin: 2rem 0 0.75rem; }
.article-body :is(h4, h5, h6) { font-size: 1.25rem; line-height: 1.4; margin: 1.75rem 0 0.75rem; }
.article-body :is(b, strong) { font-weight: 700; color: var(--ab-heading); }
.article-body :is(i, em) { font-style: italic; }
.article-body :is(ul, ol) {
    margin: 1.5rem 0 2rem;
    padding-left: 1.625rem;
    color: var(--ab-text);
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body :is(ul, ol) > :not(:last-child) { margin-bottom: 0.5rem; }
.article-body li {
    padding-left: 0.375rem;
    font-size: 1.25rem;
    line-height: 2;
}
.article-body li::marker { color: var(--ab-accent); }
.article-body li .ab-p { margin-bottom: 0.5rem; }
.article-body li .ab-p:last-child { margin-bottom: 0; }
.article-body blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2.5rem;
    border-left: 4px solid var(--ab-accent);
    border-radius: 0 0.75rem 0.75rem 0;
    background: var(--ab-surface);
    color: var(--ab-text);
    font-size: 1.25rem;
    font-weight: 500;
}
.article-body blockquote .ab-p:last-child { margin-bottom: 0; }
.article-body a {
    color: var(--ab-link);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.article-body a:hover { color: var(--ab-link-hover); text-decoration: underline; text-underline-offset: 2px; }
.article-body code {
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--ab-surface-alt);
    color: var(--ab-link);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875em;
}
.article-body pre {
    margin: 2rem 0;
    padding: 1.5rem;
    overflow-x: auto;
    border-radius: 0.75rem;
    background: #12151C;
    color: #ECEEF3;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre;
    overflow-wrap: normal;
}
/* Block code inherits the dark panel; inline code keeps its own highlight. */
.article-body pre code {
    display: block;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    white-space: inherit;
}
.article-body hr { height: 0; margin: 2.5rem 0; border: 0; border-top: 1px solid var(--ab-border); }
/* Tables scroll sideways on small screens instead of squeezing columns. */
.article-body .ab-table {
    margin: 2rem 0;
    overflow-x: auto;
    border: 1px solid var(--ab-border);
    border-radius: 0.75rem;
    background: #FFFFFF;
}
.article-body table { width: 100%; min-width: 560px; border-collapse: collapse; text-align: left; }
.article-body tr { border-bottom: 1px solid var(--ab-border); }
.article-body tr:last-child { border-bottom: 0; }
.article-body tr:nth-child(even) { background: rgb(247 245 239 / 0.6); }
.article-body :is(th, td) { padding: 0.75rem 1rem; vertical-align: top; border-right: 1px solid var(--ab-border); }
.article-body :is(th, td):last-child { border-right: 0; }
.article-body th { background: var(--ab-surface-alt); font-size: 1rem; font-weight: 700; color: var(--ab-heading); line-height: 1.5; }
.article-body td { font-size: 1.0625rem; line-height: 1.7; color: var(--ab-text); }
.article-body .ab-cell-p { margin-bottom: 0.5rem; }
.article-body .ab-cell-p:last-child { margin-bottom: 0; }
.article-body :is(.ab-img, .ab-video) {
    margin: 4rem 0;
    overflow: hidden;
    border: 1px solid var(--ab-border);
    border-radius: 1.5rem;
    box-shadow: var(--ab-shadow);
}
.article-body .ab-img img { display: block; width: 100%; max-width: 100%; height: auto; }
.article-body .ab-video { aspect-ratio: 16 / 9; }
.article-body .ab-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.article-body .ab-svg { margin: 2rem 0; overflow-x: auto; }
.article-body .ab-svg svg { max-width: 100%; height: auto; }
/* Lead text: the introduction of AI-generated posts that keep it separately. */
.article-body.ab-lead .ab-p { font-size: 1.5rem; line-height: 1.75; font-weight: 500; }
/* "Key Takeaway" box: the conclusion of AI-generated posts that keep it separately. */
.article-body.ab-takeaway, .article-body.ab-takeaway .ab-p { color: var(--ab-muted); font-size: 1.125rem; }
.article-body.ab-takeaway .ab-p:last-child { margin-bottom: 0; }
@media (max-width: 768px) {
    .article-body, .article-body .ab-p, .article-body li { font-size: 1.125rem; line-height: 1.875; }
    .article-body h2 { font-size: 1.375rem; margin-top: 2rem; }
    .article-body h3 { font-size: 1.25rem; margin-top: 1.75rem; }
    .article-body.ab-lead .ab-p { font-size: 1.25rem; }
}
