/* Self-hosted KaTeX presentation for Pharma Digest rich content. */

.katex {
    font-size: 1.06em;
    text-rendering: auto;
}

.katex-display {
    max-width: 100%;
    margin: .85rem 0;
    padding: .25rem 0 .5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 118, 110, .42) transparent;
}

.katex-display > .katex {
    display: block;
    max-width: 100%;
    padding-bottom: .08rem;
}

.katex-display > .katex > .katex-html {
    max-width: 100%;
    padding-bottom: .08rem;
    overflow-x: auto;
    overflow-y: hidden;
}

.pd-formula .katex-display {
    margin: 0;
    padding: 0;
}

.pd-formula .katex-display > .katex {
    text-align: center;
}

.katex-error {
    padding: .08em .28em;
    border-radius: .3em;
    color: #b42318 !important;
    background: rgba(220, 38, 38, .08);
}

[data-theme="dark"] .katex-error,
.portal-body .katex-error,
body.pd-content-detail .katex-error {
    color: #fecaca !important;
    background: rgba(248, 113, 113, .12);
}

@media (max-width: 640px) {
    .katex {
        font-size: 1em;
    }

    .katex-display {
        margin: .7rem 0;
        font-size: .95em;
    }
}
