/* ===== Identité KYskan : logo (triangle) + « KYskan » — commun à toutes les pages ===== */
.wm { display: inline-flex; align-items: center; gap: .32em; font-weight: 800; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.wm__mark { width: 1.35em; height: auto; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(29, 78, 216, .25)); }
.wm__ky { background: linear-gradient(100deg, #1d6bff 0%, #6d3dff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm__skan { color: currentColor; }
/* Mention du domaine sous les QR Codes imprimables */
.wm-domain { font-weight: 800; letter-spacing: -.02em; }
.wm-domain .dot { color: #6d3dff; }

/* Badge ✔ « compte vérifié » */
.vbadge { display: inline-flex; vertical-align: -.12em; margin-inline-start: .28em; line-height: 0; }
.vbadge svg { width: .95em; height: .95em; min-width: 16px; min-height: 16px; }

/* ===== Barre de navigation d'appli (mobile) : Accueil · Découvrir · SkanAll · Événements · Profil ===== */
.bnav { display: none; }
@media (max-width: 760px) {
    body.has-bnav { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
    .bnav {
        position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; height: 64px; padding: 0 6px 8px;
        border-radius: 22px; background: rgba(255, 255, 255, .86); border: 1px solid rgba(255, 255, 255, .9);
        box-shadow: 0 12px 34px rgba(20, 30, 80, .2); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
        font-family: 'Plus Jakarta Sans', Inter, system-ui, var(--cjk), sans-serif;
    }
    .bnav__item, .bnav__scan {
        display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; color: #5b6479; text-decoration: none;
        font-size: 10.5px; font-weight: 600; line-height: 1.1;
    }
    .bnav__item span, .bnav__scan > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .bnav__item.is-active { color: #1d4ed8; }
    .bnav__item.is-active svg { stroke-width: 2.4; }
    .bnav__avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff; }
    .bnav__item.is-active .bnav__avatar { box-shadow: 0 0 0 2px #1d4ed8; }
    .bnav__scan { color: #1d4ed8; }
    .bnav__scan-btn {
        display: grid; place-items: center; width: 58px; height: 58px; margin-top: -30px; border-radius: 50%; color: #fff;
        background: linear-gradient(135deg, #1d6bff, #6d3dff); box-shadow: 0 10px 24px rgba(29, 78, 216, .45), 0 0 0 5px rgba(255, 255, 255, .9);
    }
    .bnav a:focus-visible { outline: 3px solid #6d3dff; outline-offset: 2px; border-radius: 12px; }
}
/* Sombre (html[data-theme="dark"], posé par partials/head_brand.php) */
@media (max-width: 760px) {
    :root[data-theme="dark"] .bnav { background: rgba(14, 22, 58, .86); border-color: rgba(255, 255, 255, .12); box-shadow: 0 12px 34px rgba(0, 0, 0, .45); }
    :root[data-theme="dark"] .bnav__item { color: #b7c0e0; }
    :root[data-theme="dark"] .bnav__item.is-active, :root[data-theme="dark"] .bnav__scan { color: #8fb4ff; }
    :root[data-theme="dark"] .bnav__scan-btn { box-shadow: 0 10px 24px rgba(0, 0, 0, .45), 0 0 0 5px rgba(14, 22, 58, .9); }
    :root[data-theme="dark"] .bnav__avatar { box-shadow: 0 0 0 2px #1a2350; }
}

/* ===== Bouton clair / sombre (partials/theme_toggle.php) ===== */
.theme-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; flex-shrink: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid rgba(11, 20, 51, .12); background: rgba(255, 255, 255, .6); color: inherit;
}
.theme-btn:hover { background: rgba(127, 127, 127, .14); }
.theme-btn:focus-visible { outline: 3px solid #6d3dff; outline-offset: 2px; }
.theme-btn__moon { display: none; }
:root[data-theme="dark"] .theme-btn { border-color: rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); }
:root[data-theme="dark"] .theme-btn__sun { display: none; }
:root[data-theme="dark"] .theme-btn__moon { display: block; }

/* ===== Galerie de thèmes en mini-cartes (profil, assistant de bienvenue) ===== */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px; }
.theme-choice { margin: 0; cursor: pointer; text-align: center; font-weight: 500; font-size: 14px; }
.theme-choice input { position: absolute; opacity: 0; }
/* Mini-cartes d'aperçu : photo + 3 liens */
.swatch {
    position: relative; display: flex; flex-direction: column; gap: 7px; justify-content: flex-end; padding: 44px 12px 16px; aspect-ratio: 3 / 4.2; height: auto;
    border-radius: 18px; margin-bottom: 8px; border: 3px solid transparent; box-shadow: 0 8px 20px rgba(20, 30, 80, .12); transition: transform .15s;
}
.swatch::before { content: ''; position: absolute; top: 14px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.swatch i { display: block; height: 13px; border-radius: 99px; }
.theme-choice:hover .swatch { transform: translateY(-2px); }
.theme-choice input:checked + .swatch { border-color: var(--primary, #1d4ed8); }
.theme-choice input:focus-visible + .swatch { outline: 2px solid var(--primary, #1d4ed8); outline-offset: 2px; }
.swatch--eastwest { background: url('../img/brand/bg-mobile.webp') center 40% / cover; } .swatch--eastwest i { background: rgba(255,255,255,.85); }
.swatch--sunset   { background: linear-gradient(160deg, #ff9a8b, #ff6a88); } .swatch--sunset i { background: rgba(255,255,255,.9); }
.swatch--ocean    { background: linear-gradient(160deg, #0f2027, #2c5364); } .swatch--ocean i { border: 1px solid rgba(255,255,255,.4); }
.swatch--forest   { background: #c0d9b3; } .swatch--forest i { background: #1f3320; }
.swatch--midnight { background: #0d0d1a; } .swatch--midnight i { background: #1c1c3a; border: 1px solid #3c3c78; }
.swatch--paper    { background: #f6f3ee; } .swatch--paper i { background: #fff; border: 2px solid #1d1d1b; }
.swatch--neon     { background: #0a0a0a; } .swatch--neon i { border: 2px solid #39ff88; box-shadow: 0 0 6px #39ff88; }


/* ===== Langues écrites de droite à gauche (persan, dari, ourdou, ouïghour) : <html dir="rtl"> ===== */
/* Le logo, les adresses et les codes restent de gauche à droite */
.wm, .wm-domain, code, .share__url, .ob-link, .ob-preview__url { direction: ltr; unicode-bidi: isolate; }
/* Flèches et chevrons dessinés en SVG : retournés */
[dir="rtl"] svg:has(> path[d^="M9 6l6 6"]), [dir="rtl"] svg:has(> path[d^="M15 6l-6 6"]), [dir="rtl"] svg:has(> path[d^="M5 12h14"]),
[dir="rtl"] svg:has(> path[d^="M15 18l-6-6"]), [dir="rtl"] svg:has(> path[d^="M19 12H5"]), [dir="rtl"] svg:has(> path[d^="M9 18l6-6"]), [dir="rtl"] .flip-rtl { transform: scaleX(-1); }
[dir="rtl"] .premium-note { border-radius: 8px 0 0 8px; }
[dir="rtl"] .link { padding: 12px 12px 12px 16px; }

/* ===== Écritures non latines ===== */
/* L'espacement serré des titres (lettres latines) casse l'arabe et gêne le thaï, le birman, le devanagari… */
html:is([lang="fa"], [lang="fa-AF"], [lang="ur"], [lang="ug"], [lang="hi"], [lang="th"], [lang="lo"], [lang="km"], [lang="my"]) body * { letter-spacing: 0 !important; }
/* Écritures hautes (signes au-dessus et au-dessous des lettres) : interlignage des titres plus généreux */
html:is([lang="fa"], [lang="fa-AF"], [lang="ur"], [lang="ug"], [lang="hi"], [lang="th"], [lang="lo"], [lang="km"], [lang="my"]) :is(h1, h2, h3, [class*="title"], [class*="name"], [class*="__h"]) { line-height: 1.4 !important; }
html[lang="my"] body, html[lang="km"] body { line-height: 1.75; }
/* Polices système adaptées quand la police du site n'a pas l'écriture */
/* (écriture naskh, compacte, plutôt que le nastaliq très haut qui déborderait des boutons) */
html:is([lang="fa"], [lang="fa-AF"], [lang="ur"], [lang="ug"]) body { font-family: 'Plus Jakarta Sans', 'Vazirmatn', 'Segoe UI', Tahoma, 'Geeza Pro', 'Noto Naskh Arabic', 'Noto Sans Arabic', system-ui, sans-serif; }
/* Contenu saisi par les utilisateurs (nom, métier, bio, titres de liens…) : chaque paragraphe prend le sens de sa propre écriture */
:is(.name, .headline, .location, .bio, .link__title, .block__title, .product__title, .product__desc, .upcoming__title, .qr-dialog__name,
    .dc__name, .dc__handle, .cvb__name, .cvb__headline, .cvb__location, .cvb-timeline__title, .cvb-timeline__desc, .cvb-langs__name,
    .sk-profile__name, .sk-profile__headline, .sk-profile__location, .sk-link__title, .ob-mini__name, .ob-mini__headline, .ob-mini__location,
    .ev-card__title, .e-detail__title, .e-desc, .lp-ucard__body strong) { unicode-bidi: plaintext; }
/* Adresses, e-mails, identifiants : toujours saisis de gauche à droite (alignés à droite en RTL) */
input:is([type="url"], [type="email"], [type="tel"], [name="url"], [name="email"], [name="username"], [name="login"], [inputmode="url"]) { direction: ltr; }
[dir="rtl"] input:is([type="url"], [type="email"], [type="tel"], [name="url"], [name="email"], [name="username"], [name="login"], [inputmode="url"]) { text-align: right; }

/* Polices chinoises : formes simplifiées (SC) par défaut, traditionnelles de Taïwan / Hong Kong (TC) en 繁體中文 */
:root { --cjk: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC'; }
:root[lang="zh-Hant"] { --cjk: 'PingFang TC', 'PingFang HK', 'Microsoft JhengHei', 'Noto Sans CJK TC', 'Noto Sans TC'; }
