//
//  STACK OVERFLOW
//  CONSTANTS -- TYPOGRAPHY
//
//  This CSS comes from Stacks, our CSS & Pattern library for rapidly building
//  Stack Overflow. For documentation of all these classes and how to contribute,
//  visit https://stackoverflow.design/
//
//  These are the Stacks type variables. These should be used in place of
//  hard-coded values within CSS declarations.
//
//
//  ============================================================================
//  $   FONT FAMILY (ff-)
//  ----------------------------------------------------------------------------

// Add Segoe UI Adjusted as a font family, and adjust its baseline
@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI);
    ascent-override: 95%;
}

// Segoe UI is variable, but only in Windows 11, so add all the variants
@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI Italic);
    ascent-override: 95%;
    font-style: italic;
}

@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI Semibold);
    ascent-override: 95%;
    font-weight: 600;
}

@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI Semibold Italic);
    ascent-override: 95%;
    font-style: italic;
    font-weight: 600;
}

@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI Bold);
    ascent-override: 90%;
    font-weight: 700;
}

@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI Bold Italic);
    ascent-override: 95%;
    font-style: italic;
    font-weight: 700;
}

@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI Black);
    ascent-override: 95%;
    font-weight: 800;
}

@font-face {
    font-family: "Segoe UI Adjusted";
    src: local(Segoe UI Black Italic);
    ascent-override: 95%;
    font-style: italic;
    font-weight: 800;
}

// TODO remove font-family Less variables. Keeping them here for now for comments.
@ff-sans:
    -apple-system, BlinkMacSystemFont, // San Francisco on macOS and iOS
    "Segoe UI Adjusted", "Segoe UI", // Windows
    "Liberation Sans", // Linux
    sans-serif; // The final fallback for rendering in sans-serif.
@ff-serif: Georgia, Cambria, "Times New Roman", Times, serif;
@ff-mono:
    ui-monospace, // San Francisco Mono on macOS and iOS
    "Cascadia Mono", "Segoe UI Mono", // Newer Windows monospace fonts that are optionally installed. Most likely to be rendered in Consolas
    "Liberation Mono", // Linux
    Menlo, Monaco, Consolas, // A few sensible system font choices
    monospace; // The final fallback for rendering in monospace.

html {
    font-size: 100%;
}

body {
    --ff-sans: @ff-sans;
    --ff-serif: @ff-serif;
    --ff-mono: @ff-mono;
    --theme-body-font-family: var(--ff-sans);

    // All rem values are relative to the font size applied to <html> (16px by default).
    --fs-fine:          0.75rem;    // 12px
    --fs-caption:       0.8125rem;  // 13px
    --fs-body1:         0.875rem;   // 14px (base font size applied to <body>)
    --fs-body2:         1rem;       // 16px
    --fs-body3:         1.125rem;   // 18px
    --fs-subheading:    1.25rem;    // 20px
    --fs-title:         1.375rem;   // 22px
    --fs-headline1:     1.75rem;    // 28px
    --fs-headline2:     2.25rem;    // 36px
    --fs-display1:      2.875rem;   // 46px
    --fs-display2:      3.625rem;   // 58px
    --fs-display3:      4.5rem;     // 72px
    --fs-display4:      6.25rem;    // 100px

    //  ============================================================================
    //  $   LINE HEIGHT (lh-)
    //  ----------------------------------------------------------------------------
    // Need to remove the unit off the font-size to make line-height unitless
    // FIXME this shouldn't be public. Find a way to use unitless `--fs-base`.
    --stacks-internals-lh-unit: 14;

    // Now the various line-height variables
    --lh-xs:    1;
    --lh-sm:    calc((var(--stacks-internals-lh-unit) + 2) / var(--stacks-internals-lh-unit));
    --lh-md:    calc((var(--stacks-internals-lh-unit) + 4) / var(--stacks-internals-lh-unit));
    --lh-lg:    calc((var(--stacks-internals-lh-unit) + 8) / var(--stacks-internals-lh-unit));
    --lh-xl:    calc((var(--stacks-internals-lh-unit) + 12) / var(--stacks-internals-lh-unit));
    --lh-xxl:   2;

    --lh-base: var(--lh-md);

    //      Holdover line-heights from production. These are NOT to be used and
    //      need to be deprecated.
    //  ----------------------------------------------------------------------------
    --lh-6:      ((var(--stacks-internals-lh-unit) + 6) / var(--stacks-internals-lh-unit));
}
