/* Heading shrink + fluid scaling.
   Rules target one Tailwind text-* size on each heading element.
   Rules are ordered smallest -> largest so the LARGEST matching size wins
   via CSS cascade order — that way an h1 with `text-5xl md:text-7xl
   lg:text-[6rem]` is governed by the text-[6rem] rule (its true desktop
   max), not the text-5xl rule.
   Each clamp() caps at ~85% of the source size (the requested 15% shrink)
   with a smaller mobile floor to prevent 3-line wrapping on narrow viewports.
   !important is required to override Tailwind utility classes inline. */

h1, h2, h3, h4 { text-wrap: balance; }

/* Body copy & list items: avoid stranding a single orphan word on the last line.
   Modern browsers (Chrome 117+, Safari 17.4+) honor text-wrap:pretty; older
   browsers wrap normally (current behavior — no regression). */
p, li, blockquote, figcaption {
  text-wrap: pretty;
}

/* h1 ladder — smallest to largest source size */
h1[class*="text-2xl"]      { font-size: clamp(1.05rem, 0.85rem + 0.5vw,  1.275rem) !important; line-height: 1.20 !important; }
h1[class*="text-3xl"]      { font-size: clamp(1.20rem, 0.85rem + 0.95vw, 1.594rem) !important; line-height: 1.18 !important; }
h1[class*="text-4xl"]      { font-size: clamp(1.40rem, 0.85rem + 1.5vw,  1.912rem) !important; line-height: 1.15 !important; }
h1[class*="text-5xl"]      { font-size: clamp(1.60rem, 1.00rem + 2.0vw,  2.550rem) !important; line-height: 1.10 !important; }
h1[class*="text-6xl"]      { font-size: clamp(1.85rem, 1.10rem + 3.0vw,  3.187rem) !important; line-height: 1.08 !important; }
h1[class*="text-7xl"]      { font-size: clamp(2.00rem, 1.20rem + 3.5vw,  3.825rem) !important; line-height: 1.07 !important; }
h1[class*="text-[5.5rem]"] { font-size: clamp(2.10rem, 1.30rem + 4.2vw,  4.675rem) !important; line-height: 1.06 !important; }
h1[class*="text-[6rem]"]   { font-size: clamp(2.20rem, 1.40rem + 4.5vw,  5.100rem) !important; line-height: 1.05 !important; }

/* h2 ladder */
h2[class*="text-xl"]       { font-size: clamp(1.00rem, 0.85rem + 0.3vw,  1.063rem) !important; line-height: 1.25 !important; }
h2[class*="text-2xl"]      { font-size: clamp(1.10rem, 0.85rem + 0.55vw, 1.275rem) !important; line-height: 1.22 !important; }
h2[class*="text-3xl"]      { font-size: clamp(1.25rem, 0.85rem + 1.05vw, 1.594rem) !important; line-height: 1.20 !important; }
h2[class*="text-4xl"]      { font-size: clamp(1.40rem, 0.90rem + 1.4vw,  1.912rem) !important; line-height: 1.18 !important; }
h2[class*="text-5xl"]      { font-size: clamp(1.60rem, 1.00rem + 1.8vw,  2.550rem) !important; line-height: 1.10 !important; }

/* h3 ladder */
h3[class*="text-lg"]       { font-size: clamp(0.95rem, 0.85rem + 0.2vw,  1.000rem) !important; line-height: 1.30 !important; }
h3[class*="text-xl"]       { font-size: clamp(1.00rem, 0.85rem + 0.3vw,  1.063rem) !important; line-height: 1.28 !important; }
h3[class*="text-2xl"]      { font-size: clamp(1.10rem, 0.85rem + 0.55vw, 1.275rem) !important; line-height: 1.22 !important; }
h3[class*="text-3xl"]      { font-size: clamp(1.25rem, 0.85rem + 1.05vw, 1.594rem) !important; line-height: 1.18 !important; }

/* h4 — keep simple, ~15% off Tailwind text-xl/text-lg */
h4 { font-size: 0.95rem !important; line-height: 1.30; }
