/* Site public en plusieurs langues (chantier i18n-monde, 16/11/2026).
   Chargé par core/_nx_base.html APRÈS site-v3.css, et seulement quand le moteur
   i18n_site a une langue ouverte ou que la page est servie sous /<langue>/ :
   tant qu'il dort, ce fichier n'est pas demandé.
   1. Sélecteur de langue (en-tête : <details> sans JS ; pied : liens à plat)
   2. Bandeau de positionnement
   3. Piles de polices par écriture (aucune police à télécharger)
   4. Mots longs (allemand, russe, turc…) : rien ne déborde
   5. Arabe : dir="rtl" posé par le moteur sur <html>, propriétés logiques */

/* ---- 1. Sélecteur ------------------------------------------------------- */
.nx-langue { position: relative; }
.nx-langue__liste { list-style: none; margin: 0; padding: 0; }

.nx-langue--entete { flex-shrink: 0; }
.nx-langue__bouton {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--nx-muted);
    font-weight: 550;
    font-size: 0.95rem;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--nx-dur-fast) ease, background-color var(--nx-dur-fast) ease;
}
.nx-langue__bouton::-webkit-details-marker { display: none; }
.nx-langue__bouton::marker { content: ""; }
.nx-langue__bouton:hover,
.nx-langue--entete[open] .nx-langue__bouton { color: var(--nx-ink); background: rgba(255, 255, 255, 0.05); }
.nx-langue__bouton:focus-visible { outline-offset: 0; }
.nx-langue__globe {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nx-langue--entete .nx-langue__liste {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    z-index: 1001;
    width: min(300px, calc(100vw - 32px));
    max-height: calc(100vh - var(--nx-header-h) - 24px);
    max-height: calc(100dvh - var(--nx-header-h) - 24px - env(safe-area-inset-top, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
    padding: 8px;
    background: #111a35;
    border: 1px solid rgba(150, 165, 205, 0.16);
    border-radius: var(--nx-r-card);
    box-shadow: 0 28px 60px -20px rgba(2, 6, 16, 0.9);
}

.nx-langue__lien {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--nx-r-md);
    color: var(--nx-ink);
    font-size: 0.95rem;
    line-height: 1.25;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background-color var(--nx-dur-fast) ease, color var(--nx-dur-fast) ease;
}
.nx-langue__lien:hover { background: rgba(214, 180, 106, 0.08); color: var(--nx-gold-soft); }
.nx-langue__lien:focus-visible { outline-offset: -2px; }
.nx-langue__lien[aria-current] { color: var(--nx-gold-2); background: rgba(214, 180, 106, 0.1); font-weight: 600; }
.nx-langue__lien[aria-current]::after {
    content: "";
    width: 6px;
    height: 10px;
    margin-inline-start: auto;
    border-inline-end: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(40deg);
    flex: none;
}

/* Burger (≤ 1023 px) : le panneau s'ancre sur l'en-tête, pas sur le bouton globe,
   sinon il sort de l'écran à 320 px. */
@media (max-width: 1023px) {
    .nx-langue--entete { position: static; }
    .nx-langue--entete .nx-langue__liste {
        inset-inline-end: max(16px, env(safe-area-inset-right, 0px));
        width: min(300px, calc(100vw - 32px));
    }
}

/* Le nom complet n'a la place qu'entre 720 et 1023 px (barre à burger). Ailleurs :
   globe + code court (DE, AR...), le nom reste lu par les lecteurs d'écran. */
.nx-langue__code { font-size: 0.8125rem; font-weight: 650; letter-spacing: 0.06em; }
@media (min-width: 720px) and (max-width: 1023px) {
    .nx-langue--entete .nx-langue__code { display: none; }
}
@media (max-width: 719px), (min-width: 1024px) {
    .nx-langue--entete .nx-langue__nom {
        position: absolute;
        width: 1px; height: 1px;
        margin: -1px; padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
        border: 0;
    }
}
/* Sous 480 px le bloc d'actions disparaît : le sélecteur prend la place à droite, avant le burger. */
@media (max-width: 479px) {
    .nx-header .nx-langue--entete { margin-inline-start: auto; }
    .nx-header .nx-langue--entete ~ .nx-burger { margin-inline-start: 0; margin-left: 0; }
}

/* Pied de page : toutes les langues, à plat. */
.nx-langue--pied {
    width: min(100% - 40px, 1280px);
    margin: clamp(28px, 4vw, 40px) auto 0;
}
.nx-langue--pied .nx-footer__title { margin-bottom: 10px; }
.nx-langue--pied .nx-langue__liste { display: flex; flex-wrap: wrap; gap: 8px; }
.nx-langue--pied .nx-langue__lien {
    padding: 8px 16px;
    border: 1px solid var(--nx-line-cool);
    border-radius: 999px;
    color: var(--nx-muted);
}
.nx-langue--pied .nx-langue__lien:hover { color: var(--nx-gold-2); border-color: var(--nx-line-strong); background: rgba(214, 180, 106, 0.06); }
.nx-langue--pied .nx-langue__lien[aria-current] { border-color: var(--nx-line-strong); }
.nx-langue--pied + .nx-footer__bottom { margin-top: clamp(20px, 3vw, 28px); }
@media (max-width: 540px) {
    .nx-langue--pied { width: min(100% - 32px, 1280px); }
}

/* ---- 2. Bandeau de positionnement -------------------------------------- */
.bandeau-i18n {
    background: rgba(214, 180, 106, 0.08);
    border-bottom: 1px solid var(--nx-line);
    color: var(--nx-gold-soft);
    font-size: 0.88rem;
    line-height: 1.5;
}
.bandeau-i18n p {
    width: min(100% - 32px, 1280px);
    margin: 0 auto;
    padding: 10px 0;
    text-align: center;
    overflow-wrap: anywhere;
}

/* ---- 3. Piles de polices par écriture ----------------------------------- */
/* Inter et Fraunces sont servies en latin / latin-ext seulement : arabe, CJK et
   cyrillique tombent sur la police du système, qui a les glyphes. On nomme les
   polices système de chaque plateforme plutôt que de laisser le navigateur
   choisir au hasard une serif latine pour les titres. */
html[lang="ar"] {
    --nx-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', 'Geeza Pro', Tahoma, sans-serif;
    --nx-font-head: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Noto Sans Arabic', 'Geeza Pro', Tahoma, sans-serif;
}
html[lang="zh"] {
    --nx-font-body: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', sans-serif;
    --nx-font-head: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', sans-serif;
}
html[lang="ja"] {
    --nx-font-body: 'Inter', system-ui, -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, 'Noto Sans CJK JP', 'Noto Sans JP', sans-serif;
    --nx-font-head: 'Inter', system-ui, -apple-system, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, 'Noto Sans CJK JP', 'Noto Sans JP', sans-serif;
}
html[lang="ko"] {
    --nx-font-body: 'Inter', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', 'Noto Sans KR', sans-serif;
    --nx-font-head: 'Inter', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', 'Noto Sans KR', sans-serif;
}
/* Cyrillique : Fraunces n'a pas la plage, Georgia l'a ; Inter latin-ext ne la couvre pas non plus. */
html[lang="ru"] {
    --nx-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --nx-font-head: 'Fraunces', Georgia, 'Times New Roman', serif;
}
/* Caractères sans approximation de graisse : les CJK et l'arabe n'ont pas de gras synthétique propre. */
html[lang="zh"], html[lang="ja"], html[lang="ko"], html[lang="ar"] { font-synthesis: none; }

/* ---- 4. Mots longs ------------------------------------------------------ */
html[lang="de"], html[lang="ru"], html[lang="nl"], html[lang="tr"], html[lang="fi"] {
    hyphens: auto;
    -webkit-hyphens: auto;
}
html:not([lang="fr"]) h1, html:not([lang="fr"]) h2, html:not([lang="fr"]) h3,
html:not([lang="fr"]) h4, html:not([lang="fr"]) p, html:not([lang="fr"]) li,
html:not([lang="fr"]) a, html:not([lang="fr"]) button, html:not([lang="fr"]) summary,
html:not([lang="fr"]) label, html:not([lang="fr"]) dt, html:not([lang="fr"]) dd,
html:not([lang="fr"]) td, html:not([lang="fr"]) th, html:not([lang="fr"]) small, html:not([lang="fr"]) strong {
    overflow-wrap: break-word;
}
/* Les `white-space: nowrap` de la maquette protègent des libellés français courts
   (« Créer mon compte », « En ligne »). Un libellé allemand ou russe est plus long :
   dans une langue étrangère, les libellés passent à la ligne au lieu de pousser la
   page. Les prix et les chiffres gardent leur nowrap (ils ne portent pas de mots). */
html:not([lang="fr"]) .v3-btn,
html:not([lang="fr"]) .v3-heros .v3-actions .v3-btn,
html:not([lang="fr"]) .v3-enligne,
html:not([lang="fr"]) .v3-heros__tel a,
html:not([lang="fr"]) body.v3 .v3t-statut {
    white-space: normal;
    text-align: center;
}
html:not([lang="fr"]) body.v3 .v3t-statut { text-align: start; display: inline; margin-inline-start: 4px; }
html:not([lang="fr"]) .v3-heros .v3-actions { flex-wrap: wrap; }
html:not([lang="fr"]) .v3-barre .v3-btn { flex: 0 1 auto; }
html:not([lang="fr"]) .v3-barre p { min-width: 0; }

/* En-tête sur ordinateur : le sélecteur prend ~70 px dans une barre déjà pleine
   (plafonnée à 1180 px même sur grand écran) et les libellés étrangers sont plus
   longs que « Tarifs » ou « Se connecter ». Dès qu'il est là, le lien « démo »
   quitte la barre (le héros et le tiroir mobile le portent), le menu se serre et
   rien ne passe à la ligne. */
@media (min-width: 1024px) {
    html:has(.nx-langue--entete) .nx-header__inner { gap: 10px; }
    html:has(.nx-langue--entete) .nx-header__actions .nx-header__login { display: none; }
    html:has(.nx-langue--entete) .nx-nav { margin-inline-start: 4px; }
    html:has(.nx-langue--entete) .nx-nav__trigger { padding-inline: 10px; white-space: nowrap; }
    html:has(.nx-langue--entete) .nx-header__login,
    html:has(.nx-langue--entete) .nx-header__actions .nx-btn { white-space: nowrap; }
}
/* Entre 1024 et 1279 px la barre est trop étroite pour le menu, la connexion ET le
   bouton dans une langue plus longue que le français : la connexion reste dans le
   pied de page et le tiroir, le menu passe en corps plus petit. */
@media (min-width: 1024px) and (max-width: 1279px) {
    html:has(.nx-langue--entete) .nx-header__actions .nx-header__login { display: none; }
    html:has(.nx-langue--entete) .nx-nav__trigger { padding-inline: 8px; font-size: 0.875rem; }
}
@media (min-width: 1024px) and (max-width: 1139px) {
    html:has(.nx-langue--entete) .nx-header__inner { gap: 6px; }
    html:has(.nx-langue--entete) .nx-nav__trigger { padding-inline: 5px; font-size: 0.8125rem; gap: 4px; }
    html:has(.nx-langue--entete) .nx-header__actions .nx-btn { padding-inline: 12px; font-size: 0.8125rem; }
}

html[lang="zh"] body, html[lang="ja"] body { line-break: strict; }
html[lang="ko"] body { word-break: keep-all; }

/* ---- 5. Arabe ----------------------------------------------------------- */
/* Un espacement entre lettres coupe la liaison des lettres arabes : jamais. */
html[lang="ar"] *, html[lang="ar"] *::before, html[lang="ar"] *::after { letter-spacing: normal !important; }

/* Propriétés physiques du site (gauche/droite) retournées pour le sens de lecture :
   barre d'en-tête, alignements de texte, tableaux, filets d'alerte. */
html[dir="rtl"] .nx-header__actions { margin-left: 0; margin-inline-start: auto; }
html[dir="rtl"] .nx-burger { margin-left: 0; margin-inline-start: auto; }
html[dir="rtl"] .nx-header__actions ~ .nx-burger { margin-left: 0; margin-inline-start: 0; }
@media (max-width: 479px) {
    html[dir="rtl"] .nx-header .nx-langue--entete ~ .nx-burger { margin-inline-start: 0; }
}
html[dir="rtl"] .nx-footer__bottom,
html[dir="rtl"] .nx-stat,
html[dir="rtl"] .nx-cta-band,
html[dir="rtl"] .nx-nav__panel a,
html[dir="rtl"] .nx-footer__nav a,
html[dir="rtl"] .nx-table caption, html[dir="rtl"] .nx-table th, html[dir="rtl"] .nx-table td,
html[dir="rtl"] .v3t-table caption, html[dir="rtl"] .v3t-table th,
html[dir="rtl"] .v3t-conditions th,
html[dir="rtl"] .v3g-table th, html[dir="rtl"] .v3g-table td, html[dir="rtl"] .v3g-table caption,
html[dir="rtl"] .v3m-table th, html[dir="rtl"] .v3m-table td, html[dir="rtl"] .v3m-table caption,
html[dir="rtl"] .v3l-prose th, html[dir="rtl"] .v3l-prose td, html[dir="rtl"] .v3l-prose caption,
html[dir="rtl"] .v3l-table th, html[dir="rtl"] .v3l-table td, html[dir="rtl"] .v3l-table caption,
html[dir="rtl"] .nxf-matrice caption, html[dir="rtl"] .nxf-matrice th, html[dir="rtl"] .nxf-matrice td,
html[dir="rtl"] .nxp-matrix caption,
html[dir="rtl"] .nxp-pill,
html[dir="rtl"] .nxv-proof, html[dir="rtl"] .nxv-proof ul,
html[dir="rtl"] .nxf-gauche,
html[dir="rtl"] .home-trust-note,
html[dir="rtl"] .nxp-receipt--rows dd { text-align: start; }
html[dir="rtl"] .v3-ticket dd,
html[dir="rtl"] .v3-app__droite,
html[dir="rtl"] .v3t-barres__val,
html[dir="rtl"] .nxm-ticket dd,
html[dir="rtl"] .nxp-receipt dd,
html[dir="rtl"] .nxm-cities a small { text-align: end; }
/* Les cellules qui réservaient leur marge à droite la réservent côté lecture. */
html[dir="rtl"] .v3t-table thead th, html[dir="rtl"] .v3t-table tbody th,
html[dir="rtl"] .v3g-table th, html[dir="rtl"] .v3g-table td,
html[dir="rtl"] .v3m-table th, html[dir="rtl"] .v3m-table td,
html[dir="rtl"] .v3l-prose th, html[dir="rtl"] .v3l-prose td,
html[dir="rtl"] .v3l-table th, html[dir="rtl"] .v3l-table td { padding-right: 0; padding-left: 16px; }
html[dir="rtl"] .v3t-conditions th { padding-right: 0; padding-left: 24px; }
html[dir="rtl"] .v3p-alerte { border-left: 0; border-right: 2px solid var(--v3-brume-2); }

/* Lien d'évitement : caché à top:-4rem dans base.html, ce qui suppose une seule ligne.
   Traduit, il passe sur 2 ou 3 lignes et son bas dépasse en haut de la page : on le
   cache d'après sa propre hauteur, et on le range du côté de lecture. */
html:not([lang="fr"]) .skip-link { left: auto; inset-inline-start: 1rem; max-width: calc(100% - 2rem); }
html:not([lang="fr"]) .skip-link:not(:focus) { top: 0; transform: translateY(-120%); }

/* ---- 6. Arabe, passe du 17/11 : ce que la lecture de droite à gauche cassait ----
   Tout est sous html[dir="rtl"] : le français et les langues de gauche à droite ne
   changent pas d'un pixel. Les nombres, prix et numéros sont isolés côté moteur
   (i18n_site/segments.py : <bdi dir="ltr">), pas ici. */

/* Les pièges anti-robot sont posés à -9999px à GAUCHE : en lecture inversée, le côté
   gauche est celui du défilement, la page s'allongeait de 10 000 px (blog, lettre). */
html[dir="rtl"] .nxm-miel { left: auto; right: -9999px; }
html[dir="rtl"] .nxa-miel { left: auto; right: -10000px; }

/* Flèche « → » des liens (SVG partagé par le site) : elle pointe vers la lecture. */
html[dir="rtl"] svg:has(> path[d="M5 12h14M13 6l6 6-6 6"]) { transform: scaleX(-1); }
html[dir="rtl"] .v3-piliers__liste a:hover svg { transform: scaleX(-1) translateX(4px); }

/* Coche de la langue courante : bordures logiques = coche renversée en arabe. */
html[dir="rtl"] .nx-langue__lien[aria-current]::after {
    border-inline-end: 0;
    border-left: 0;
    border-right: 2px solid currentColor;
}

/* Les chiffres clés : le filet sépare les colonnes du côté de lecture, et la valeur
   (« 24 ساعة على 24 », plus longue que « 24 h/24 ») passe à la ligne au lieu de
   déborder sur son texte. */
@media (min-width: 720px) {
    html[dir="rtl"] .v3-faits > div { border-left: 0; border-right: 1px solid var(--v3-ligne); }
    html[dir="rtl"] .v3-faits > div:first-child {
        border-right: 0;
        padding-right: 0;
        padding-left: clamp(16px, 2.6vw, 36px);
    }
}
@media (max-width: 719px) {
    html[dir="rtl"] .v3-faits dt { white-space: normal; font-size: 1.5rem; line-height: 1.15; }
}

/* Un numéro ou une adresse se tape de gauche à droite, mais s'aligne du côté de lecture. */
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }
html[dir="rtl"] input[type="tel"]::placeholder,
html[dir="rtl"] input[type="email"]::placeholder { text-align: right; }
