/* =====================================================================
   Sapling Global - site-wide typography
   Loaded LAST (after responsive-fixes.css) from Site.master and index.aspx.

   - One font everywhere: Figtree (only weights 400-700 are loaded, so any
     old "font-weight: 800/900" in page styles now renders as 700 at most).
   - One size per tag on every page (h2 = 32px everywhere, p = 15px, etc.).
   - Clean, not-too-bold headings.

   ":not(#_)" only raises specificity so the many page-level <style> blocks
   and inline styles can't override these values. Icon fonts (Font Awesome,
   Flaticon, ui-icons, site-icons) are excluded so icons keep working.
   ===================================================================== */

:root {
    --sg-font: "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --sg-h1: 34px;
    --sg-h2: 27px;
    --sg-h3: 22px;
    --sg-h4: 18px;
    --sg-h5: 16px;
    --sg-h6: 15px;
    --sg-p: 15px; /* body text: max 15px */
    --sg-small: 13px; /* small text: footer, labels, forms, tables, captions */
}

/* ---------- 1. Font family ---------- */
html body:not(#_) {
    font-family: var(--sg-font) !important;
    font-size: var(--sg-p);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html body :is(h1, h2, h3, h4, h5, h6, p, a, span, li, dt, dd, td, th, label, legend, caption, input, select, textarea, button, option, div, section, article, header, footer, nav, strong, b, em, small, blockquote, figcaption, address, cite, q):not(#_):not(.fa, .fas, .far, .fab, .fal, .fad, .fa-solid, .fa-regular, .fa-brands, [class^="fa-"], [class*=" fa-"], [class^="flaticon-"], [class*=" flaticon-"], [class^="ui-"], [class*=" ui-"], [class^="icon-"], [class*=" icon-"], .glyphicon) {
    font-family: var(--sg-font) !important;
}

/* ---------- 2. Headings: same size + weight on every page ---------- */
html body h1:not(#_) {
    font-size: var(--sg-h1) !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
}

html body h2:not(#_) {
    font-size: var(--sg-h2) !important;
    line-height: 1.3 !important;
    font-weight: 600 !important;
}

html body h3:not(#_) {
    font-size: var(--sg-h3) !important;
    line-height: 1.35 !important;
    font-weight: 600 !important;
}

html body h4:not(#_) {
    font-size: var(--sg-h4) !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

html body h5:not(#_) {
    font-size: var(--sg-h5) !important;
    line-height: 1.4 !important;
    font-weight: 600 !important;
}

html body h6:not(#_) {
    font-size: var(--sg-h6) !important;
    line-height: 1.45 !important;
    font-weight: 600 !important;
}

html body :is(h1, h2, h3, h4, h5, h6):not(#_) {
    letter-spacing: normal !important;
    text-shadow: none !important;
}

/* ---------- 3. Body text ---------- */
html body p:not(#_),
html body li:not(#_),
html body dd:not(#_),
html body blockquote:not(#_) {
    font-size: var(--sg-p) !important;
    line-height: 1.65 !important;
    font-weight: 400;
    letter-spacing: normal;
}

/* Smaller text (14px) */
html body :is(small, .small, label, legend, caption, figcaption, td, th, .form-control, input, select, textarea, .hero-small, .breadcrumb, .breadcrumb li):not(#_) {
    font-size: var(--sg-small) !important;
}

html body footer :is(p, li, a, span, address):not(#_),
html body .footerNew :is(p, li, a, span, address):not(#_),
html body .copyright :is(p, a, span):not(#_) {
    font-size: var(--sg-small) !important;
}

/* ---------- 4. Weights: nothing heavier than 700, bold text not too heavy ---------- */
html body :is(strong, b, th):not(#_) {
    font-weight: 600 !important;
}

/* ---------- 5. Tablet (<= 1080px) ---------- */
@media only screen and (max-width: 1080px) {
    :root {
        --sg-h1: 34px;
        --sg-h2: 28px;
        --sg-h3: 22px;
        --sg-h4: 19px;
        --sg-h5: 17px;
    }
}

/* ---------- 6. Phones (<= 767px) ---------- */
@media only screen and (max-width: 767px) {
    :root {
        --sg-h1: 28px;
        --sg-h2: 24px;
        --sg-h3: 20px;
        --sg-h4: 18px;
        --sg-h5: 16px;
        --sg-h6: 15px;
    }

    html body :is(h1, h2, h3, h4, h5, h6):not(#_) {
        word-break: normal;
        overflow-wrap: anywhere;
    }
}
