/* Frontend rich text output. Scoped so it cannot reset the surrounding page. */
.rich-text {
    overflow-wrap: anywhere;
}

.rich-text > :first-child {
    margin-top: 0;
}

.rich-text > :last-child {
    margin-bottom: 0;
}

.rich-text p {
    margin-top: 0;
    margin-bottom: 1em;
}

.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6 {
    margin-top: 1.25em;
    margin-bottom: 0.6em;
    font-weight: 700;
    line-height: 1.35;
}

.rich-text h1 {
    font-size: 2em;
}

.rich-text h2 {
    font-size: 1.5em;
}

.rich-text h3 {
    font-size: 1.25em;
}

.rich-text ul,
.rich-text ol {
    margin-top: 1em;
    margin-bottom: 1em;
    padding-left: 1.75em;
    list-style-position: outside;
}

.rich-text ul {
    list-style-type: disc;
}

.rich-text ol {
    list-style-type: decimal;
}

.rich-text ul ul {
    list-style-type: circle;
}

.rich-text ul ul ul {
    list-style-type: square;
}

.rich-text ol ol {
    list-style-type: lower-alpha;
}

.rich-text ol ol ol {
    list-style-type: lower-roman;
}

.rich-text li {
    display: list-item;
    margin: 0.25em 0;
}

.rich-text li > ul,
.rich-text li > ol {
    margin-top: 0.35em;
    margin-bottom: 0.35em;
}

.rich-text blockquote {
    margin: 1.25em 0;
    padding-left: 1em;
    border-left: 3px solid #cbd5e1;
    color: #64748b;
}

.rich-text a {
    color: #1861e2;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rich-text img,
.rich-text video,
.rich-text iframe {
    max-width: 100%;
}

.rich-text img,
.rich-text video {
    height: auto;
}

.rich-text figure {
    max-width: 100%;
    margin: 1.25em 0;
}

.rich-text table {
    width: 100%;
    max-width: 100%;
    margin: 1.25em 0;
    border-collapse: collapse;
}

.rich-text th,
.rich-text td {
    padding: 0.5em 0.75em;
    border: 1px solid #d1d5db;
    vertical-align: top;
}

/* Tailwind Preflight makes images block-level, so centered paragraphs also need auto margins. */
.rich-text [style*="text-align: center"],
.rich-text [style*="text-align:center"],
.rich-text [align="center"],
.rich-text .text-center {
    text-align: center !important;
}

.rich-text [style*="text-align: right"],
.rich-text [style*="text-align:right"],
.rich-text [align="right"],
.rich-text .text-right {
    text-align: right !important;
}

.rich-text [style*="text-align: left"],
.rich-text [style*="text-align:left"],
.rich-text [align="left"],
.rich-text .text-left {
    text-align: left !important;
}

.rich-text [style*="text-align: center"] > img,
.rich-text [style*="text-align:center"] > img,
.rich-text [align="center"] > img,
.rich-text .text-center > img {
    margin-left: auto;
    margin-right: auto;
}

.rich-text [style*="text-align: right"] > img,
.rich-text [style*="text-align:right"] > img,
.rich-text [align="right"] > img,
.rich-text .text-right > img {
    margin-left: auto;
    margin-right: 0;
}

@media (max-width: 767px) {
    .rich-text ul,
    .rich-text ol {
        padding-left: 1.5em;
    }

    .rich-text table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
