/**
 * Latin Modern Roman webfonts (GUST e-foundry, GUST Font License).
 * Source: official GUST OTF release, converted to WOFF2 locally.
 * https://www.gust.org.pl/projects/e-foundry/latin-modern/download
 * (Earlier version of this file used a third-party webfont-kit conversion
 * whose 'onum'/'lnum' OpenType features were empty stubs with no actual
 * old-style digit glyphs; GUST's own OTF has real oldstyle substitutions.)
 */
@font-face {
	font-family: 'Latin Modern Roman';
	src: url('../fonts/latin-modern-roman/lmroman-regular-webfont.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Latin Modern Roman';
	src: url('../fonts/latin-modern-roman/lmroman-bold-webfont.woff2') format('woff2');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Latin Modern Roman';
	src: url('../fonts/latin-modern-roman/lmroman-italic-webfont.woff2') format('woff2');
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: 'Latin Modern Roman';
	src: url('../fonts/latin-modern-roman/lmroman-bolditalic-webfont.woff2') format('woff2');
	font-weight: 700;
	font-style: italic;
	font-display: swap;
}

/**
 * Latin Modern Mono (Typewriter) webfonts.
 * Same GUST OTF source/license as above. Upstream only ships Regular +
 * Italic for this family (no true bold design); browsers will synthesize
 * bold if <strong>/<b> ever appears inside code.
 */
@font-face {
	font-family: 'Latin Modern Mono';
	src: url('../fonts/latin-modern-mono/lmmono-regular-webfont.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Latin Modern Mono';
	src: url('../fonts/latin-modern-mono/lmmono-italic-webfont.woff2') format('woff2');
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

pre,
code,
kbd,
samp {
	font-family: 'Latin Modern Mono', Consolas, Menlo, Monaco, 'Courier New', monospace;
}

/* Matches the exact selector list from the Customizer's Kirki-generated
   inline CSS (body, p, .site-content, .site-footer { font-family: "Open
   Sans"... }) since overriding just `body` doesn't reach `p`, which has
   its own explicit rule there. !important needed to beat that inline CSS
   regardless of load order.

   .site-title is added explicitly: on the front page it's an <h1> (not
   caught by the `p` rule above), on every other page it's a <p> (which
   IS caught by the `p` rule, but only by accident) — so without this it's
   Oswald on the homepage and Latin Modern Roman everywhere else. This
   makes it Latin Modern Roman intentionally on every page.

   font-variant-numeric: oldstyle-nums swaps in the font's 'onum' OpenType
   feature (present in this font file) for old-style figures instead of
   the default lining figures, in running text and the title. Code/pre
   blocks (Latin Modern Mono, above) intentionally keep lining figures —
   old-style figures in code would misalign numeric columns. */
body,
p,
.site-content,
.site-footer,
.site-title {
	font-family: 'Latin Modern Roman', Georgia, 'Times New Roman', serif !important;
	font-variant-numeric: oldstyle-nums;
	font-feature-settings: 'onum' 1;
}

.site-title {
	white-space: nowrap;
	/* Latin Modern Roman is noticeably wider per character than the Oswald
	   condensed sans it replaced, so the fixed 48px size that used to fit
	   the title column on narrow screens no longer does. Scales fluidly
	   with viewport width and is clamped back to the original 48px at
	   desktop widths (~533px+), so desktop is visually unchanged. */
	font-size: clamp(22px, 9vw, 48px) !important;
	font-weight: 400 !important;
}

/* Tagline ("Twenty-first century LaTeX") is an h3.alt-font, which the
   Kirki inline CSS explicitly sets to Open Sans (higher specificity than
   the plain h3 rule), so it needs its own override. Not bolded — this one
   wasn't an Oswald replacement, just a separate ask to move it to Latin
   Modern. */
.site-description {
	font-family: 'Latin Modern Roman', Georgia, 'Times New Roman', serif !important;
}

/* Every heading/nav/button selector that used Oswald, minus the ones that
   are also `.alt-font` (like the tagline above, which is an h3 carrying
   both `h5` and `alt-font` utility classes — the original Kirki rules
   protect alt-font elements via :not(.alt-font) on both the element AND
   class forms; using !important here means that protection has to be
   copied explicitly too, not just on the element selector, or a bare
   `.h5` match steamrolls it regardless of the exclusion elsewhere). */
h1:not( .alt-font ):not( .site-title ), .h1:not( .alt-font ),
h2:not( .alt-font ), .h2:not( .alt-font ),
h3:not( .alt-font ):not( .site-description ), .h3:not( .alt-font ),
h4:not( .alt-font ), .h4:not( .alt-font ),
h5:not( .alt-font ), .h5:not( .alt-font ),
h6:not( .alt-font ), .h6:not( .alt-font ),
.social-menu ul li a,
.secondary-menu ul li a,
.tertiary-menu ul li a,
.footer-center-menu ul li a,
.mod-alpha h2,
.p-button-primary a, .p-button-secondary a, .call-to-action a.button-primary, .form-submit a, .ninja-forms-all-fields-wrap input.btn,
.bg-font-family-menu,
.bg-font-family-heading {
	font-family: 'Latin Modern Roman', Georgia, 'Times New Roman', serif !important;
	font-weight: 700 !important;
}

/* Main nav (Home / Blog / About Me / Contact) — split out from the bold
   group above at the user's request; stays Latin Modern Roman but at its
   normal weight. */
.primary-menu ul li a {
	font-family: 'Latin Modern Roman', Georgia, 'Times New Roman', serif !important;
	font-weight: 400 !important;
}
