/* Commun aux pages d'évènement : choix de langue, partage, code QR.
   S'appuie sur les variables et composants de app.css (--ink, --line, .dialog, .btn…). */

/* ---------- Langue ---------- */
.lang-switch {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px;
    border: 1px solid var(--line-strong, rgba(127, 127, 127, .35)); background: transparent;
}
.lang-switch a {
    min-width: 34px; height: 30px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
    font: 700 .74rem/1 var(--font-ui, system-ui), sans-serif; letter-spacing: .06em; color: inherit; text-decoration: none; opacity: .72;
    transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.lang-switch a:hover { opacity: 1; }
.lang-switch a[aria-current="true"] { background: var(--gold, #d9b86a); color: #1d1606; opacity: 1; }
.lang-switch.on-light a[aria-current="true"] { background: var(--accent, #0e5a3a); color: #fff; }

/* ---------- Icônes de marque ---------- */
.i.brand { width: 20px; height: 20px; flex: none; }

/* ---------- Partage ---------- */
.share-dialog { width: min(520px, calc(100vw - 24px)); }
.share-sub { margin: -6px 0 14px; color: var(--ink-2, inherit); font-size: .92rem; overflow-wrap: anywhere; }
.share-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.share-net {
    display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 10px 4px 8px; border-radius: 14px;
    border: 1px solid transparent; background: transparent; color: var(--ink, inherit); font: 600 .78rem/1.2 var(--font-ui, system-ui), sans-serif;
    cursor: pointer; text-align: center; transition: background-color .15s ease, transform .15s ease;
}
.share-net:hover { background: var(--surface-2, rgba(127, 127, 127, .1)); }
.share-net:active { transform: translateY(1px); }
.share-net:focus-visible { outline: 2px solid var(--focus, #d9b86a); outline-offset: 2px; }
.share-ico { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #5f6e66; }
.share-ico .i { width: 24px; height: 24px; }
.net-whatsapp .share-ico { background: #1f9e55; }
.net-facebook .share-ico { background: #1877f2; }
.net-linkedin .share-ico { background: #0a66c2; }
.net-x .share-ico { background: #111111; }
.net-telegram .share-ico { background: #229ed9; }
.net-instagram .share-ico { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.net-mail .share-ico { background: #8a6a25; }
.net-qr .share-ico { background: #0b1310; color: var(--gold, #d9b86a); }
.net-more .share-ico { background: var(--surface-3, #8a958f); }
.share-link { display: flex; gap: 8px; margin-top: 16px; }
.share-link input { flex: 1 1 auto; min-width: 0; font-size: .86rem; }
.share-hint { margin: 10px 0 0; font-size: .8rem; color: var(--ink-3, var(--muted, #8a958f)); }
@media (max-width: 420px) {
    .share-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .share-link { flex-direction: column; }
}

/* ---------- Code QR ---------- */
.qr-dialog { width: min(440px, calc(100vw - 24px)); text-align: center; }
.qr-dialog .dialog-head { text-align: left; }
.qr-sub { margin: -6px 0 14px; color: var(--ink-2, inherit); font-size: .92rem; }
.qr-frame { display: grid; place-items: center; }
.qr-code {
    width: min(300px, 72vw); aspect-ratio: 1; background: #fff; border-radius: 18px; padding: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 0 0 1px rgba(0, 0, 0, .06);
}
.qr-code svg { display: block; width: 100%; height: 100%; }
.qr-url { margin: 12px 0 0; font: 600 .9rem/1.3 var(--font-ui, system-ui), sans-serif; overflow-wrap: anywhere; color: var(--ink-2, inherit); }
.qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }

/* ---------- Messages (si la page n'a pas les siens) ---------- */
.eit-toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.eit-toast { padding: 12px 14px; border-radius: 12px; background: #12211b; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); font: 500 .92rem/1.4 system-ui, sans-serif; }
.eit-toast.is-error { background: #b53a2e; }

@media print {
    .lang-switch, .share-dialog, .qr-dialog { display: none !important; }
}

/* Barre du haut sur petit écran : le code QR reste accessible depuis « Partager » et le pied de page. */
@media (max-width: 440px) {
    .icon-btn.share-qr-btn { display: none; }
    .topbar .lang-switch a { min-width: 30px; padding: 0 6px; }
}
@media (max-width: 360px) { .topbar .brand-text { display: none; } }

/* Pied de page : partager, code QR, affiche */
.footer-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.footer-tools .link-btn {
    display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 14px;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius: 999px;
    color: inherit; font-size: .84rem; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.footer-tools .link-btn:hover, .footer-tools .link-btn:focus-visible { background: color-mix(in srgb, currentColor 10%, transparent); border-color: color-mix(in srgb, currentColor 40%, transparent); }
.footer-tools .link-btn .i { width: 16px; height: 16px; flex: none; }
