/* Georgian language font enhancements.
   Strategy:
   1. Keep Inter for Latin/Cyrillic UI chrome.
   2. Use a Georgian-capable modern sans (system fallback first) with optional Noto Sans Georgian if later self-hosted.
   3. Provide :lang(ka) overrides for legibility: slightly larger line-height & letter-spacing neutral (Georgian usually needs no extra tracking at normal weights).
*/

/* Optional Noto Sans Georgian is injected from layouts when the WOFF2 file exists
  via an inline @font-face with unicode-range (U+10A0–10FF, U+2D00–2D2F) and a
  matching <link rel="preload"> to avoid FOIT. Keeping it out of this static CSS
  prevents 404s in environments where the file hasn't been provisioned yet. */

:root {
  /* Augment the existing CSS custom property if used elsewhere */
  --gambit-font-georgian-stack: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Noto Sans Georgian", "DejaVu Sans", "Segoe UI", "Arial", sans-serif;
}

/* Apply only when document language is Georgian */
html:lang(ka), body:lang(ka) {
  font-family: var(--gambit-font-georgian-stack);
}

/* Scoped override for Georgian text fragments inside mixed-language pages */
:lang(ka) {
  font-family: var(--gambit-font-georgian-stack);
  /* Slightly increase line-height for multi-weight blending */
  line-height: 1.55;
}

/* Headings in Georgian – keep weights consistent but do not change sizes vs other locales */
:lang(ka) h1, :lang(ka) .h1 { font-weight: 600; letter-spacing: 0; }
:lang(ka) h2, :lang(ka) .h2 { font-weight: 600; letter-spacing: 0; }
:lang(ka) h3, :lang(ka) .h3 { font-weight: 600; letter-spacing: 0; }

/* Body copy for Georgian */
:lang(ka) body {
  /* target within recommended 1.5–1.65 */
  line-height: 1.6;
}

/* Fine‑tune small UI elements (badges, nav, buttons) for Georgian: keep only family/line-height */
:lang(ka) .nav, :lang(ka) .btn, :lang(ka) .badge, :lang(ka) .form-control, :lang(ka) .dropdown-item {
  font-family: var(--gambit-font-georgian-stack);
  line-height: 1.35;
}

/* Improve readability for long Georgian paragraphs */
:lang(ka) p, :lang(ka) li {
  /* Prefer overflow-wrap for natural breaks; keep hyphenation */
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* Utility: Tabular numerals for prices, tables, dashboards */
.ka-tabular { font-variant-numeric: tabular-nums; }

/* Utility: Mixed-language inline baseline tweak */
.ka-inline { line-height: 1.35; position: relative; top: .5px; }

/* Optional: Serif content block for long-form Georgian (requires serif font availability) */
.ka-serif { font-family: "Noto Serif Georgian", var(--gambit-font-georgian-stack); }

/* Optional dark mode adjustments could go here if needed */
@media (prefers-color-scheme: dark) {
  :lang(ka) p, :lang(ka) li { color: var(--tblr-body-color); }
  /* Opt-in helper for tiny Georgian text that looks too thin in dark */
  .ka-dark-boost { text-shadow: 0 0 .01em rgba(255,255,255,.05); }
}
