/* Priority: 100 */

/**
 * Rich text pasted into the portal editor.
 *
 * The selectors are limited to the two new single templates. Existing Xleb
 * title components keep their own spacing; the flow rules below cover native
 * editor HTML such as h2, p, ul and ol without requiring content shortcodes.
 */
body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    color: var(--contentColor, #00000f);
    font-family: var(--textFont, "Onest", sans-serif);
    font-size: var(--textMsize, 19px);
    line-height: var(--textMheightS, 28px);
    letter-spacing: var(--bigTextSpacing, -0.02em);
    overflow-wrap: anywhere;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(.wpb_text_column, .wpb_wrapper, .vc_column_container) {
    min-width: 0;
    max-width: 100%;
}

/* Neutralize Word font declarations while retaining semantic bold/italic. */
body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(p, li, td, th, span:not([class])) {
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    overflow-wrap: anywhere;
}

/* A semantic H2 uses the native Xleb titleXXS visual contract. */
body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text > h2,
body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(
    :not(.titleXXXXS, .titleXXXS, .titleXXS, .titleXS, .titleS, .titleM, .titleL, .titleXL, .titleXXL)
) > h2 {
    box-sizing: border-box;
    padding-top: var(--gapX12, 48px);
    padding-bottom: var(--gapX7, 28px);
    font-family: var(--titleFont, "Onest", sans-serif);
    font-size: var(--titleXXSsize, 24px);
    font-weight: var(--titleWeight, 600);
    line-height: var(--titleXXSheightT, 28px);
    letter-spacing: var(--smallTitleSpacing, -0.03em);
    margin-top: var(--titleXXStopT, -7px);
    margin-bottom: var(--titleXXSbottomT, -5px);
    margin-left: var(--titleLeft, 0);
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text > h2:first-child,
body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(
    :not(.titleXXXXS, .titleXXXS, .titleXXS, .titleXS, .titleS, .titleM, .titleL, .titleXL, .titleXXL)
) > h2:first-child {
    padding-top: 0;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(ul, ol) {
    display: flex;
    flex-direction: column;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    padding-left: calc(var(--gapX7, 28px) + 0.5px);
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text ul {
    list-style: disc outside;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text ol {
    list-style: decimal outside;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(ul, ol) :where(ul, ol) {
    padding-left: var(--gapX6, 24px);
    margin-top: var(--gapX2, 8px);
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text li::marker {
    color: currentColor;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text a:not(.btn) {
    color: var(--linkDefaultColor, var(--primary500, #c42185));
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(img, video, iframe, figure, table) {
    max-width: 100%;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(img, video) {
    height: auto;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text :where(td, th) {
    padding: var(--gapX2, 8px) var(--gapX3, 12px);
    border: 1px solid var(--gray400, #d2d2d7);
    text-align: left;
    vertical-align: top;
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text blockquote {
    margin-right: 0;
    margin-left: 0;
    padding-left: var(--gapX5, 20px);
    border-left: 2px solid var(--primary500, #c42185);
}

body.eridan-portal :is(
    .ready-solution-single__editor,
    .programs-single__editor
).portal-rich-text p:empty {
    display: none;
}
