@font-face {
    font-family: "Greta Arabic";
    src: url("/fonts/Greta-Arabic/Greta-Arabic-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Dubai";
    src: url("/fonts/Dubai/Dubai-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}

:root {
    --preset-heading-primary-color: #a0b92e;
    --preset-heading-secondary-color: #e78c3a;
}

/* The Kholasah theme uses burgundy as its primary color and orange as its secondary. */
:is(.editor-panel-kholasah, .fi-panel-kholasah) {
    --preset-heading-primary-color: #6a0728;
    --preset-heading-secondary-color: #e78c3a;
}

/* The Dialogue platform uses the primary and secondary colors of its public theme. */
:is(.editor-panel-religions, .fi-panel-religions) {
    --preset-heading-primary-color: #73a388;
    --preset-heading-secondary-color: #a99755;
}

/* Explicit presets take precedence over the legacy reading styles for generic headings. */
@layer kholasah-heading-presets {
    :is(h1, h2, h3, h4, h5, h6).kholasah-heading {
        color: var(--preset-heading-color, inherit) !important;
        font-family: var(--preset-heading-font, "Dubai"), sans-serif !important;
        font-size: var(--preset-heading-size) !important;
        font-weight: 700 !important;
        line-height: 1.5 !important;
    }

    h1.kholasah-heading {
        --preset-heading-color: var(--preset-heading-primary-color);
        --preset-heading-font: "Greta Arabic";
        --preset-heading-size: 24px;
    }

    h2.kholasah-heading {
        --preset-heading-color: var(--preset-heading-secondary-color);
        --preset-heading-size: 18px;
    }

    :is(h1, h2).kholasah-heading[data-heading-tone="text"] {
        --preset-heading-color: currentColor;
    }

    h3.kholasah-heading { --preset-heading-size: 17px; }
    h4.kholasah-heading { --preset-heading-size: 16px; }
    h5.kholasah-heading { --preset-heading-size: 15px; }
    h6.kholasah-heading { --preset-heading-size: 14px; }

    :is(.content-text, .text-content, .goals) :is(h1, h2, h3, h4, h5, h6).kholasah-heading
        :where(strong, b, em, i, a, mark, span:not(.ayah, .ayah-bracket)):not([style]) {
        font-family: inherit !important;
        font-size: inherit !important;
        line-height: inherit !important;
    }

    .content-text:has(> :is(h1, h2, h3, h4, h5, h6).kholasah-heading:first-child)::first-line {
        text-decoration: none !important;
    }
}
