/* Rendered-markdown styles, ported from cashmere-marketing
 * packages/ui/src/globals.css `.prose-blog` (the class its blog and support
 * articles use). Upstream authors these with Tailwind `@apply`; the directives
 * are resolved to plain CSS here so Django can serve them without a Tailwind
 * build.
 *
 * Scale used, from packages/ui/tailwind-preset.ts:
 *   text-14/16/18/20/24/32/40 -> 0.875/1/1.125/1.25/1.5/2/2.5rem
 *   leading-1.1/1.3 -> 1.1/1.3;  leading-relaxed -> 1.625 (Tailwind default)
 *   rounded-30 -> 30px;  rounded -> 0.25rem;  md: -> 768px
 *
 * Spacing is the one trap: upstream's `spacing` scale is PIXEL-named
 * (8 -> 0.5rem, 16 -> 1rem, ...), so `mt-8` is 8px while `mt-12`/`mt-10`/`mt-6`
 * fall through to Tailwind's rem defaults (3rem/2.5rem/1.5rem). The mix is
 * inconsistent upstream; it is reproduced faithfully so this matches what the
 * marketing site actually renders.
 *
 * `table`/`th`/`td`/`hr` have no upstream equivalent -- the guides use Markdown
 * tables (the `tables` extension is on) where the blog does not, so those rules
 * are derived from the same tokens rather than ported.
 */

.prose-blog {
    color: hsl(var(--color-text));
    overflow-x: hidden;
    max-width: 100%;
}

.prose-blog h1,
.prose-blog h2,
.prose-blog h3,
.prose-blog h4,
.prose-blog h5 {
    font-family: var(--font-space-grotesk);
    color: hsl(var(--foreground));
}

.prose-blog h1 {
    font-size: 2rem;
    line-height: 1.1;
    margin-top: 3rem;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.prose-blog h2 {
    font-size: 1.5rem;
    line-height: 1.1;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.prose-blog h3 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.3;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.prose-blog h4 {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.3;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.prose-blog h5 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.3;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.prose-blog p {
    font-size: 1rem;
    line-height: 1.625;
    margin-bottom: 1.5rem;
    color: hsl(var(--foreground));
}

.prose-blog a {
    color: hsl(var(--color-accent-5));
    border-bottom: 1px solid hsl(var(--color-accent-5));
    text-decoration: none;
    transition: opacity 0.15s ease-in-out;
}

.prose-blog a:hover {
    opacity: 0.75;
}

.prose-blog ul,
.prose-blog ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.prose-blog ul > * + *,
.prose-blog ol > * + * {
    margin-top: 0.5rem;
}

.prose-blog li {
    font-size: 1rem;
    line-height: 1.625;
    color: hsl(var(--foreground));
}

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

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

.prose-blog blockquote {
    border-left: 4px solid hsl(var(--color-primary-2));
    padding-left: 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    font-size: inherit;
    line-height: 1.6;
    color: hsl(var(--color-gray-2));
}

.prose-blog code {
    font-family: var(--font-dm-mono);
    font-size: 0.875rem;
    background-color: hsl(var(--color-gray-3));
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.prose-blog pre {
    background-color: hsl(var(--color-gray-3));
    border-radius: 30px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.prose-blog pre code {
    background-color: transparent;
    padding: 0;
}

/* Upstream pins inline code to 14px unconditionally, which collides visibly
 * with the guides' `code`-in-heading usage (e.g. "`READ_RAG_SOURCE` Right").
 * Scaling to the heading instead. */
.prose-blog h1 code,
.prose-blog h2 code,
.prose-blog h3 code,
.prose-blog h4 code,
.prose-blog h5 code {
    font-size: 0.85em;
}

.prose-blog img {
    border-radius: 30px;
    margin: 0.5rem auto;
    max-width: 100%;
    height: auto;
    display: block;
}

.prose-blog table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.prose-blog th,
.prose-blog td {
    border: 1px solid hsl(var(--border));
    padding: 0.5rem 0.75rem;
    text-align: left;
    color: hsl(var(--foreground));
}

.prose-blog th {
    background-color: hsl(var(--color-gray-3));
    font-family: var(--font-space-grotesk);
    font-weight: 500;
}

.prose-blog hr {
    border: 0;
    border-top: 1px solid hsl(var(--border));
    margin: 2.5rem 0;
}

.prose-blog::after {
    content: "";
    display: table;
    clear: both;
}

@media (min-width: 768px) {
    .prose-blog h1 {
        font-size: 2.5rem;
    }

    .prose-blog h2 {
        font-size: 2rem;
    }

    .prose-blog h3 {
        font-size: 1.5rem;
    }

    .prose-blog h4 {
        font-size: 1.25rem;
    }

    .prose-blog h5 {
        font-size: 1.125rem;
    }

    .prose-blog p,
    .prose-blog li {
        font-size: 1.125rem;
    }
}
