/* Fixes for one language, on every page in it: flow.html, editor.html and the site pages link this file after their
   other stylesheets. Only rules under html:lang(<code>), for a cause in that language (how its script breaks lines,
   a longer word in a narrow control); a layout fix every language needs goes in the component's own CSS.
   Convention: dev/postround/I18N.md ("Checking a language"). */

/* ---------- Korean (ko) ----------
   Korean is set with spaces between words, and a line breaks at a space, never inside a word. Browsers break Hangul
   between any two syllables by default ("지루 / 한", "환영 / 해요"). keep-all moves the breaks to the spaces;
   overflow-wrap: break-word still breaks a word that is wider than its whole line. Set on the root and inherited,
   so a component's own rule wins. */
html:lang(ko) { word-break: keep-all; overflow-wrap: break-word; }
/* The player's own caption text in the preview wraps as it did: it is their text, and the export draws it. */
:lang(ko) .cap-line { word-break: normal; }
/* Site page headings: the Latin-tuned tracking and sub-1 line height make Hangul syllables and lines touch
   ("세로 클립에서 / 킬로그 남기는 법"), since Hangul fills its whole em box. */
html:lang(ko) .home h1 { line-height: 1.12; letter-spacing: -.025em; }
html:lang(ko) .home h2 { line-height: 1.2; letter-spacing: -.02em; }

/* ---------- Japanese (ja) ----------
   Japanese has no spaces, so the browser breaks between any two characters: labels and headings split inside a word
   ("クリ / ップ", "ログイ / ン中", "ヘッドショッ / ト") and a line can start with ー, a small kana or leave a lone "う。"
   ("ート動画に", "ップを"), which Japanese typesetting never does. line-break: strict keeps ー, small kana and closing
   marks off the start of a line (kinsoku), everywhere. word-break: auto-phrase (Chrome and Edge 119+, Japanese
   only) breaks between phrases instead, in the editor and in the site pages' headings, buttons and short lines;
   other browsers keep breaking between characters. overflow-wrap: break-word still breaks a phrase that is wider
   than its line. Article paragraphs keep breaking between characters, as Japanese body text does. */
html:lang(ja) { line-break: strict; }
html:lang(ja) :is(#app, h1, h2, h3, h4, summary, button, label, dt, figcaption, nav, .btn, .home-eyebrow, .home-lede,
  .home-access, .home-legal, .home-strip, .home-art, .home-video-label, .home-video-note, .home-closing-text, .home-replay-text,
  .home-missing p, .legal-kicker, .legal-lede) {
  word-break: auto-phrase; overflow-wrap: break-word;
}
/* The player's own text wraps as it did: captions in the preview (the export draws them) and what they type. */
html:lang(ja) :is(.cap-line, input, textarea) { word-break: normal; }
/* Headlines: Latin-tuned tight lines and tracking make kana and kanji touch. Full-width glyphs are wider than
   Latin letters, so the landing headline gets a size that keeps it at three lines, one phrase each, in its column. */
html:lang(ja) .home h1 { line-height: 1.12; letter-spacing: -.02em; }
html:lang(ja) #home-title { font-size: clamp(40px, 4.6vw, 68px); }
html:lang(ja) .home h2 { line-height: 1.25; letter-spacing: -.01em; }
/* Trim's kill row: while its buttons show (hover, focus, "What is wrong?" open) the note's "ボディショット" is wider
   than what is left and broke as "ボディショッ / ト". One line, cut with "…" like the victim's name above it. */
html:lang(ja) .screen-trim .trim-knote { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Spanish (es) ----------
   Spanish labels run longer than English ("Recortar", "Siguiente", "Volver", "1 seleccionado"). */
/* Effect between cuts: "Desenfoque" did not fit a quarter of the sidebar ("Desenfo…"). Each option takes the width
   its word needs, and the rest of the row is shared out. */
html:lang(es) .cut-effect .seg { grid-auto-columns: auto; }

/* ---------- French (fr) ----------
   French labels run longer than English ("Découpe", "Sous-titres", "Suivant", "Lancer le rendu", "0 sélectionné"). */
/* Editor header: the centred steps are wider, so the side holding the step's note and buttons is narrower. At 1440 px
   the note was cut ("On garde 6,1 s su…", "4 s…") or gone, and on Vertical the buttons ran into the Export step; at
   1366 px they ran over it by 43 px. From 900 px up the steps also sit closer together. (In every language, base.css:
   the language button is only its code there, the steps have 8 px a side, and on a phone Back and the step's
   button are tighter.) */
@media (min-width: 900px) {
  html:lang(fr) .shell-steps { gap: 4px; }
}
/* Vertical, Kill card: five equal columns cut "Classique" and "Compteur" to "Classi…" and "Comp…". Each option takes
   the width its word needs, and the rest of the row is shared out. */
html:lang(fr) .screen-vertical .seg { grid-auto-columns: auto; }

/* ---------- Portuguese, Brazil (pt-BR) ----------
   Labels run longer than English ("Renderizar", "Voltar", "Exportar", "Seus clipes"), and the language button says
   "Português (Brasil)". The UI faces cover Latin-1, so ã, ç, é, õ need no fallback font. */
/* Editor header: the side holding the note and buttons is wider than its half of the header, so on a laptop Voltar
   slid over the last step ("5 Ex" under Voltar on Vertical at 1440 px, Exportar's underline under Voltar on Export,
   Legendas from 1366 px) and the note was cut or gone. From 900 to 1365 px the steps show their numbers and only the
   current step's name, as on a phone (the other names stay for screen readers), and below 1100 px the account button
   shows only its picture, as on a phone. (In every language, base.css: below 1680 px the language button is only its
   code, and the steps have 8 px a side.) */
@media (min-width: 900px) and (max-width: 1365.98px) {
  html:lang(pt-BR) .shell-step:not([aria-current="step"]) > span:not(.shell-step-num) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 900px) and (max-width: 1099.98px) {
  html:lang(pt-BR) .shell-user { padding: 0 4px; }
  html:lang(pt-BR) .shell-user-name { display: none; }
}
/* Phone header: Voltar and the step's button covered the Seus clipes button and cut "Killcut" to "Kill" (Vertical,
   Export, Legendas). Seus clipes shows only its icon up to 599 px (not 419 px; its name stays for screen readers),
   and below 380 px the logo stands without the word Killcut. (In every language, base.css: the language button is
   tighter on a phone, and below 420 px Voltar and the step's button are too.) */
@media (max-width: 599.98px) {
  html:lang(pt-BR) .shell-clips { width: 32px; padding: 0; justify-content: center; }
  html:lang(pt-BR) .shell-clips > span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 379.98px) {
  html:lang(pt-BR) .shell-name > span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* Vertical, Kill card: five equal columns cut "Nenhum", "Clássico" and "Contador" to "Nenh…", "Clássi…", "Conta…"
   beside a short "OG". Each option takes the width its word needs, and the rest of the row is shared out. */
html:lang(pt-BR) .screen-vertical .seg { grid-auto-columns: minmax(0, auto); }
