/*
 * Code Cloude | Portable Avid FaNum Variable Font
 * Font is packaged locally; URL resolves relative to this plugin's CSS file.
 */
@font-face {
    font-family: 'CodeCloude Avid FaNum';
    src: url('../fonts/AvidFaNum-VF.ttf') format('truetype');
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --cc-avid-family: 'CodeCloude Avid FaNum', Tahoma, Arial, sans-serif;
}

/* Optional public-site font size override is injected only when enabled. */

/* Target readable text on WordPress, WooCommerce, Elementor and the dashboard.
 * Leave icon glyphs, SVGs, rich code editors and monospace elements intact. */
html body,
html body :is(
    div, span, p, a, b, strong, em, small, blockquote, q,
    h1, h2, h3, h4, h5, h6, ul, ol, li, dt, dd, dl,
    label, input, textarea, select, option, optgroup, button,
    table, thead, tbody, tfoot, tr, th, td, caption,
    article, section, header, footer, main, nav, aside,
    figcaption, legend, summary, details, time
):not(:is(
    .dashicons, .dashicons *, .dashicons-before,
    .eicon, [class^='eicon-'], [class*=' eicon-'],
    .fa, .fas, .far, .fab, .fal, .fat, .fad,
    .fa-solid, .fa-regular, .fa-brands,
    [class^='fa-'], [class*=' fa-'],
    [class^='wcicon-'], [class*=' wcicon-'],
    [class^='icon-'], [class*=' icon-'],
    .material-icons, .material-symbols-outlined,
    .genericon, .iconify, .components-icon, .emoji,
    .CodeMirror, .CodeMirror *, .ace_editor, .ace_editor *,
    .monaco-editor, .monaco-editor *,
    pre, pre *, code, code *, kbd, samp
)) {
    font-family: var(--cc-avid-family) !important;
}

/* Preserve intended font weights; variable font supports 100–900. */
html body :is(strong, b) { font-weight: 700; }

/* WP admin and toolbar icon pseudo-elements. */
html body .dashicons,
html body .dashicons::before,
html body .dashicons-before::before,
html body #wpadminbar .ab-icon::before,
html body #wpadminbar .ab-item::before,
html body #adminmenu .wp-menu-image::before,
html body .wp-menu-image::before {
    font-family: dashicons !important;
    font-weight: 400 !important;
}

/* Elementor and WooCommerce pseudo icon font protection. */
html body .eicon, html body .eicon::before,
html body [class^='eicon-'], html body [class*=' eicon-'] {
    font-family: eicons !important;
}
html body [class^='wcicon-'],
html body [class*=' wcicon-'],
html body .woocommerce-message::before,
html body .woocommerce-info::before,
html body .woocommerce-error::before {
    font-family: WooCommerce !important;
}

/* Font Awesome icons (respect icon type and loaded fonts). */
html body .fa { font-family: FontAwesome, 'Font Awesome 5 Free' !important; }
html body .fas, html body .fa-solid {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free' !important;
    font-weight: 900 !important;
}
html body .far, html body .fa-regular {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free' !important;
    font-weight: 400 !important;
}
html body .fab, html body .fa-brands {
    font-family: 'Font Awesome 6 Brands', 'Font Awesome 5 Brands' !important;
    font-weight: 400 !important;
}

/* SVGs and all content within code editors remain unaffected. */
html body svg, html body svg *,
html body pre, html body pre *,
html body code, html body code *,
html body .CodeMirror, html body .CodeMirror *,
html body .ace_editor, html body .ace_editor *,
html body .monaco-editor, html body .monaco-editor * {
    font-family: revert !important;
}
