/*
 * Legal Fournier typography foundation.
 * Figma: Legal Fournier, node 20:37663 (Typography).
 */

@font-face {
    font-family: "Minerva Modern";
    src: url("../fonts/minerva-modern-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Minerva Modern";
    src: url("../fonts/minerva-modern-bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: "Minerva Modern";
    src: url("../fonts/minerva-modern-black.woff2") format("woff2");
    font-style: normal;
    font-weight: 900;
    font-display: swap;
}

@font-face {
    font-family: Manrope;
    src: url("../fonts/manrope-variable.woff2") format("woff2-variations");
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("../fonts/jetbrains-mono-regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root {
    --lf-font-display: "Minerva Modern", Georgia, serif;
    --lf-font-body: Manrope, "Helvetica Neue", Arial, sans-serif;
    --lf-font-meta: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    --lf-weight-regular: 400;
    --lf-weight-control: 500;
    --lf-weight-emphasis: 600;
    --theme-font-family: var(--lf-font-body);
    --theme-font-weight: var(--lf-weight-regular);
    --wp--preset--font-family--minerva-modern: var(--lf-font-display);
    --wp--preset--font-family--manrope: var(--lf-font-body);
    --wp--preset--font-family--jetbrains-mono: var(--lf-font-meta);
}

body:not(.wp-admin),
.editor-styles-wrapper {
    --theme-font-family: var(--lf-font-body);
    --theme-font-weight: var(--lf-weight-regular);
    font-family: var(--lf-font-body) !important;
    font-weight: var(--lf-weight-regular);
    font-synthesis: none;
}

/* Keep emphasis visible without introducing a heavy brand voice. */
:where(body:not(.wp-admin), .editor-styles-wrapper) :is(b, strong) {
    font-weight: var(--lf-weight-emphasis) !important;
    font-synthesis: none;
}

body:not(.wp-admin) :is(h1, h2, h3, h4, h5, h6),
.editor-styles-wrapper :is(h1, h2, h3, h4, h5, h6) {
    --theme-font-family: var(--lf-font-display);
    --theme-font-weight: 400;
    font-family: var(--lf-font-display) !important;
    font-style: normal;
    font-weight: 400 !important;
    font-synthesis: none;
}

/* Editorial headings stay Regular even when legacy content contains <strong>. */
body:not(.wp-admin) :is(h1, h2, h3, h4, h5, h6) :is(b, strong),
.editor-styles-wrapper :is(h1, h2, h3, h4, h5, h6) :is(b, strong) {
    font-weight: var(--lf-weight-regular) !important;
}

/* Controls need hierarchy, but never the visual density of Bold or Black. */
:where(body:not(.wp-admin), .editor-styles-wrapper) :is(
    button,
    input[type="button"],
    input[type="reset"],
    input[type="submit"],
    label,
    legend,
    .button,
    .ct-button,
    .wp-element-button,
    .wp-block-button__link,
    .wpforms-submit
) {
    font-family: var(--lf-font-body) !important;
    font-weight: var(--lf-weight-control) !important;
    font-synthesis: none;
}

:where(body:not(.wp-admin), .editor-styles-wrapper) :is(nav, .menu, .ct-header) a {
    font-family: var(--lf-font-body) !important;
    font-weight: var(--lf-weight-control) !important;
    font-synthesis: none;
}

:where(
    body:not(.wp-admin) .entry-meta,
    body:not(.wp-admin) .ct-breadcrumbs,
    body:not(.wp-admin) .wp-block-post-date,
    body:not(.wp-admin) .wp-block-post-terms,
    body:not(.wp-admin) figcaption,
    body:not(.wp-admin) code,
    body:not(.wp-admin) kbd,
    body:not(.wp-admin) samp,
    body:not(.wp-admin) pre,
    body:not(.wp-admin) .lf-label,
    body:not(.wp-admin) .lf-meta,
    body:not(.wp-admin) .lf-data,
    .editor-styles-wrapper .entry-meta,
    .editor-styles-wrapper .ct-breadcrumbs,
    .editor-styles-wrapper .wp-block-post-date,
    .editor-styles-wrapper .wp-block-post-terms,
    .editor-styles-wrapper figcaption,
    .editor-styles-wrapper code,
    .editor-styles-wrapper kbd,
    .editor-styles-wrapper samp,
    .editor-styles-wrapper pre,
    .editor-styles-wrapper .lf-label,
    .editor-styles-wrapper .lf-meta,
    .editor-styles-wrapper .lf-data
) {
    font-family: var(--lf-font-meta) !important;
    font-style: normal;
    font-weight: var(--lf-weight-regular) !important;
    font-synthesis: none;
}

/* Existing editorial eyebrow and tag components share the label treatment. */
:where(body:not(.wp-admin), .editor-styles-wrapper) :is(
    .lf-author-byline__eyebrow,
    .lf-blog-archive-cta__eyebrow,
    .lf-blog-inline-cta__eyebrow,
    .lf-experiment-card__eyebrow,
    .lf-services-preview__eyebrow,
    .lf-tool-card__tag,
    .lf-tool-mini-screen__eyebrow,
    .lf-tools-hub__eyebrow,
    .lf-tools-hub__tag
) {
    font-family: var(--lf-font-meta) !important;
    font-weight: var(--lf-weight-regular) !important;
    font-synthesis: none;
}

:where(body:not(.wp-admin), .editor-styles-wrapper) .lf-label {
    font-size: 0.6875rem;
    line-height: 1.35;
    letter-spacing: 0.075rem;
    text-transform: uppercase;
}
