/* Recherche de rubrique : dernière case de la grille des rubriques ; le champ prend la place de la case au clic ;
   résultats en liste déroulante posée sur la page (07/11/2026). */
.tsmc-nav { position:relative; }
.tsmc-nav [hidden] { display:none !important; }
.tsmc-nav .tsmc-nav-recherche-li { position:relative; }
.tsmc-nav .tsmc-nav-recherche { height:100%; }

/* Case fermée : même gabarit que les rubriques, mais fond foncé et loupe dans une pastille, pour qu'on voie que c'est un outil et non une rubrique */
.tsmc-nav .tsmc-nav-recherche-ouvrir { display:flex; align-items:center; gap:10px; width:100%; height:100%; margin:0; padding:11px 12px; border:1px solid var(--bleu-fonce); border-radius:12px; background:var(--bleu-fonce); color:#fff; font:inherit; font-size:15px; font-weight:bold; line-height:1.2; text-align:left; cursor:pointer; transition:background .15s, border-color .15s, color .15s; }
.tsmc-nav .tsmc-nav-recherche-ouvrir i { flex:0 0 30px; width:30px; height:30px; border-radius:50%; background:#fff; font-size:15px; line-height:30px; text-align:center; color:var(--bleu-fonce); }
.tsmc-nav .tsmc-nav-recherche-ouvrir:hover, .tsmc-nav .tsmc-nav-recherche-ouvrir:focus-visible { background:#0b4f87; border-color:#0b4f87; color:#fff; }

/* Champ ouvert : remplace la case (même taille), sans cadre intérieur */
.tsmc-nav .tsmc-nav-recherche-champ { position:absolute; top:0; right:0; bottom:0; left:0; z-index:5; display:flex; align-items:center; gap:10px; padding:0 8px 0 12px; border:1px solid var(--bleu); border-radius:12px; background:#fff; box-shadow:0 0 0 3px rgba(13,89,149,.15); }
.tsmc-nav .tsmc-nav-recherche-champ > i { flex:0 0 22px; font-size:20px; text-align:center; color:var(--bleu); }
html body .tsmc-nav .tsmc-nav-recherche-champ input[type="search"], html body .tsmc-nav .tsmc-nav-recherche-champ input[type="search"]:focus { flex:1 1 auto; min-width:0; width:100%; height:auto; margin:0; padding:6px 0; border:0 !important; border-radius:0; box-shadow:none !important; outline:0 !important; background:transparent !important; color:var(--texte); font:inherit; font-size:16px; line-height:1.2; -webkit-appearance:none; appearance:none; }
.tsmc-nav .tsmc-nav-recherche-champ input::-webkit-search-cancel-button { -webkit-appearance:none; }
.tsmc-nav .tsmc-nav-recherche-effacer { flex:0 0 30px; height:30px; margin:0; padding:0; border:0; border-radius:50%; background:transparent; color:var(--doux); font-size:24px; line-height:1; cursor:pointer; }
.tsmc-nav .tsmc-nav-recherche-effacer:hover, .tsmc-nav .tsmc-nav-recherche-effacer:focus-visible { background:var(--bleu-clair); color:var(--bleu-fonce); }

/* Liste déroulante (position réglée par le JavaScript) */
.tsmc-nav .tsmc-nav-resultats { position:absolute; top:0; left:0; z-index:30; width:460px; max-width:100%; padding:6px; max-height:min(60vh, 420px); overflow-y:auto; background:#fff; border:1px solid var(--bord); border-radius:12px; box-shadow:0 8px 24px rgba(9,63,107,.18); }
.tsmc-nav .tsmc-nav-resultats > p { margin:2px 8px 6px; color:var(--doux); font-size:13px; }
.tsmc-nav .tsmc-nav-resultats > p:empty { display:none; }
.tsmc-nav .tsmc-nav-resultats ul { display:block; }
.tsmc-nav .tsmc-nav-resultats a { position:static; display:flex; align-items:baseline; justify-content:space-between; gap:12px; height:auto; min-height:0; padding:9px 10px; border:0; border-radius:8px; background:transparent; color:var(--texte); font-size:15px; font-weight:normal; line-height:1.3; text-decoration:none; }
.tsmc-nav .tsmc-nav-resultats a:hover, .tsmc-nav .tsmc-nav-resultats a:focus-visible { background:var(--bleu-clair); border:0; color:var(--bleu-fonce); text-decoration:none; outline:0; }
.tsmc-nav .tsmc-nav-resultats a span { flex:1 1 auto; min-width:0; }
.tsmc-nav .tsmc-nav-resultats a small { flex:0 0 auto; margin:0; color:var(--doux); font-size:12.5px; }
.tsmc-nav .tsmc-nav-resultats a i { display:none; }

@media (max-width:979px) { .tsmc-nav .tsmc-nav-recherche-ouvrir { font-size:14px; padding:10px 8px; gap:7px; } .tsmc-nav .tsmc-nav-recherche-ouvrir i { flex-basis:28px; width:28px; height:28px; line-height:28px; } }

/* Téléphone : la case reste visible au début de la ligne qui défile ; ouverte, le champ recouvre la ligne des boutons */
@media (max-width:700px) {
  .tsmc-nav .tsmc-nav-rub > li.tsmc-nav-recherche-li { order:-1; position:sticky; left:0; z-index:3; background:#fff; padding-right:2px; }
  .tsmc-nav .tsmc-nav-recherche-ouvrir { flex-direction:column; justify-content:center; width:96px; padding:10px 4px 8px; font-size:13px; text-align:center; gap:5px; }
  .tsmc-nav .tsmc-nav-recherche-champ { position:absolute; top:0; right:0; left:0; bottom:auto; }
  .tsmc-nav .tsmc-nav-recherche-li { position:static; }
  .tsmc-nav.tsmc-nav-ouvert .tsmc-nav-rub > li { visibility:hidden; }
  .tsmc-nav.tsmc-nav-ouvert .tsmc-nav-recherche-champ { visibility:visible; }
  .tsmc-nav .tsmc-nav-resultats a { flex-direction:column; align-items:flex-start; gap:2px; }
}
