/* LecturaLingua — style.css (même famille visuelle que WikiLeXiK) */

@font-face { font-family: "Andika"; font-weight: 400; font-display: swap;
  src: url("fonts/andika-400-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: "Andika"; font-weight: 400; font-display: swap;
  src: url("fonts/andika-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-036F, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Andika"; font-weight: 700; font-display: swap;
  src: url("fonts/andika-700-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: "Andika"; font-weight: 700; font-display: swap;
  src: url("fonts/andika-700-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-036F, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --fond: #fff; --fond2: #f6f6f3; --fond3: #eeeeea;
  --texte: #1b1b1b; --texte2: #5a5a5a; --texte3: #8a8a86;
  --accent: #2a5ea8; --accent2: #1d4580; --puce: #e8eff8;
  --bord: #dcdcd8; --bord2: #ececea;
  --ipa: #6b4c9a; --erreur: #a8322a; --erreur-fond: #fbeceb;
  --syl1: #c62828; --syl2: #1f5fbf; --syl3: #2e7d32;
  --muette: #b5b5b0; --liaison: #e07b00;
  --son-consonne: #3366cc; --son-voyelle: #cc3333; --son-compose: #33aa33; --son-formule: #9933cc;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Code", "Source Code Pro", monospace;
  --phon: "Andika", "Charis SIL", "Doulos SIL", "Noto Sans", "DejaVu Sans", sans-serif;
  --largeur: 62rem;
  --entete: 3.25rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--texte); background: var(--fond); line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent2); text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .35rem; line-height: 1.25; }
h1 small { font-size: .95rem; font-weight: 400; color: var(--texte2); margin-left: .35rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--fond2); padding: .05em .3em; border-radius: 3px; }
[hidden] { display: none !important; }

/* ── En-tête fin et fixe ──────────────────────────────── */
.entete { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.96); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--bord); }
.entete-int { max-width: var(--largeur); margin: 0 auto; padding: 0 1rem; height: var(--entete);
  display: flex; align-items: center; gap: 1rem; }
.logo { font-weight: 700; font-size: 1.1rem; letter-spacing: .01em; color: var(--texte); white-space: nowrap; }
.logo:hover { text-decoration: none; color: var(--texte); }
.logo-b { color: var(--accent); }
.onglets { display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none; height: 100%; }
.onglets::-webkit-scrollbar { display: none; }
.onglet { display: flex; align-items: center; gap: .3rem; padding: 0 .7rem; font-size: .92rem; color: var(--texte2);
  white-space: nowrap; border-bottom: 2px solid transparent; }
.onglet:hover { color: var(--texte); text-decoration: none; background: var(--fond2); }
.onglet.actif { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.bientot { font-size: .68rem; font-weight: 500; background: var(--fond3); color: var(--texte2);
  padding: .05rem .35rem; border-radius: 99px; }
.langues { display: flex; border: 1px solid var(--bord); border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.langues button { font: inherit; font-size: .8rem; font-weight: 600; padding: .25rem .55rem; border: 0;
  background: var(--fond); color: var(--texte2); cursor: pointer; }
.langues button + button { border-left: 1px solid var(--bord); }
.langues button.actif { background: var(--accent); color: #fff; }
.vers-lectura { font-size: .82rem; color: var(--texte2); white-space: nowrap; }

/* ── Contenu ──────────────────────────────────────────── */
.app { max-width: var(--largeur); margin: 0 auto; padding: 1.75rem 1rem 2.5rem; }
.chapeau { color: var(--texte2); margin: 0 0 1.25rem; max-width: 46rem; }
.saisie { background: var(--fond2); border: 1px solid var(--bord2); border-radius: 10px; padding: .85rem; }
.saisie textarea, .saisie input.ipa { width: 100%; font: inherit; font-size: 1.05rem; padding: .6rem .7rem;
  border: 1px solid var(--bord); border-radius: 6px; background: var(--fond); resize: vertical; color: var(--texte); }
.saisie input.ipa { font-family: var(--phon); font-size: 1.2rem; }
.saisie textarea:focus, .saisie input:focus { outline: 2px solid var(--puce); border-color: var(--accent); }
.saisie-pied { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .6rem;
  flex-wrap: wrap; }
.exemples { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .82rem; color: var(--texte2); }
.exemples button { font: inherit; font-size: .8rem; border: 1px solid var(--bord); background: var(--fond);
  border-radius: 99px; padding: .15rem .6rem; cursor: pointer; color: var(--texte2); max-width: 16rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exemples button:hover { border-color: var(--accent); color: var(--accent); }
.bouton { font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: .5rem 1.1rem; cursor: pointer; }
.bouton:hover { background: var(--accent2); }
.bouton:disabled { opacity: .55; cursor: progress; }
.bouton-discret { font: inherit; font-size: .8rem; background: none; border: 1px solid var(--bord); border-radius: 5px;
  padding: .15rem .5rem; cursor: pointer; color: var(--texte2); }
.bouton-discret:hover { border-color: var(--accent); color: var(--accent); }

.options { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .6rem; font-size: .88rem; color: var(--texte2); }
.options label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
.clavier { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .5rem; }
.clavier button { font-family: var(--phon); font-size: 1.05rem; min-width: 2.1rem; padding: .15rem .35rem;
  border: 1px solid var(--bord); background: var(--fond); border-radius: 5px; cursor: pointer; color: var(--ipa); }
.clavier button:hover { border-color: var(--ipa); background: #f4f0fa; }
.clavier .sep { width: .5rem; }

.resultat { margin-top: 1.5rem; }
.resultat:empty { display: none; }
.chargement { color: var(--texte2); font-style: italic; }
.erreur { color: var(--erreur); background: var(--erreur-fond); border-radius: 6px; padding: .6rem .8rem; }
.encart { background: var(--puce); border-radius: 10px; padding: 1rem 1.2rem; }
.encart p { margin: 0; }
.note-api { margin-top: 2.5rem; font-size: .82rem; color: var(--texte3); border-top: 1px solid var(--bord2);
  padding-top: .9rem; }

.phrase { border: 1px solid var(--bord2); border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem; }
.phrase-ortho { font-size: 1.05rem; margin-bottom: .5rem; }
.ipa { font-family: var(--phon); color: var(--ipa); }
.ligne-phone { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; font-size: 1.25rem; margin: .2rem 0 .6rem; }
.ligne-phone .bouton-discret { font-family: var(--sans); }

/* Alignement lettre ↔ son */
.alignement { display: flex; flex-wrap: wrap; gap: .5rem .35rem; align-items: flex-start; }
.mot-al { display: inline-flex; flex-direction: column; border: 1px solid var(--bord2); border-radius: 6px;
  padding: .2rem .25rem; background: var(--fond); }
.mot-al.ponct { border-color: transparent; background: none; }
.mot-al .cols { display: flex; gap: 1px; }
.mot-al .col { display: flex; flex-direction: column; align-items: center; min-width: 1.15rem; padding: 0 .1rem;
  border-radius: 3px; }
.mot-al .col .g { font-size: 1.05rem; }
.mot-al .col .p { font-family: var(--phon); color: var(--ipa); font-size: 1rem; min-height: 1.4em; }
.mot-al .col.muet .g { color: var(--muette); }
.mot-al .col.muet .p { color: var(--muette); }
.mot-al .col.lia .g, .mot-al .col.lia .p { color: var(--liaison); }
.mot-al .col.syl { width: 1px; min-width: 1px; padding: 0; background: var(--bord); margin: 0 .1rem; }
.mot-al .jonction { font-size: .7rem; color: var(--liaison); text-align: center; }
.mot-al .lecture { font-size: .75rem; color: var(--texte2); text-align: center; font-style: italic; }
.legende { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--texte2); margin-top: .6rem; }
.legende .muet { color: var(--muette); }
.legende .lia { color: var(--liaison); }

/* Analyse grammaticale */
.arbre { overflow-x: auto; margin-bottom: .5rem; }
.arbre svg { display: block; }
.arbre .arc { fill: none; stroke: #9aa9c0; stroke-width: 1.2; }
.arbre .etiq { font-size: 10.5px; fill: var(--texte2); font-family: var(--sans); }
.arbre .mot { font-size: 14px; fill: var(--texte); font-family: var(--sans); }
.arbre .cat { font-size: 10px; font-family: var(--sans); font-weight: 600; }
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th { text-align: left; font-weight: 600; color: var(--texte2); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .03em; border-bottom: 1px solid var(--bord); padding: .35rem .5rem; }
.tableau td { border-bottom: 1px solid var(--bord2); padding: .35rem .5rem; vertical-align: top; }
.tableau tr:hover td { background: var(--fond2); }
.tableau .forme { font-weight: 600; }
.tableau .type-formule { font-size: .72rem; font-weight: 600; color: var(--son-formule); margin-left: .35rem; }
.tableau .phon { font-family: var(--phon); color: var(--ipa); white-space: nowrap; }
.tableau .forme[title] { text-decoration: underline dotted var(--texte3); cursor: help; }
.ecrit { margin: 0 0 .5rem; font-size: 1.1rem; }
.ecrit-et { font-size: .78rem; font-weight: 600; text-transform: uppercase; color: var(--texte2); }
.entree { display: flex; gap: 1rem; margin-bottom: .5rem; font-size: .88rem; color: var(--texte2); }
.entree label { display: flex; align-items: center; gap: .3rem; cursor: pointer; }
.puce-cat { display: inline-block; font-size: .78rem; font-weight: 600; padding: .05rem .45rem; border-radius: 4px;
  white-space: nowrap; }
.traits { color: var(--texte2); font-size: .85rem; }
.confiance { color: var(--texte3); font-size: .8rem; font-variant-numeric: tabular-nums; }
.defile { overflow-x: auto; }

/* ── Lecture syllabique ───────────────────────────────── */
.reglages { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .75rem; margin-top: 1rem; }
.reglages fieldset { border: 1px solid var(--bord2); border-radius: 10px; padding: .5rem .85rem .7rem; margin: 0;
  display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; }
.reglages legend { font-weight: 600; font-size: .8rem; color: var(--texte2); text-transform: uppercase;
  letter-spacing: .04em; padding: 0 .3rem; }
.reglages label { display: flex; align-items: center; gap: .45rem; cursor: pointer; }
.reglages input[type=range] { flex: 1; min-width: 5rem; }
.reglages select { font: inherit; font-size: .85rem; }

.feuille { --taille: 26px; --interligne: 2; --lettres: .02em;
  font-family: var(--phon); font-size: var(--taille); line-height: var(--interligne); letter-spacing: var(--lettres);
  background: var(--fond); border: 1px solid var(--bord); border-radius: 10px; padding: 1.5rem 1.75rem;
  color: var(--texte); word-spacing: .25em; }
.feuille.police-sans { font-family: var(--sans); }
.feuille.police-serif { font-family: var(--serif); }
.feuille p { margin: 0 0 .6em; }
.feuille .m { white-space: nowrap; display: inline-block; }
.feuille .g { white-space: nowrap; display: inline-block; }
.feuille .s { position: relative; }
.feuille.couleurs .s.c0 { color: var(--c0); }
.feuille.couleurs .s.c1 { color: var(--c1); }
.feuille.couleurs .s.c2 { color: var(--c2); }
.feuille.muettes .mu { color: var(--muette) !important; }
.feuille.arcs .s::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -.12em; height: .28em;
  border: .07em solid currentColor; border-top: 0; border-radius: 0 0 50% 50% / 0 0 100% 100%; opacity: .55; }
.feuille.points .s + .s::before { content: "·"; color: var(--texte3); margin: 0 .02em; }
.feuille.points .s:has(> .li:first-child)::before { content: none; }  /* pas de point avant la lettre de liaison */
.feuille .j { display: inline-block; min-width: .3em; }
.feuille.liaisons .j.lia, .feuille.liaisons .j.enc { position: relative; }
.feuille.liaisons .j.lia::after, .feuille.liaisons .j.enc::after { content: ""; position: absolute; left: -.35em;
  right: -.35em; bottom: .05em; height: .35em; border: .08em solid var(--liaison); border-top: 0;
  border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.feuille.liaisons .j.enc::after { border-style: dashed; }
.feuille.liaisons .li { color: var(--liaison) !important; font-weight: 700; }
.feuille .f { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; vertical-align: top; }
.feuille .f .lu { font-size: .45em; color: var(--texte2); font-style: italic; letter-spacing: 0; }
.feuille:not(.formules) .f .lu { display: none; }
.feuille.palette-rouge-bleu { --c0: var(--syl1); --c1: var(--syl2); --c2: var(--syl2); }
.feuille.palette-bleu-vert { --c0: var(--syl2); --c1: var(--syl3); --c2: var(--syl3); }
.feuille.palette-trois { --c0: var(--syl1); --c1: var(--syl2); --c2: var(--syl3); }
.feuille.palette-sombre { --c0: #111; --c1: #777; --c2: #777; }
/* Couleurs par son (règles de Lectura-edition) */
.feuille.palette-sons { --c0: var(--texte); --c1: var(--texte); --c2: var(--texte); }
.feuille.couleurs.palette-sons .k-c, .chapeau .k-c { color: var(--son-consonne); }
.feuille.couleurs.palette-sons .k-v, .chapeau .k-v { color: var(--son-voyelle); }
.feuille.couleurs.palette-sons .k-x, .chapeau .k-x { color: var(--son-compose); }
.feuille.couleurs.palette-sons .f > span:first-child, .chapeau .k-f { color: var(--son-formule); }
.chapeau .mu { color: var(--muette); }
.chapeau .k-c, .chapeau .k-v, .chapeau .k-x, .chapeau .k-f { font-weight: 600; }
.feuille .accent { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .12em; }
.actions-impression { display: flex; align-items: center; gap: 1rem; margin-top: .9rem; flex-wrap: wrap; }
.aide { font-size: .82rem; color: var(--texte2); }

/* ── Pied ─────────────────────────────────────────────── */
.pied { border-top: 1px solid var(--bord); background: var(--fond2); font-size: .85rem; color: var(--texte2); }
.pied-int { max-width: var(--largeur); margin: 0 auto; padding: .9rem 1rem; display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; }
.pied-liens { display: flex; gap: 1rem; }

/* ── Petits écrans ────────────────────────────────────── */
@media (max-width: 760px) {
  .entete-int { flex-wrap: wrap; height: auto; padding-top: .45rem; gap: .35rem .75rem; }
  .vers-lectura { display: none; }
  .onglets { order: 3; flex-basis: 100%; height: 2.4rem; }
  .langues { margin-left: auto; }
  h1 { font-size: 1.35rem; }
  .feuille { padding: 1rem; }
  .tableau .col-traits, .tableau .col-conf { display: none; }
}

/* ── Accueil ──────────────────────────────────────────── */
.accueil { max-width: var(--largeur); margin: 0 auto; padding: 0 1rem 3rem; }
.vitrine { text-align: center; padding: 2.5rem 0 2.25rem; border-bottom: 1px solid var(--bord2); }
.vitrine-logo { margin: 0 auto; max-width: 44rem; }
.vitrine-logo img { display: block; width: 100%; height: auto; }
.vitrine-titre { font-size: 1.35rem; font-weight: 600; margin: 1.25rem 0 .5rem; }
.vitrine-texte { color: var(--texte2); max-width: 40rem; margin: 0 auto 1.5rem; }
.vitrine-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.bouton--grand { display: inline-block; padding: .7rem 1.4rem; font-size: 1.02rem; }
.bouton--grand:hover { text-decoration: none; color: #fff; }
.bouton--clair { background: var(--fond); color: var(--accent); border: 1px solid var(--bord); }
.bouton--clair:hover { background: var(--fond2); color: var(--accent2); }
.bloc-accueil { padding: 2.25rem 0 0; }
.bloc-accueil h2 { font-size: 1.3rem; margin: 0 0 1rem; }
.outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.outil { display: flex; flex-direction: column; gap: .6rem; padding: 1.1rem 1.15rem; border: 1px solid var(--bord2);
  border-radius: 10px; color: var(--texte); background: var(--fond); transition: border-color .15s, box-shadow .15s; }
.outil:hover { text-decoration: none; color: var(--texte); border-color: var(--accent); box-shadow: 0 2px 10px rgba(42,94,168,.1); }
.outil-nom { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.outil-nom small { font-weight: 400; color: var(--texte2); font-size: .85rem; margin-left: .2rem; }
.outil-demo { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; background: var(--fond2);
  border-radius: 8px; padding: .6rem .75rem; font-size: .98rem; min-height: 3.2rem; }
.outil-texte { color: var(--texte2); font-size: .9rem; }
.outil--bientot { background: var(--fond2); }
.outil--bientot .outil-nom { color: var(--texte2); }
.ipa { font-family: var(--phon); color: var(--ipa); }
.fleche { color: var(--texte3); }
.puce-mot { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.puce-mot i { font-style: normal; font-size: .68rem; font-weight: 600; padding: 0 .35rem; border-radius: 99px; margin-top: .15rem; }
.cat-det { background: #efe9f8; color: #5b3f8c; }
.cat-nom { background: #e3eefb; color: #1d4f91; }
.cat-verbe { background: #fde7e4; color: #a8322a; }
.demo-syllabes { font-family: var(--phon); font-size: 1.35rem; gap: 0; letter-spacing: .02em; }
.demo-syllabes .k-c { color: var(--son-consonne); }
.demo-syllabes .k-v { color: var(--son-voyelle); }
.demo-syllabes .k-x { color: var(--son-compose); }
.demo-syllabes .mu { color: var(--muette); margin-right: .35em; }
.demo-syllabes > span:nth-child(2) { margin-right: .35em; }  /* fin de « Le » */
.demo-syllabes .pt { color: var(--texte3); }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.exemple-langue { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; background: var(--fond2);
  border-radius: 8px; padding: .6rem .8rem; }
.publics { padding-left: 1.1rem; margin: 0; }
.publics li { margin-bottom: .5rem; }
.sous-le-capot p { max-width: 50rem; }
@media (max-width: 760px) {
  .vitrine { padding-top: 1.5rem; }
  .vitrine-titre { font-size: 1.15rem; }
  .deux-colonnes { grid-template-columns: 1fr; gap: 0; }
}

/* ── Impression : seule la feuille syllabique ─────────── */
@media print {
  @page { margin: 1.5cm; }
  body { display: block; }
  .entete, .pied, .note-api, .panneau > h1, .chapeau, .saisie, .reglages, .actions-impression { display: none !important; }
  .app { padding: 0; max-width: none; }
  .feuille { border: 0; padding: 0; }
  .feuille .m, .feuille p { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
