/* Famílias originais, hospedadas localmente. Licenças em /fontes/. */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(./fontes/ibm-plex-mono-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(./fontes/sora-latin.woff2) format('woff2');
}
/* Latin Extended do Sora (mesma família): cobre ğ Ğ ş Ş İ ı do turco e o latino estendido.
   O navegador escolhe o arquivo por glifo; o latino básico continua no sora-latin.woff2. */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(./fontes/sora-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Vietnamita: o Sora não tem os diacríticos (ạ ầ ễ ộ ự…). O Inter local entra inteiro
   em :lang(vi), como o Inter cirílico faz no RU: latin básico + vietnamese na mesma família. */
@font-face {
  font-family: 'Via Hype Sans VI';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(./fontes/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Via Hype Sans VI';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(./fontes/inter-vietnamese.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* Russo: o Sora não tem glifos cirílicos. Derivadas OFL de Inter e IBM Plex Mono entram só em :lang(ru),
   então EN/PT continuam com as mesmas fontes e o navegador não baixa estes arquivos nas outras páginas. */
@font-face {
  font-family: 'Via Hype Sans RU';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(./fontes/inter-ru.woff2) format('woff2');
}
@font-face {
  font-family: 'Via Hype Mono RU';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(./fontes/ibm-plex-mono-ru.woff2) format('woff2');
}
:root:lang(ru) {
  --head: 'Via Hype Sans RU', 'Sora', system-ui, sans-serif;
  --mono: 'Via Hype Mono RU', 'IBM Plex Mono', ui-monospace, monospace;
}

/* Espanhol e francês: o Sora já cobre o latino necessário (Latin-1, œ/Œ, aspas tipográficas).
   Nenhuma fonte extra. */

/* Turco: o subset latin-ext do Sora cobre ğ ş ı İ; não há fonte de sistema no meio.
   Vietnamita: Inter vietnamese local na frente, Sora para o que ele não cobre. */
:root:lang(vi) {
  --head: 'Via Hype Sans VI', 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
:root:lang(tr) {
  --head: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

/* Chinês simplificado: sem webfont CJK (peso). O latino segue no Sora; os hanzi vêm da
   pilha de sistema, dos sistemas mais comuns para os menos comuns. */
:root:lang(zh) {
  --head: 'Sora', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Hiragino Sans GB', 'Source Han Sans SC', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Hiragino Sans GB', 'Source Han Sans SC', monospace;
}

/* Coreano: mesma lógica; Apple SD Gothic Neo (macOS/iOS), Malgun Gothic (Windows),
   Noto Sans CJK KR e Nanum Gothic (Linux/Android). */
:root:lang(ko) {
  --head: 'Sora', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', 'Nanum Gothic', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', 'Nanum Gothic', monospace;
}

/* Quebra de linha CJK: line-break: strict evita pontuação proibida no início/fim da linha.
   Nos botões e chips, word-break: break-word impede que um termo longo estoure a caixa. */
:lang(zh),
:lang(ko) {
  line-break: strict;
}
/* O coreano separa palavras por espaço (띄어쓰기): quebrar dentro de uma palavra ("넓히세/요")
   é erro tipográfico. keep-all só quebra nos espaços; overflow-wrap evita estouro em termos longos. */
:lang(ko) {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
:lang(zh) :is(button, .btn, [role="button"], .chip, .etiqueta),
:lang(ko) :is(button, .btn, [role="button"], .chip, .etiqueta) {
  word-break: break-word;
  line-break: strict;
  hyphens: none;
}

/* Turco: o Sora latin-ext tem İ/ı/ğ/ş. Não adicionamos text-transform: uppercase em :lang(tr)
   além do que o design já usa; o casing correto (i→İ, ı→I) depende de lang="tr" —
   não substitua por toUpperCase() no JS, que produz "I" no lugar de "İ". */
:lang(tr) :is(button, .btn, [role="button"]) {
  overflow-wrap: break-word;
}
