/* =============================================================
 *  vendor.css — Bootstrap 5.3 RTL + Bootstrap Icons + Vazirmatn
 * =============================================================
 *
 *  This is the single CSS file the redesigned dashboard will
 *  load.  It is 100% self-contained (no remote CDN) per
 *  CONVENTIONS.md rule #11 ("Zero Remote CDN Dependencies for
 *  Control Planes") and per ARCHITECTURE.md ("no build tools").
 *
 *  It expects the following three vendor files on disk (relative
 *  to /static, served by the existing FastAPI /static mount of
 *  the frontend/ directory):
 *
 *    1. frontend/vendor/bootstrap/bootstrap.rtl.min.css
 *    2. frontend/vendor/bootstrap-icons/bootstrap-icons.min.css
 *       + ../fonts/bootstrap-icons.woff2 / .woff
 *    3. frontend/vendor/fonts/Vazirmatn/Vazirmatn-Regular.woff2
 *       + Vazirmatn-Bold.woff2  (one per weight 300, 400, 500,
 *         600, 700 if you want a full weight scale)
 *
 *  The @import statements below are relative URLs the browser
 *  resolves against this file's own URL.  Because this file is
 *  served at /static/css/vendor.css, the relative paths
 *  `../vendor/bootstrap/bootstrap.rtl.min.css` etc. correctly
 *  resolve to /static/vendor/bootstrap/bootstrap.rtl.min.css,
 *  which is exactly what the FastAPI /static mount serves.
 *
 *  No JS, no theme variable overrides, no component CSS lives
 *  here.  The dashboard CSS layer (Phase 2) and the per-page
 *  controllers (Phase 3) build on top of this foundation.
 * ============================================================= */

/* ---------- 1. Bootstrap 5.3 RTL (self-hosted) ---------- */
@import url("../vendor/bootstrap/bootstrap.rtl.min.css");

/* ---------- 2. Bootstrap Icons (self-hosted webfont) ----
 *  The CSS file references bootstrap-icons.woff2 and
 *  bootstrap-icons.woff via relative paths inside the
 *  vendor file; we just import the stylesheet here.
 * ------------------------------------------------------- */
@import url("../vendor/bootstrap-icons/bootstrap-icons.min.css");

/* ---------- 3. Vazirmatn font (self-hosted) ------------
 *  Falls back to `local('Vazirmatn')` for systems that have
 *  the font already installed (common in Persian-language
 *  Windows / macOS installs).  No remote fetch.
 * ------------------------------------------------------- */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: local('Vazirmatn Light'),
       local('Vazirmatn-Light'),
       url('../vendor/fonts/Vazirmatn/Vazirmatn-Light.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Vazirmatn Regular'),
       local('Vazirmatn-Regular'),
       url('../vendor/fonts/Vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('Vazirmatn Medium'),
       local('Vazirmatn-Medium'),
       local('Vazirmatn Regular'),
       local('Vazirmatn-Regular'),
       url('../vendor/fonts/Vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('Vazirmatn SemiBold'),
       local('Vazirmatn-SemiBold'),
       url('../vendor/fonts/Vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Vazirmatn Bold'),
       local('Vazirmatn-Bold'),
       url('../vendor/fonts/Vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
}

/* ---------- 4. App-wide font binding --------------------
 *  Bootstrap 5.3 sets `--bs-body-font-family` via the
 *  `$font-family-sans-serif` Sass variable.  We override
 *  it here so every Bootstrap component (cards, tables,
 *  modals, buttons, badges, dropdowns, toasts, offcanvas,
 *  navs, alerts) renders in Vazirmatn without per-component
 *  CSS in the next steps.
 * ------------------------------------------------------- */
:root {
  --bs-body-font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bs-body-font-weight: 400;
}

/* Persian numerals on metric cards + numeric tables.
 *  Bootstrap 5.3 doesn't ship a `font-variant-numeric`
 *  class, so we add a tiny utility here.  Apply with
 *  class="num-fa" on any element that should render
 *  numbers in Persian (۰۱۲۳۴۵۶۷۸۹) instead of Latin. */
.num-fa {
  font-feature-settings: 'ss02' on, 'tnum' on;
  unicode-bidi: plaintext;
}
