/*
 * Bangla typography refinements.
 * Loaded after the main bundle and kept outside any cascade layer, so these
 * rules win over the Tailwind utilities when the page language is Bangla.
 */

/* Bornomala — the site-wide font for both Bangla and English text */
@font-face {
  font-family: "Bornomala";
  src: url("/fonts/Bornomala-Regular.ttf") format("truetype");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bornomala";
  src: url("/fonts/Bornomala-Bold.ttf") format("truetype");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

:root,
:host {
  --font-sans: "Bornomala", system-ui, sans-serif;
  --default-font-family: "Bornomala", system-ui, sans-serif;
}

body,
.font-display,
input,
textarea,
select,
button {
  font-family: "Bornomala", system-ui, sans-serif;
}


/* Smoother shaping of conjuncts (যুক্তাক্ষর) and vowel signs (কার) */
:lang(bn) body {
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-synthesis: none; /* never fake bold/italic Bangla glyphs */
  word-spacing: 0.04em;
}

/* Headings */
:lang(bn) .font-display {
  font-weight: 600;
  letter-spacing: 0;
}

/* Letter-spacing breaks the joined headline (মাত্রা) — keep it natural */
:lang(bn) .tracking-tight,
:lang(bn) .tracking-wide,
:lang(bn) .tracking-wider {
  letter-spacing: 0;
}

/* Bangla has no italics; slanted glyphs look broken */
:lang(bn) em,
:lang(bn) i,
:lang(bn) .italic,
:lang(bn) .md\:italic {
  font-style: normal;
}

/* Room for upper vowel signs (ি ী ৈ ৌ) and lower ones (ু ূ ৃ) so they are never clipped */
:lang(bn) h1,
:lang(bn) h2,
:lang(bn) h3,
:lang(bn) h4,
:lang(bn) .text-2xl,
:lang(bn) .text-3xl,
:lang(bn) .text-4xl,
:lang(bn) .text-5xl,
:lang(bn) .text-7xl,
:lang(bn) .text-\[1\.7rem\],
:lang(bn) .text-\[2\.6rem\] {
  line-height: 1.4;
}

:lang(bn) .leading-\[1\.08\],
:lang(bn) .md\:leading-\[1\.02\] {
  line-height: 1.32;
}

:lang(bn) .leading-tight {
  line-height: 1.45;
}

:lang(bn) .leading-none {
  line-height: 1.2;
}

:lang(bn) .leading-relaxed {
  line-height: 1.8;
}

:lang(bn) .text-xs,
:lang(bn) .text-sm,
:lang(bn) .text-\[11px\],
:lang(bn) .text-\[12px\],
:lang(bn) .text-\[13px\] {
  line-height: 1.6;
}

/* Tiny Bangla text is hard to read — nudge the smallest sizes up */
:lang(bn) .text-xs {
  font-size: 0.8rem;
}
:lang(bn) .text-\[11px\] {
  font-size: 12.5px;
}
:lang(bn) .text-\[12px\] {
  font-size: 13px;
}

/* Clamped / truncated lines need extra height so matras aren't cut off */
:lang(bn) .line-clamp-2,
:lang(bn) .truncate {
  line-height: 1.6;
  padding-block: 0.05em;
}

/* Underlines sit below the letters instead of slicing through vowel signs */
:lang(bn) a,
:lang(bn) u {
  text-underline-offset: 0.3em;
}

/* Form fields and buttons use the same Bangla font as the page */
:lang(bn) input,
:lang(bn) textarea,
:lang(bn) select,
:lang(bn) button {
  font-family: inherit;
}
:lang(bn) ::placeholder {
  font-family: "Bornomala", system-ui, sans-serif;
}
