/* ==========================================================================
   TYPOGRAPHY — hệ chữ dùng chung toàn hệ thống (admin + website tuyển dụng)
   Nạp TRƯỚC admin-system.css / home.css và mọi CSS riêng của trang.

   Quy tắc:
   - Chỉ dùng MỘT họ chữ: Be Vietnam Pro (tối ưu dấu tiếng Việt).
   - Mọi cỡ chữ lấy từ thang --fs-* bên dưới, không viết px lẻ (12.4px, 13.5px…).
   - Trang quản trị: chữ nội dung 14px, bảng 13px, nhỏ nhất 11px.
   - Website công khai: chữ nội dung 16px, chữ phụ 14px, nhỏ nhất 12px.
   ========================================================================== */

:root {
    /* Họ chữ */
    --font-sans: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    --font-doc: 'Times New Roman', Times, serif; /* chỉ dùng cho văn bản hợp đồng / in ấn */

    /* Thang cỡ chữ (1rem = 16px) */
    --fs-2xs: 0.6875rem; /* 11px — nhãn in hoa, badge nhỏ */
    --fs-xs:  0.75rem;   /* 12px — chú thích, meta */
    --fs-sm:  0.8125rem; /* 13px — bảng dữ liệu, nút nhỏ */
    --fs-base: 0.875rem; /* 14px — chữ nội dung trang quản trị */
    --fs-md:  0.9375rem; /* 15px */
    --fs-lg:  1rem;      /* 16px — chữ nội dung website công khai */
    --fs-xl:  1.125rem;  /* 18px */
    --fs-2xl: 1.25rem;   /* 20px */
    --fs-3xl: 1.5rem;    /* 24px */
    --fs-4xl: 1.75rem;   /* 28px */
    --fs-5xl: 2rem;      /* 32px */

    /* Độ đậm */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-heavy: 800;

    /* Chiều cao dòng */
    --lh-tight: 1.25;
    --lh-snug: 1.4;
    --lh-normal: 1.55;
    --lh-relaxed: 1.7;

    /* Tương thích tên biến cũ (admin-system.css V6, home.css) */
    --font: var(--font-sans);
    --text-xs: var(--fs-xs);
    --text-sm: var(--fs-sm);
    --text-base: var(--fs-base);
    --text-md: var(--fs-md);
    --text-lg: var(--fs-lg);
    --text-xl: var(--fs-xl);
    --text-2xl: var(--fs-3xl);
    --line-normal: var(--lh-normal);

    /* Bootstrap 5.3 dùng các biến này cho body */
    --bs-font-sans-serif: var(--font-sans);
    --bs-body-font-family: var(--font-sans);
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
}

/* Form & nút không tự kế thừa font trong một số trình duyệt */
button, input, select, textarea, optgroup {
    font-family: inherit;
}

/* Số liệu thẳng cột: bảng lương, chấm công, báo cáo */
.table td,
.table th,
.tabular-nums,
.money,
.number {
    font-variant-numeric: tabular-nums;
}

code, kbd, pre, samp {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

/* Nhiều nhãn/tiêu đề cột tiếng Việt đang gắn class .font-monospace; font mono (Consolas…)
   hiển thị dấu tiếng Việt xấu. Giữ font chính, chỉ dùng chữ số đều cột cho mã số. */
.font-monospace {
    font-family: var(--font-sans) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

/* Tiện ích cỡ chữ dùng trực tiếp trong template: class="text-sm" … */
.text-2xs { font-size: var(--fs-2xs) !important; }
.text-xs  { font-size: var(--fs-xs) !important; }
.text-sm  { font-size: var(--fs-sm) !important; }
.text-base { font-size: var(--fs-base) !important; }
.text-md  { font-size: var(--fs-md) !important; }
.text-lg  { font-size: var(--fs-lg) !important; }
.text-xl  { font-size: var(--fs-xl) !important; }
.text-2xl { font-size: var(--fs-2xl) !important; }
.text-3xl { font-size: var(--fs-3xl) !important; }

/* Nhãn in hoa: giãn chữ nhẹ để dễ đọc ở cỡ nhỏ */
.text-uppercase.small,
.text-uppercase.text-2xs,
.text-uppercase.text-xs {
    letter-spacing: 0.04em;
}

/* ---------------- Website công khai (layouts/public.twig) ---------------- */
body.site-public {
    font-size: var(--fs-lg);
    line-height: 1.65;
}
body.site-public h1, body.site-public .h1 { line-height: var(--lh-tight); letter-spacing: -0.02em; }
body.site-public h2, body.site-public .h2 { line-height: 1.3; letter-spacing: -0.015em; }
body.site-public h3, body.site-public .h3,
body.site-public h4, body.site-public .h4 { line-height: 1.35; }
body.site-public small,
body.site-public .small { font-size: var(--fs-base); }
body.site-public .form-control,
body.site-public .form-select { font-size: var(--fs-md); }
body.site-public .btn { font-weight: var(--fw-semibold); }

@media (max-width: 575.98px) {
    body.site-public { font-size: var(--fs-md); }
}

/* ---------------- In ấn ---------------- */
@media print {
    body { -webkit-font-smoothing: auto; }
}
