/* ============================================
   PERSIAN FONT — Estedad (Variable Font)
   Loaded AFTER Bootstrap so it overrides.
   ============================================ */

/* --- Variable Font Face ---
   This single declaration covers all weights from 100 to 900.
   The 'wght' axis allows the browser to pick any weight. */
@font-face {
    font-family: 'Estedad';
    src: url('/fonts/estedad/Estedad[wght].woff2') format('woff2-variations');
    font-weight: 100 900;       /* Full weight range */
    font-style: normal;
    font-display: swap;
}

/* ============================================
   BOOTSTRAP OVERRIDE — apply everywhere
   ============================================ */
:root {
    --bs-body-font-family: 'Estedad', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.7;   /* Persian text needs more breathing room */
    --bs-body-font-weight: 400;
}

body {
    font-family: var(--bs-body-font-family);
    line-height: var(--bs-body-line-height);
    font-feature-settings: "ss01"; /* Optional: stylistic set if available */
}

/* --- Force font inheritance on form controls --- */
button,
input,
optgroup,
select,
textarea,
.btn,
.form-control,
.form-select,
.input-group-text,
.dropdown-menu,
.modal-content,
.alert,
.badge,
.card {
    font-family: inherit;
}

/* ============================================
   PERSIAN TYPOGRAPHY REFINEMENTS
   ============================================ */

/* --- Headings — tighter line-height than body --- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    line-height: 1.4;
    font-weight: 700;
}

/* --- Tabular numerals — aligns digits in tables/badges ---
   Critical for accounting: amounts line up vertically. */
.badge,
.form-control,
.form-select,
table,
td,
th,
.fs-1, .fs-2, .fs-3, .fs-4, .fs-5, .fs-6 {
    font-variant-numeric: tabular-nums;
}

/* --- LTR helper for Latin content (mixed content) ---
   Usage: <span class="ltr">ABC-123</span> */
.ltr {
    direction: ltr;
    unicode-bidi: embed;
    text-align: left;
}

/* --- Numbers in phone/tel inputs stay RTL-aligned --- */
input[type="tel"],
input[type="number"] {
    direction: rtl;
    text-align: right;
}

/* --- Large amounts — slightly tighter letter-spacing --- */
.fs-1, .fs-2, .fs-3 {
    letter-spacing: -0.01em;
}

/* ============================================
   PERSIAN DATEPICKER — RTL + Font Overrides
   ============================================ */

.datepicker-plot-area {
    font-family: 'Estedad', system-ui, Tahoma, sans-serif !important;
    direction: rtl;
}

/* Ensure the popup doesn't clash with Bootstrap's z-index */
.datepicker-container {
    z-index: 9999 !important;
}

/* Align the navigator buttons correctly in RTL */
.datepicker-plot-area .datepicker-navigator .pwt-btn-next,
.datepicker-plot-area .datepicker-navigator .pwt-btn-prev {
    font-family: inherit;
}

/* Match the input field style */
.pwt-datepicker-input-element {
    font-family: 'Estedad', system-ui, Tahoma, sans-serif;
}