/* Caladrius Academy typography, shared by the LMS SPA and Frappe's website /
   login layer (hooks.py web_include_css). One file so the two surfaces cannot
   drift apart.

   Archivo is the brand face (caladriustherapy.com ships it at 400-700) and is
   the UI face: nav, buttons, tables, badges, headings. Atkinson Hyperlegible
   Next is the reading face for lesson bodies, quizzes and discussions, where
   character distinctiveness (I / l / 1, O / 0) matters and text is read for
   minutes at a time.

   Both are variable WOFF2, Latin subset plus a lazily-fetched Latin-ext file
   (unicode-range keeps it off the wire unless a name or lesson needs it).
   Sourced from Fontsource 5.3.0, OFL-1.1; licences sit beside the files. */

@font-face {
	font-family: 'Archivo';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/archivo-latin-ext-wght-normal.woff2') format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
		U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
		U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Archivo';
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url('../fonts/archivo-latin-wght-normal.woff2') format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
		U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
	font-family: 'Atkinson Hyperlegible Next';
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url('../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2')
		format('woff2-variations');
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
		U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
		U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Atkinson Hyperlegible Next';
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url('../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2')
		format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
		U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Italic is Latin only: lessons italicise English prose, and a synthesised
   oblique on Latin-ext is an acceptable rarity. */
@font-face {
	font-family: 'Atkinson Hyperlegible Next';
	font-style: italic;
	font-weight: 200 800;
	font-display: swap;
	src: url('../fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2')
		format('woff2-variations');
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
		U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
		U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched stand-ins so the swap from system font to web font moves
   almost nothing. Measured from the font files against Arial using a
   frequency-weighted English glyph width; dense UI (sidebar, tables, buttons)
   is where a mismatch would show. */
@font-face {
	font-family: 'Archivo Fallback';
	src: local('Arial');
	size-adjust: 102.5%;
	ascent-override: 85.7%;
	descent-override: 20.5%;
	line-gap-override: 0%;
}

@font-face {
	font-family: 'Atkinson Hyperlegible Next Fallback';
	src: local('Arial');
	size-adjust: 100%;
	ascent-override: 98.4%;
	descent-override: 31.6%;
	line-gap-override: 0%;
}

:root {
	--font-ui: 'Archivo', 'Archivo Fallback', ui-sans-serif, system-ui, -apple-system,
		'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--font-reading: 'Atkinson Hyperlegible Next',
		'Atkinson Hyperlegible Next Fallback', ui-sans-serif, system-ui, -apple-system,
		'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Frappe's website layer (login, web pages) reads --font-stack and defines it
   on a bare `:root` in its own bundles, which load after this file. `html:root`
   is one type selector more specific, so it wins whatever the load order. */
html:root {
	--font-stack: var(--font-ui);
}

/* The website bundle also pins `font-variation-settings: "opsz" 24` (an Inter
   axis) on html and body; neither of our faces has it. */
html:root,
html:root body {
	font-variation-settings: normal;
}
