/*
 * Panel typography — self-hosted, no third-party font requests, no ordinary fonts.
 *
 *   YekanBakhFa  running text and UI (all digits shown as Persian digits)
 *   YekanBakh    same face with Latin digits — codes, keys, URLs and other LTR values
 *   Abar         display face — titles, menu group headings, buttons, table heads, badges,
 *                big numbers. Its digits come from YekanBakhFa so numbers stay Persian.
 *
 * The files live in /public/fonts (licensed, see fonts/README.txt). `font-display: block`
 * keeps text invisible for a moment instead of flashing a system font while they load.
 */

/* --- YekanBakhFa: body ------------------------------------------------------------------ */
@font-face { font-family: 'YekanBakhFa'; font-weight: 400; font-style: normal; font-display: block; src: url('../fonts/YekanBakhFaNum-Regular.woff2') format('woff2'); }
@font-face { font-family: 'YekanBakhFa'; font-weight: 600; font-style: normal; font-display: block; src: url('../fonts/YekanBakhFaNum-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'YekanBakhFa'; font-weight: 700; font-style: normal; font-display: block; src: url('../fonts/YekanBakhFaNum-Bold.woff2') format('woff2'); }

/* --- YekanBakh: Latin digits (LTR values) ------------------------------------------------ */
@font-face { font-family: 'YekanBakh'; font-weight: 400; font-style: normal; font-display: block; src: url('../fonts/YekanBakh-Regular.woff2') format('woff2'); }
@font-face { font-family: 'YekanBakh'; font-weight: 700; font-style: normal; font-display: block; src: url('../fonts/YekanBakh-Bold.woff2') format('woff2'); }

/* --- Abar: display. The second rule of each weight replaces only 0-9 with Persian digits --- */
@font-face { font-family: 'Abar'; font-weight: 700; font-style: normal; font-display: block; src: url('../fonts/AbarMid-Bold.woff2') format('woff2'); }
@font-face { font-family: 'Abar'; font-weight: 700; font-style: normal; font-display: block; src: url('../fonts/YekanBakhFaNum-Bold.woff2') format('woff2'); unicode-range: U+0030-0039; }
@font-face { font-family: 'Abar'; font-weight: 800; font-style: normal; font-display: block; src: url('../fonts/AbarMid-ExtraBold.woff2') format('woff2'); }
@font-face { font-family: 'Abar'; font-weight: 800; font-style: normal; font-display: block; src: url('../fonts/YekanBakhFaNum-ExtraBold.woff2') format('woff2'); unicode-range: U+0030-0039; }
@font-face { font-family: 'Abar'; font-weight: 900; font-style: normal; font-display: block; src: url('../fonts/AbarMid-Black.woff2') format('woff2'); }
@font-face { font-family: 'Abar'; font-weight: 900; font-style: normal; font-display: block; src: url('../fonts/YekanBakhFaNum-Black.woff2') format('woff2'); unicode-range: U+0030-0039; }

:root {
    --font: 'YekanBakhFa', sans-serif;
    --font-display: 'Abar', 'YekanBakhFa', sans-serif;
    --font-latin: 'YekanBakh', 'YekanBakhFa', sans-serif;
}

html, body { font-family: var(--font); }

/* Form controls and buttons never inherit a font on their own: without this the browser
   draws them in Arial/system-ui. */
button, input, select, textarea, optgroup, option, legend, summary, ::placeholder {
    font-family: inherit;
}

/* --- Display face: the "combination" ---------------------------------------------------- */
h1, h2, h3, h4, h5,
.page-header h1,
.brand-text strong,
.topbar-title strong,
.stat-value,
.login-card-head h1, .login-card-head h2,
.install-head h1,
.nav-group > summary,
.btn, .btn-glass, .btn-primary, .btn-secondary, .btn-success, .btn-sm, .page-tab-btn,
thead th, .table th, th,
.badge, .nav-badge {
    font-family: var(--font-display);
}

/* Menu: group headings in Abar (above), links in a firmer Yekan weight for legibility */
body.is-authed .sidebar .nav-group > summary { font-weight: 800; }
body.is-authed .sidebar .nav-group li a { font-weight: 600; }
.btn, .btn-glass { font-weight: 700; }

/* --- Latin digits for values that are codes, keys, addresses or typed left-to-right ----- */
[dir="ltr"],
code, pre, kbd, samp,
textarea.mono,
input[type="url"], input[type="email"], input[type="tel"], input[type="password"],
input[dir="ltr"], textarea[dir="ltr"] {
    font-family: var(--font-latin);
}
