/*
 * Barlow + Barlow Condensed, tự host (SIL Open Font License 1.1).
 *
 * Tải nguyên từ fonts.googleapis.com/css2 với UA Chrome, giữ đúng ba subset và
 * unicode-range của Google: trình duyệt chỉ tải subset nào có ký tự trên trang.
 * Tự host để bỏ hai kết nối ngoài (fonts.googleapis.com rồi fonts.gstatic.com)
 * nằm trên đường găng của dòng chữ LCP — xem inc/pattern.php.
 *
 * Hai chỗ đã sửa khác bản Google, để bớt file font phải tải:
 *
 * 1. Range latin-ext đã trừ các ký tự mà file vietnamese đã có (Ă Đ Ĩ Ũ Ơ Ư,
 *    ỳ–ỹ). Nguyên bản Google để hai range chồng nhau, nên trang tiếng Việt nào
 *    cũng kéo cả latin-ext dù không có chữ nào cần nó: mỗi weight 3 file thay
 *    vì 2. Glyph ở hai file là cùng một thiết kế.
 *
 * 2. Còn 3 weight Barlow (400, 600, 700) và 2 weight Condensed (600, 700).
 *    Đã đếm ký tự trên 12 URL × 2 khung nhìn: Barlow 500 (chủ yếu strong/b),
 *    Condensed 500 (strong trong tiêu đề) và Condensed 800 (h2.headline, tiêu
 *    đề danh mục — 372 ký tự) quá ít, không đáng 3 file mỗi loại. Khai
 *    `font-weight` theo khoảng (500 600, 700 900) để 500 dùng file 600, 800
 *    dùng file 700 — không khai thì trình duyệt lấy 400 cho 500 và tự làm
 *    đậm giả cho 800.
 */

/* Mặt chữ dự phòng có số đo khớp Barlow — chặn cú xô lúc font tải xong.
 *
 * `font-display: swap` vẽ chữ bằng font dự phòng trước, đổi sang Barlow khi
 * file về. Barlow hẹp hơn hẳn: chữ hoa ở menu desktop co lại, hàng
 * `.navbar-nav` (căn phải) trượt sang phải — đo CLS 0,086 ở 1280px, đúng lúc
 * các file Barlow 400/600 về. Font dự phòng trước đây là `system-ui` (Segoe UI
 * trên Windows) vì Inter hiếm khi có sẵn trên máy khách.
 *
 * `size-adjust` đo bằng canvas trên Chrome, tỷ lệ bề rộng Barlow / Arial:
 *   chữ hoa (menu)  400: 0,869  600: 0,865  700: 0,865
 *   chữ thường      400: 0,935  500: 0,943  600: 0,889  700: 0,896
 * Một tỷ lệ không vừa cả hai, nên tách theo weight: 600 trở lên gần như chỉ
 * là nhãn chữ hoa (menu, nút) → 87%; 400–500 là thân bài → 93,5%.
 * `ascent/descent-override` = số đo hhea của Barlow (1000/200 trên em 1000)
 * chia cho size-adjust, để chiều cao dòng `normal` cũng khớp.
 *
 * Chỉ máy có Arial (Windows, macOS, iOS) mới dùng mặt này; Android không có
 * Arial thì `local()` hỏng, trình duyệt bỏ qua sang font kế tiếp như cũ. */
@font-face {
  font-family: 'Barlow Fallback';
  font-style: normal;
  font-weight: 100 500;
  src: local('Arial'), local('ArialMT');
  size-adjust: 93.5%;
  ascent-override: 106.95%;
  descent-override: 21.39%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Barlow Fallback';
  font-style: normal;
  font-weight: 600 900;
  src: local('Arial Bold'), local('Arial-BoldMT');
  size-adjust: 87%;
  ascent-override: 114.94%;
  descent-override: 22.99%;
  line-gap-override: 0%;
}

/* Cùng cách cho Barlow Condensed (font tiêu đề). Hẹp hơn Arial Bold rất nhiều:
 * tỷ lệ bề rộng đo canvas, chữ hoa 700: 0,67–0,68, 600: 0,66–0,67; chữ thường
 * 0,74. Lấy 68% theo chữ hoa — tiêu đề gần như toàn chữ hoa. hhea Barlow
 * Condensed 1000/200, chia cho 0,68.
 *
 * Lộ ra khi có critical CSS: trang vẽ trước khi font tiêu đề về, H1 bài viết
 * bằng Oswald/Arial Narrow dài thêm một dòng (29px) rồi co lại — CLS 0,018 ở
 * 2/5 lần đo. Có mặt này: 0/5. */
@font-face {
  font-family: 'Barlow Condensed Fallback';
  font-style: normal;
  font-weight: 100 900;
  src: local('Arial Bold'), local('Arial-BoldMT');
  size-adjust: 68%;
  ascent-override: 147.06%;
  descent-override: 29.41%;
  line-gap-override: 0%;
}

/* Barlow 400 — vietnamese */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./barlow-400-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Barlow 400 — latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./barlow-400-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-0101, U+0104-010F, U+0112-0127, U+012A-0167, U+016A-019F, U+01A2-01AE, U+01B1-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EFA-1EFF, U+2020, U+20A0-20AA, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow 400 — latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(./barlow-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Barlow 600 — vietnamese */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(./barlow-600-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Barlow 600 — latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(./barlow-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-0101, U+0104-010F, U+0112-0127, U+012A-0167, U+016A-019F, U+01A2-01AE, U+01B1-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EFA-1EFF, U+2020, U+20A0-20AA, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow 600 — latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(./barlow-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Barlow 700 — vietnamese */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url(./barlow-700-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Barlow 700 — latin-ext */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url(./barlow-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-0101, U+0104-010F, U+0112-0127, U+012A-0167, U+016A-019F, U+01A2-01AE, U+01B1-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EFA-1EFF, U+2020, U+20A0-20AA, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow 700 — latin */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url(./barlow-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Barlow Condensed 600 — vietnamese */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(./barlow-condensed-600-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Barlow Condensed 600 — latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(./barlow-condensed-600-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-0101, U+0104-010F, U+0112-0127, U+012A-0167, U+016A-019F, U+01A2-01AE, U+01B1-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EFA-1EFF, U+2020, U+20A0-20AA, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow Condensed 600 — latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url(./barlow-condensed-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Barlow Condensed 700 — vietnamese */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url(./barlow-condensed-700-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Barlow Condensed 700 — latin-ext */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url(./barlow-condensed-700-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-0101, U+0104-010F, U+0112-0127, U+012A-0167, U+016A-019F, U+01A2-01AE, U+01B1-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EFA-1EFF, U+2020, U+20A0-20AA, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Barlow Condensed 700 — latin */
@font-face {
  font-family: 'Barlow Condensed';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url(./barlow-condensed-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

