/* =====================================================================
   Khmer (km-KH) typography override sheet — km.anvirs.co.za
   Loaded last in <head> so it wins the cascade over the theme stylesheets.

   Why this sheet exists (Khmer script facts):
   - Stacked consonants (ត្រ, ស្ត) and subscript/superscript vowel signs make
     Khmer line boxes ~1.8-2.2x the font size; the theme's tight px
     line-heights would overlap adjacent lines.
   - Khmer has no uppercase/lowercase. text-transform:uppercase mangles the
     embedded Latin brand words (WhatsApp -> WHATSAPP) and does nothing for
     Khmer, so every transform is neutralised.
   - Khmer does not use spaces between words inside a clause, so browsers can
     only break via the ICU dictionary (enabled by <html lang="km">) or, as a
     last resort, overflow-wrap.
   - The theme stack is "Lato,sans-serif" and Lato has no Khmer glyphs, so the
     self-hosted Noto Sans Khmer is declared both as its own family and as a
     late-declared Khmer-subset face under the 'Lato' name.
   ===================================================================== */

/* --- 1. Self-hosted Noto Sans Khmer (variable weight 100-900) --- */
@font-face {
  font-family: 'Noto Sans Khmer';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/notosanskhmer-khmer.woff2') format('woff2');
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Khmer';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/notosanskhmer-khmer.woff2') format('woff2');
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Khmer';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/notosanskhmer-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;
}
@font-face {
  font-family: 'Noto Sans Khmer';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/notosanskhmer-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-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+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- 2. Family alias: rules that say font-family:Lato,sans-serif resolve
         Khmer codepoints through this late-declared subset face. The build
         also patches the stacks directly (Lato,'Noto Sans Khmer',sans-serif),
         so this is the belt to that brace. --- */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/notosanskhmer-khmer.woff2') format('woff2');
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

/* --- 3. Stack floor + spaceless-script handling --- */
html { font-family: 'Lato', 'Noto Sans Khmer', 'Khmer OS', sans-serif; }
*, *::before, *::after {
  overflow-wrap: break-word;      /* no intra-clause spaces: allow last-resort breaks */
  text-transform: none !important; /* Khmer has no case; transforms only mangle Latin */
}

/* --- 4. Line-height floors (display 1.6, subheads 1.75, body 1.9) --- */
body { line-height: 1.9; }

h1, .h1, h1.aa-custom-title,
.aa-hero-front h1, .aa-hero-front h1.aa-custom-title,
.aa-system .hs_cos_wrapper_type_email_subscriptions_confirmation .success {
  line-height: 1.6;
}

h2, .h2, .footer h2,
.aa-system .hs_cos_wrapper_type_email_subscriptions_confirmation .page-header h1 {
  line-height: 1.6;
}

h3, .h3, h4, .h4, blockquote,
.aa-system .hs_cos_wrapper_type_email_subscriptions_confirmation .page-header h2,
.hs-form .form-title,
.aa-info-numbers__title-box {
  line-height: 1.75;
}

h5, .h5, h6, .h6,
figcaption, .aa-label, .aa-subheading,
.aa-system #email-prefs-form .item .checkbox-row > span > span,
.hs-form, .hs-form legend,
.aa-text-size--small, .aa-text-size--large,
.aa-navigation--primary .hs-menu-wrapper > ul > li > a,
.aa-navigation--mobile,
.aa-navigation--mobile .hs-menu-depth-1 > a,
.aa-video-button p,
.aa-quote__body blockquote,
.aa-quote__body .aa-quote__name,
.aa-quote__body .aa-quote__title,
.aa-article-card__header .aa-article-card__date,
.aa-case-card__read-more,
.aa-case-cards-v2 .aa-case-card__read-more,
p, .enquiry-text, .intro-text, .legal-content, .privacy-content,
.consent-text, .checkbox-label, .checkbox-container label,
.hs-menu-children-wrapper a,
ul.hs-error-msgs label {
  line-height: 1.9;
}

/* --- 5. Form controls: single-line Khmer still needs headroom --- */
button, input, optgroup, select, textarea { line-height: 1.6; }
.aa-button, .aa-system .hs-button, .hs-button, .hs-form .hs-button { line-height: 1.6; }
.hs-input, .aa-system .hs_cos_wrapper_type_password_prompt #hs-pwd-widget-password { line-height: 1.7; }
select { height: auto; }

/* --- 6. Fixed-height relaxations for taller line boxes --- */
.aa-navigation--mobile ul li a { height: auto; min-height: 60px; }

/* --- 7. Small-Khmer cosmetics --- */
.logo-text { letter-spacing: normal; }
