/**
 * typography.css — the one place the Vue surface gets its type from.
 *
 * Loaded by the two Inertia root blades (inertia-app.blade.php,
 * customer-portal-app.blade.php) and by nothing else, so the legacy blade ERP
 * keeps its own IBM Plex Sans / Montserrat and is unaffected.
 *
 * Consumed by: erp-inertia.css, customer-portal.css, fleet-modals.css,
 * truckgpt-panel.css, and ~85 declarations across resources/js.
 *
 * ── Why literal stacks and not var(--font-inter) ──────────────────────────
 * The @fonts directive resolves public/build/fonts-manifest.json. When that
 * file is missing, ViteFonts::manifest() returns null and Vite::fonts() emits
 * an EMPTY string — no exception, no log entry. Naming the real families here
 * means a missing manifest degrades to -apple-system; pointing at the emitted
 * --font-inter variable would degrade to the UA default serif instead, which
 * is precisely the bug this file exists to kill.
 */

:root {
    --font-sans: 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

    /* `cv05` = lowercase l with a tail. The single highest-value feature for an
       app this full of vehicle numbers, GSTINs and CN numbers, where l / I / 1
       otherwise render as three near-identical bare stems.

       Deliberately NOT global: 'zero' (slashed zero) — correct for IDs and
       coordinates, wrong-looking in ₹ amounts, so it is scoped to mono below.
       And NOT 'ss01' (open digits) / 'cv11' (single-storey a), which the old
       fleet-modals.css declared: those were inert against the CDN build and
       turning them on for real would restyle fleet tracking overnight. */
    --font-feature-settings: 'cv05';
    --font-feature-settings-mono: 'cv05', 'zero';

    --tracking-tight: -0.01em;
    --tracking-wide: 0.04em;

    /* Type scale, promoted from truckgpt-panel.css so there is one of these
       rather than four. Adopted incrementally — existing px literals elsewhere
       are left alone rather than swept, since re-densifying the whole ERP is a
       separate change with its own regression surface. */
    --fs-xs: 11px;      /* metadata, badges, sub-labels */
    --fs-sm: 12.5px;    /* table cells, chips, secondary card text */
    --fs-base: 13.5px;  /* body copy, card labels */
    --fs-md: 15px;      /* section headers */
    --fs-lg: 18px;      /* page/section headings */
}

/**
 * `html body`, not `body`.
 *
 * At 0,0,1 this rule loses to customer-portal.css's own `body {}` (and to
 * Bootstrap's, @import-ed at the top of it), because that file arrives LATER:
 * it is a @vite input on the portal, and on CustomerInquiry / VendorInquiry /
 * CustomerFlows it rides in on a lazily-imported page chunk whose <link> is
 * appended to <head> at runtime. Linking this file first makes that worse, not
 * better — 0,0,2 is what makes it order-independent.
 *
 * This is the fix for the teleported-modal bug: SdModal.vue and 17 other
 * components <Teleport to="body">, escaping .sd-page — the only element that
 * used to carry a font-family — and landing on the UA default serif.
 */
html body {
    font-family: var(--font-sans);
    font-feature-settings: var(--font-feature-settings);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/**
 * Form controls do not inherit font-family — that is UA behaviour, not an
 * oversight in any one stylesheet, which is why the Fleet Tracking toolbar
 * (Filters / Declutter / Subdue / the provider chips) and every bare <input>
 * rendered in Arial while the page around them did not.
 *
 * erp-inertia.css already spells `font-family: inherit` out on its own controls
 * six times over; this generalises that so new markup gets it for free.
 * Element selectors at 0,0,1 — any component that deliberately sets a control's
 * font by class still wins.
 */
button,
input,
select,
optgroup,
textarea {
    font-family: inherit;
    font-feature-settings: inherit;
}

/**
 * MapLibre (and the OlaMaps SDK that wraps it) ships
 * `.maplibregl-map { font: 12px/20px 'Helvetica Neue', Arial, … }`.
 * That is a FONT SHORTHAND on the map root, so every marker, label and popup
 * inside the map inherits Helvetica Neue rather than the body font — on Fleet
 * Tracking that is 300+ vehicle-number labels, the most-read text on the page.
 *
 * `html` prefix, not a bare class: the SDK is loaded with <script async> and
 * injects its stylesheet at runtime, i.e. AFTER this file. At equal specificity
 * it would win on order, so 0,1,1 is what makes this deterministic.
 *
 * Only the family is overridden — MapLibre's 12px/20px sizing still applies,
 * which is what keeps marker layout identical.
 */
html .maplibregl-map,
html .mapboxgl-map {
    font-family: var(--font-sans);
}
