/*
 * kkbc-home-fit-2.css - home page text that must fit its box (issue #219, 2026-10-16; long words 2026-10-17). Loaded after every other stylesheet
 * (inc/kkbc-home-fit.php, priority 27). js/kkbc-home-fit-4.js refines the sizes below by measuring the text; this file is what a
 * browser without script shows. A later change of this file gets a new name (kkbc-home-fit-3.css): the CDN keeps a file under its old name.
 *
 * 1. Hero heading up to 1024 px. Old rules: responsive-2.css:1221 sets font-size:65px !important and line-height:75px on a phone
 *    (a box 240 px high, three lines), so "croissance." (fr), "tăng trưởng." (vi) and "Impulsamos el crecimiento" (es) were wider
 *    than the 350 px box or needed a fourth line that lay over the subtitle. custom-2.css:501 sets 10vw from 551 px. The only way
 *    to beat the old !important is another !important (the one place in this file). clamp() gives a size that follows the width;
 *    the script then picks the largest size at which the real text fits the width and the height of the box.
 * 1a. The box of the hero heading on a phone (2026-10-17). responsive-2.css:1220 makes .TypingHead an absolute box with no width up to
 *    550 px, so it is as wide as its longest unbreakable piece of text: the Japanese heading (word-break:auto-phrase keeps a phrase
 *    together) made it 358 px wide in the 350 px .TypingBox. The script measured the heading against that grown box, so it never made the
 *    text smaller. left:0 and right:0 hold the box to the width of .TypingBox; a text that is too wide now shows as overflow, and the
 *    script makes the font smaller until it fits.
 * 1b. Room for the typing cursor at every width (2026-10-17). The cursor is the :after of .typingText, absolutely placed after the last
 *    letter (css/kkbc-hero-type-1.css:25: gap 0.08em + bar 0.06em = 0.14em), so it takes no part in line breaking. When the last word
 *    ended at the edge of the box, the bar stood 4 to 10 px outside the box: "Wachstum." (de, 390 px), "pertumbuhan." (ms, 390 and
 *    768 px), "groei." (nl, 1440 px). An end padding of 0.14em on the inline .typingText belongs to its last letter (no break between
 *    them), so a line that has no room for the bar moves its last word to the next line, and the script counts the bar in its search.
 * 2. The word in the circle: one line, never broken inside a word (for Chinese, Japanese and Korean the whole word stays on one line).
 *    The script scales the font to the part of the circle that is on the screen.
 * 3. "Who we are" and "Industry expertise" stand one under the other from 551 to 768 px. responsive-2.css:171 gives the box a bottom margin
 *    only from 769 to 1024 px, so the link "Know more about us" touched the next heading at 768 px. Up to 550 px the heading has its own
 *    space (60 px measured), so the rule stops there.
 * 4. Long words in the headings (2026-10-17), first seen in the "Our expertise" heading. style-2.css:904 makes the span an inline-block of 40 px text; an inline-block
 *    is as wide as its longest word, so "Kompetensområden" (sv) made a span 381 px wide in a 350 px box at 390 px and the page scrolled
 *    sideways (401 px). max-width:100% keeps the span in the box, and overflow-wrap:break-word breaks only a word that is wider than the
 *    whole line. js/kkbc-home-fit-4.js adds the class kkbc-long-word to any h2 or h3 that has such a word; the class turns on
 *    hyphens:auto and overflow-wrap:break-word, so the break is at a syllable, with a hyphen, by the lang attribute of the page. A text that fits does not change.
 */

/* ---- 1. hero heading ---- */
@media screen and (max-width: 550px) {
  .TypingArea .TypingBox .TypingHead {
    left: 0;
    right: 0;
  }
  .TypingArea .TypingBox .TypingHead h1 {
    font-size: clamp(34px, 11vw, 65px) !important;
    line-height: 1.15 !important;
    -webkit-hyphens: manual;
    hyphens: manual;
    overflow-wrap: normal;
  }
}
@media screen and (min-width: 551px) and (max-width: 1024px) {
  .TypingArea .TypingBox .TypingHead h1 {
    -webkit-hyphens: manual;
    hyphens: manual;
    overflow-wrap: normal;
  }
}

/* ---- 1b. room for the typing cursor ---- */
.TypingArea .TypingBox .TypingHead h1 .typingText {
  padding-inline-end: 0.14em;
}

/* ---- 2. word in the circle ---- */
.unique_area .unique_right span {
  display: inline-block;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

/* ---- 3. space under the first "Who we are" block ---- */
@media screen and (min-width: 551px) and (max-width: 768px) {
  #WhoWeAre.who_area .col-sm-6:first-child .who_box {
    margin-bottom: 40px;
  }
}

/* ---- 4. long words in the "Our expertise" heading ---- */
.expertise_area h2 span {
  max-width: 100%;
  overflow-wrap: break-word;
}
/* every h2 and h3 of the home page that the script marks (a piece of text wider than the box); hyphens and overflow-wrap are inherited,
   so a span inside the heading follows. The principles heading has its own rule (kkbc-home-principles-2.css), which beats its hyphens:manual. */
h2.kkbc-long-word,
h3.kkbc-long-word {
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}
