/* AutoBar Theme Font Enforcer 1.0.2 */

html body.abtf-enabled.abtf-ready {
    font-family: var(--abtf-body-font) !important;
}

/*
 * Высокая специфичность намеренно используется для HTML-блоков и плагинов,
 * которые задают собственный font-family через !important.
 */
html body.abtf-enabled.abtf-ready :where(
    div, section, article, main, header, footer, nav, aside,
    p, span, a, li, ul, ol, dl, dt, dd,
    label, legend, figcaption, blockquote, cite,
    table, thead, tbody, tfoot, tr, th, td,
    strong, b, em, i, small, mark, time, address,
    h1, h2, h3, h4, h5, h6,
    button, input, select, textarea, option, optgroup,
    [role="heading"], [role="button"], [contenteditable="true"]
),
html body.abtf-enabled.abtf-ready :where(
    .wp-site-blocks, .entry-content, .wp-block-post-content,
    [class^="wp-block-"], [class*=" wp-block-"],
    [class^="abfh-"], [class*=" abfh-"],
    [class^="autobar-"], [class*=" autobar-"]
) {
    font-family: var(--abtf-body-font) !important;
    font-style: var(--abtf-body-style) !important;
}

/* Заголовкам передаётся не только семейство, но и начертание темы. */
html body.abtf-enabled.abtf-ready :where(
    h1, h2, h3, h4, h5, h6,
    [role="heading"],
    .entry-title, .site-title, .page-title, .widget-title,
    .wp-block-heading, .wp-block-post-title,
    [class~="title"], [class~="heading"],
    [class*="__title"], [class*="-title"],
    [class*="__heading"], [class*="-heading"],
    [class*="headline"]
),
html body.abtf-enabled.abtf-ready :where(
    h1, h2, h3, h4, h5, h6,
    [role="heading"],
    .entry-title, .site-title, .page-title, .widget-title,
    .wp-block-heading, .wp-block-post-title,
    [class~="title"], [class~="heading"],
    [class*="__title"], [class*="-title"],
    [class*="__heading"], [class*="-heading"],
    [class*="headline"]
) :where(*) {
    font-family: var(--abtf-heading-font) !important;
    font-style: var(--abtf-heading-style) !important;
    font-weight: var(--abtf-heading-weight) !important;
    letter-spacing: var(--abtf-heading-spacing) !important;
}

/* Кнопкам и полям передаётся типографика элементов управления темы. */
html body.abtf-enabled.abtf-ready :where(
    button, input, select, textarea, option, optgroup,
    .button, .btn, .wp-element-button, .wp-block-button__link,
    [role="button"]
),
html body.abtf-enabled.abtf-ready :where(
    button, .button, .btn, .wp-element-button, .wp-block-button__link,
    [role="button"]
) :where(*) {
    font-family: var(--abtf-control-font) !important;
    font-style: var(--abtf-control-style) !important;
    font-weight: var(--abtf-control-weight) !important;
}

/* Псевдоэлементы с текстом тоже наследуют тему. */
html body.abtf-enabled.abtf-ready :where(*)::before,
html body.abtf-enabled.abtf-ready :where(*)::after {
    font-family: inherit !important;
}

/* Иконки и код нельзя переводить на обычный текстовый шрифт. */
html body.abtf-enabled.abtf-ready :where(
    svg, svg *,
    code, code *, pre, pre *, kbd, kbd *, samp, samp *, var, var *,
    .dashicons, .dashicons *,
    .material-icons, .material-icons *,
    .material-symbols-outlined, .material-symbols-outlined *,
    .material-symbols-rounded, .material-symbols-rounded *,
    .fa, .fa *, .fas, .fas *, .far, .far *, .fab, .fab *, .fal, .fal *, .fad, .fad *,
    [class^="fa-"], [class^="fa-"] *, [class*=" fa-"], [class*=" fa-"] *,
    [class^="icon-"], [class^="icon-"] *, [class*=" icon-"], [class*=" icon-"] *,
    [class^="eicon-"], [class^="eicon-"] *, [class*=" eicon-"], [class*=" eicon-"] *,
    [class^="flaticon-"], [class^="flaticon-"] *, [class*=" flaticon-"], [class*=" flaticon-"] *,
    [data-icon], [data-icon] *,
    .ab-icon, .ab-icon *
) {
    font-family: revert !important;
    font-style: revert !important;
    font-weight: revert !important;
    letter-spacing: revert !important;
}

html body.abtf-enabled.abtf-ready #wpadminbar,
html body.abtf-enabled.abtf-ready #wpadminbar * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-style: normal !important;
    letter-spacing: normal !important;
}
