/* Navigation 2026 (#247) : palette de recherche, barre d'actions mobile, barre de progression, outils de page,
   pages « Posez votre question » et « Prendre rendez-vous », feuille d'impression des pages de contenu. */
:root { --nb-barre-h: 60px; --nb-bord: var(--c-border, #e2e8f0); --nb-texte: var(--c-text, #0f172a); --nb-texte-2: var(--c-text-2, #475569);
    --nb-marque: var(--c-brand, #1d4f91); --nb-marque-fonce: var(--c-brand-hover, #163d70); --nb-doux: var(--c-brand-soft, #e8eef7); --nb-fond: #fff; }

/* ---------- Palette ---------- */
.nb-palette[hidden] { display: none; }
.nb-palette { position: fixed; inset: 0; z-index: 1100; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.nb-palette__fond { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); }
.nb-palette__boite { position: relative; width: 100%; max-width: 680px; max-height: 80vh; display: flex; flex-direction: column; background: var(--nb-fond);
    color: var(--nb-texte); border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .35); overflow: hidden; }
.nb-palette__champ { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--nb-bord); }
.nb-palette__ico { color: var(--nb-texte-2); display: inline-flex; }
.nb-palette__champ input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 1.0625rem; padding: 8px 0; background: transparent; color: inherit; }
.nb-palette__champ input:focus-visible { box-shadow: none; }
.nb-palette__boite:focus-within .nb-palette__champ { box-shadow: inset 0 -2px 0 var(--nb-marque); }
.nb-palette__fermer { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent;
    color: var(--nb-texte-2); cursor: pointer; }
.nb-palette__fermer:hover { background: var(--nb-doux); color: var(--nb-texte); }
.nb-palette__fermer:focus-visible, .nb-option:focus-visible { outline: 3px solid var(--ui-focus, #ffbf47); outline-offset: 2px; }
.nb-palette__corps { overflow-y: auto; overscroll-behavior: contain; }
.nb-liste:empty { display: none; }
.nb-groupe { padding: 6px 0; }
.nb-groupe + .nb-groupe { border-top: 1px solid var(--nb-bord); }
.nb-groupe__t { padding: 6px 16px 4px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--nb-texte-2); }
.nb-option { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 9px 16px; color: var(--nb-texte); text-decoration: none; cursor: pointer;
    border-left: 3px solid transparent; }
.nb-option[aria-selected="true"] { background: var(--nb-doux); border-left-color: var(--nb-marque); }
.nb-option__t { font-weight: 600; overflow-wrap: anywhere; }
.nb-option__s { font-size: .875rem; color: var(--nb-texte-2); overflow-wrap: anywhere; }
.nb-option__x { margin-left: auto; color: var(--nb-texte-2); }
.nb-groupe--suite .nb-option__t { font-weight: 500; color: var(--nb-marque); }
.nb-palette__etat { margin: 0; padding: 10px 16px; font-size: .875rem; color: var(--nb-texte-2); }
.nb-palette__etat:empty { display: none; }
.nb-palette__pied { margin: 0; padding: 8px 16px; border-top: 1px solid var(--nb-bord); font-size: .8125rem; color: var(--nb-texte-2); background: #f8fafc; }
.nb-palette__pied kbd { font: inherit; font-size: .75rem; padding: 1px 5px; border: 1px solid var(--nb-bord); border-bottom-width: 2px; border-radius: 4px; background: #fff; }
html.nb-palette-ouverte { overflow: hidden; }
@media (max-width: 767.98px) {
    .nb-palette { padding: 0; }
    .nb-palette__boite { max-width: none; max-height: none; height: 100%; border-radius: 0; }
    .nb-palette__corps { flex: 1; }
    .nb-palette__kbd { display: none; }
}

/* ---------- Barre de progression de lecture ---------- */
.nb-progression { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1050; pointer-events: none; }
.nb-progression span { display: block; height: 100%; background: var(--nb-marque); transform: scaleX(0); transform-origin: 0 50%; }
html[dir="rtl"] .nb-progression span { transform-origin: 100% 50%; }

/* ---------- Barre d'actions mobile (< 768 px) ---------- */
.nb-barre { display: none; }
@media (max-width: 767.98px) {
    .nb-barre { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; background: var(--nb-fond); border-top: 1px solid var(--nb-bord);
        box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); padding-bottom: env(safe-area-inset-bottom, 0px); }
    .nb-barre ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
    .nb-barre a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--nb-barre-h); padding: 6px 2px;
        color: var(--nb-texte-2); text-decoration: none; font-size: .6875rem; font-weight: 600; line-height: 1.15; text-align: center; }
    .nb-barre a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nb-barre a[aria-current="page"] { color: var(--nb-marque); box-shadow: inset 0 3px 0 var(--nb-marque); }
    .nb-barre a:focus-visible { outline: 3px solid var(--ui-focus, #ffbf47); outline-offset: -3px; }
    body { padding-bottom: calc(var(--nb-barre-h) + env(safe-area-inset-bottom, 0px)); }
    .hp-btn { bottom: calc(var(--nb-barre-h) + 12px + env(safe-area-inset-bottom, 0px)) !important; }
    .sel-pastille { bottom: calc(var(--nb-barre-h) + 12px + env(safe-area-inset-bottom, 0px)); }
    .sel-pastille { right: 68px; }
}

/* ---------- Outils de page ---------- */
.nb-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 20px; padding: 10px 0;
    border-top: 1px solid var(--nb-bord); border-bottom: 1px solid var(--nb-bord); font-size: .875rem; }
.nb-outils.ui-wrap { padding: 12px 32px; margin-top: 8px; margin-bottom: 24px; border: 0; }
@media (max-width: 1023.98px) { .nb-outils.ui-wrap { padding: 12px 24px; } }
@media (max-width: 639.98px) { .nb-outils.ui-wrap { padding: 12px 16px; } }
.nb-outils__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--nb-texte-2); }
.nb-outils__meta > span { display: inline-flex; align-items: center; gap: 5px; }
.nb-outils__meta [hidden] { display: none; }
.nb-outils__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; position: relative; }
.nb-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 1px solid var(--nb-bord); border-radius: 999px; background: #fff;
    color: var(--nb-texte); font: inherit; font-size: .875rem; font-weight: 600; text-decoration: none; cursor: pointer; list-style: none; }
.nb-btn::-webkit-details-marker { display: none; }
.nb-btn:hover { border-color: var(--nb-marque); color: var(--nb-marque); }
.nb-btn:focus-visible { outline: 3px solid var(--ui-focus, #ffbf47); outline-offset: 2px; }
.nb-btn[hidden], .nb-partage[hidden] { display: none; }
.nb-btn--plein { background: var(--nb-marque); border-color: var(--nb-marque); color: #fff; }
.nb-btn--plein:hover { background: var(--nb-marque-fonce); color: #fff; }
.nb-btn.est-fait { border-color: #15803d; color: #15803d; }
.nb-partage { position: relative; }
.nb-partage__liste { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 200px; margin: 0; padding: 6px; list-style: none; background: #fff;
    border: 1px solid var(--nb-bord); border-radius: 10px; box-shadow: 0 12px 30px rgba(15, 23, 42, .15); }
.nb-partage__liste a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--nb-texte); text-decoration: none; }
.nb-partage__liste a:hover, .nb-partage__liste a:focus-visible { background: var(--nb-doux); }
/* #251 (CLS) : avec JavaScript (classe « js » posée dans <head>), les boutons copier / imprimer et la place du temps de
   lecture existent dès le premier rendu ; nav2026.js ne fait plus que les activer : plus de décalage de mise en page. */
.js .nb-outils [data-nb-copier][hidden], .js .nb-outils [data-nb-imprimer][hidden] { display: inline-flex; }
.js .nb-outils__meta [data-nb-lecture][hidden] { display: inline-flex; visibility: hidden; }
.nb-outils__statut { font-weight: 600; color: #15803d; }
.nb-outils__statut:empty { display: none; }
@media (max-width: 479.98px) { .nb-btn span { white-space: normal; } .nb-partage__liste { left: auto; right: 0; } }

/* ---------- Pages « Posez votre question » et « Prendre rendez-vous » ---------- */
.nb-page { max-width: 880px; }
.nb-page__intro { margin: 8px 0 0; font-size: 1.0625rem; color: var(--nb-texte-2); }
.nb-page__note { display: flex; gap: 6px; align-items: center; margin: 10px 0 0; font-size: .875rem; color: var(--nb-texte-2); }
.nb-question { margin: 24px 0; }
.nb-question__ligne { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.nb-question__ligne .ui-input { flex: 1 1 260px; min-width: 0; }
.nb-reponse__t { margin: 8px 0 14px; font-size: 1.25rem; font-weight: 700; }
.nb-reponse__liste { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.nb-passage { padding: 16px 18px; border: 1px solid var(--nb-bord); border-left: 4px solid var(--nb-marque); border-radius: 10px; background: #fff; }
.nb-passage__source { margin: 0 0 6px; font-size: .8125rem; font-weight: 700; color: var(--nb-texte-2); overflow-wrap: anywhere; }
.nb-passage__texte { margin: 0; }
.nb-passage__texte p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.nb-passage__texte mark { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; }
.nb-passage__lien { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-weight: 600; color: var(--nb-marque); }
.nb-reponse__avert, .nb-reponse__vide { margin: 14px 0 0; color: var(--nb-texte-2); font-size: .875rem; }
.nb-reponse__vide { font-size: 1rem; color: var(--nb-texte); }
.nb-reponse__suite { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.nb-rdv { margin-top: 24px; }
.nb-rdv__grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-bottom: 16px; }
.nb-rdv__large { grid-column: 1 / -1; }
.nb-rdv__moment { border: 0; margin: 0; padding: 0; min-width: 0; }
.nb-choix { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: 18px; cursor: pointer; }
.nb-choix input { width: 20px; height: 20px; accent-color: var(--nb-marque); flex: none; }
.nb-choix--consent { align-items: flex-start; margin: 0; }
.nb-choix--consent input { margin-top: 2px; }
.nb-facultatif { font-weight: 400; color: var(--nb-texte-2); }
.nb-erreur { margin: 4px 0 0; color: #b91c1c; font-size: .875rem; }
.nb-rdv .ui-input { width: 100%; max-width: 100%; }
@media (max-width: 639.98px) { .nb-rdv__grille { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) { .nb-option, .nb-btn { transition: none; } }

/* ---------- Impression des pages de contenu ---------- */
@media print {
    /* Format portrait réservé aux pages de contenu (page nommée) : la feuille du socle garde le paysage pour les fiches d'offre. */
    @page nb-contenu { size: A4 portrait; margin: 14mm 12mm; }
    main:has([data-nb-outils]) { page: nb-contenu; }
    .nb-barre, .nb-palette, .nb-progression, .nb-outils__actions, .hp-btn, .sel-pastille, .ui-skip, #main-nav, .ui-entete, .ui-footer,
    .ui-fil, .pc-aside, .sf, .ui-consent, [data-consent-banner] { display: none !important; }
    body { padding: 0 !important; }
    body:has([data-nb-outils]) { font-size: 11pt; color: #000; background: #fff !important; }
    main { width: auto !important; }
    a { color: #000; }
    .nb-outils { border: 0; padding: 0; margin: 0 0 8pt; }
    h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
    figure, table, img, .nb-passage { break-inside: avoid; page-break-inside: avoid; }
    img { max-width: 100% !important; }
}
