/*
 | KHERP typography - Kantumruy Pro (Khmer + Latin), self-hosted.
 |
 | The .woff2/.ttf binaries SHIP with KHERP in public/fonts/kantumruy-pro/ —
 | nothing to download, nothing to run. Confirm them with
 |     php artisan kherp:fonts:verify
 | and re-fetch them on a machine with internet using
 |     bash public/fonts/kantumruy-pro/install-fonts.sh
 |
 | URLs below are RELATIVE to this stylesheet (../fonts/...) so they resolve
 | both at a domain root and in a sub-folder install such as /kh-erp.
 */

@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/kantumruy-pro/KantumruyPro-Light.woff2') format('woff2'),
       url('../fonts/kantumruy-pro/KantumruyPro-Light.ttf') format('truetype');
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/kantumruy-pro/KantumruyPro-Regular.woff2') format('woff2'),
       url('../fonts/kantumruy-pro/KantumruyPro-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/kantumruy-pro/KantumruyPro-Medium.woff2') format('woff2'),
       url('../fonts/kantumruy-pro/KantumruyPro-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/kantumruy-pro/KantumruyPro-SemiBold.woff2') format('woff2'),
       url('../fonts/kantumruy-pro/KantumruyPro-SemiBold.ttf') format('truetype');
}
@font-face {
  font-family: 'Kantumruy Pro';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/kantumruy-pro/KantumruyPro-Bold.woff2') format('woff2'),
       url('../fonts/kantumruy-pro/KantumruyPro-Bold.ttf') format('truetype');
}

:root {
  --kherp-font-sans: 'Kantumruy Pro', 'Noto Sans Khmer', 'Khmer OS Battambang',
                     'Khmer OS', 'Hanuman', -apple-system, BlinkMacSystemFont,
                     'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* v1.7.2 - Kantumruy Pro before the generic family: the monospace faces
     have no Khmer glyphs, so the riel sign (៛) in prices showed as a box
     wherever the OS had no Khmer font or Google Fonts was unreachable. */
  --kherp-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', 'Kantumruy Pro', monospace;
  /* Khmer glyphs carry tall stacked diacritics: give them room. */
  --kherp-line-height: 1.75;
}

html, body,
button, input, select, textarea, optgroup,
.ant-btn, .ant-input, .ant-select, .ant-table, .ant-modal,
.ant-menu, .ant-form, .ant-card, .ant-drawer, .ant-dropdown,
.ant-message, .ant-notification, .ant-tooltip, .ant-picker,
.ant-tabs, .ant-descriptions, .ant-statistic, .ant-typography,
.ant-select-dropdown, .ant-picker-dropdown, .ant-popover, .ant-empty,
.ant-segmented, .ant-alert, .ant-result, .ant-list, .ant-tag, .ant-badge,
.ant-pagination, .ant-steps, .ant-collapse, .ant-breadcrumb, .ant-tree,
.ant-upload, .ant-radio-wrapper, .ant-checkbox-wrapper, .ant-cascader-dropdown {
  font-family: var(--kherp-font-sans) !important;
}

html[lang='km'] body,
[lang='km'] {
  line-height: var(--kherp-line-height);
  /* Khmer needs slightly larger optical size at the same px value. */
  font-size: 1.02em;
}

/* Khmer text must never be letter-spaced or uppercased: it destroys clusters. */
html[lang='km'] * {
  letter-spacing: normal !important;
  text-transform: none !important;
}

code, pre, kbd, samp, .kherp-mono, .ant-input-number-input,
.font-mono, .price {
  font-family: var(--kherp-font-mono);
}

@media print {
  body, .invoice, .receipt, .pdf-page { font-family: var(--kherp-font-sans); }
}
