/* L'écran Recherche en appli (01/12/2026) : includes/recherche-appli.php.
   Chargée seulement quand l'interrupteur est allumé et l'écran hors Classique.
   Ombre dure sans trait ; tailles fixes, la place en plus montre plus de cartes. */

/* ---- La page de résultats ------------------------------------------------ */
body.rh24-rech-appli.rh24-ecran-recherche .rh24t-page-header {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
    margin: 0 0 16px; padding: 0; text-align: left; justify-content: flex-start;
}
/* L'alignement suit le réglage « Titre de l'archive » (comme les archives) ; le champ le suit. */
body.rh24-rech-appli.rh24-ecran-recherche .rh24t-page-header.rh24t-titre-centre { justify-content: center; }
body.rh24-rech-appli.rh24-ecran-recherche .rh24t-page-header.rh24t-titre-droite { justify-content: flex-end; }
body.rh24-rech-appli.rh24-ecran-recherche:has(.rh24t-titre-centre) :is(.rh24-rech-page, .rh24-rech-rien) { margin-inline: auto; }
body.rh24-rech-appli.rh24-ecran-recherche:has(.rh24t-titre-droite) .rh24-rech-page { margin-left: auto; }
body.rh24-rech-appli.rh24-ecran-recherche .rh24t-page-title {
    margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; text-align: inherit; color: var(--ds-encre);
}
/* Le nombre : la pastille des archives. */
body.rh24-rech-appli.rh24-ecran-recherche .rh24t-page-compte {
    display: inline-flex; align-items: center; min-height: 28px; margin: 0; padding: 0 12px;
    border: 0; border-radius: var(--ds-r-pilule, 999px); background: var(--ds-surface); color: var(--ds-encre);
    font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: var(--ds-o-1);
}

/* Le champ dans la page : 760 px au plus, le bouton « Rechercher » à côté (sa loupe au téléphone). */
.rh24-rech-page { max-width: 760px; margin: 0 0 20px; }
.rh24-rech-page .rh24t-search-form {
    position: relative; display: flex; flex-direction: row; align-items: stretch; gap: 10px;
    max-width: none; margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
}
.rh24-rech-page .rh24t-search-input {
    flex: 1 1 auto; min-width: 0; min-height: 48px; margin: 0; padding: 0 16px;
    border: 2px solid var(--ds-trait); border-radius: var(--ds-r-m);
    background: var(--ds-surface); color: var(--ds-encre); font-size: 16px; box-shadow: none;
}
.rh24-rech-page .rh24t-search-input:focus { outline: 3px solid var(--ds-marque); outline-offset: 2px; }
.rh24-rech-page .rh24t-search-submit {
    flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; min-width: 48px; margin: 0; padding: 0 18px; border: 0; border-radius: var(--ds-r-m);
    background: var(--ds-marque); color: #fff; font-size: 16px; font-weight: 700; box-shadow: var(--ds-o-1); cursor: pointer;
}
.rh24-rech-page .rh24t-search-submit:active { transform: translate(2px, 2px); box-shadow: none; }
.rh24-rech-page .rh24t-search-mot { position: static !important; width: auto !important; height: auto !important; clip: auto !important; overflow: visible !important; margin: 0 !important; white-space: nowrap; }
.rh24-rech-page .rh24t-search-submit svg { flex: none; }
@media (max-width: 767.98px) {
    .rh24-rech-page .rh24t-search-submit { padding: 0; width: 48px; }
    .rh24-rech-page .rh24t-search-mot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; }
}

/* Rien trouvé : une carte (icône, titre, phrase, deux gestes), puis les derniers tests. */
body.rh24-rech-appli .rh24-rech-rien {
    display: grid; gap: 10px; justify-items: start; max-width: 760px; margin: 0 0 32px; padding: 24px 20px;
    border: 0; border-radius: var(--ds-r-m); background: var(--ds-surface); color: var(--ds-encre);
    box-shadow: var(--ds-o-2); text-align: left;
}
.rh24-rech-rien-ic { display: inline-flex; color: var(--ds-marque); }
.rh24-rech-rien-ic svg { width: 28px; height: 28px; }
body.rh24-rech-appli .rh24-rech-rien .rh24t-none-title { margin: 0; font-size: 20px; line-height: 1.2; color: var(--ds-encre); text-align: left; }
body.rh24-rech-appli .rh24-rech-rien .rh24t-none-text { margin: 0; color: var(--ds-encre-2); font-size: 15px; line-height: 1.45; text-align: left; }
.rh24-rech-bts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.rh24-rech-bt {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--ds-r-m);
    background: var(--ds-surface-2); color: var(--ds-encre) !important; font-weight: 700; font-size: 15px;
    text-decoration: none !important; box-shadow: var(--ds-o-1);
}
.rh24-rech-bt:active { transform: translate(2px, 2px); box-shadow: none; }
@media (hover: hover) { .rh24-rech-bt:hover { background: var(--ds-creux); } }

/* Les jaquettes d'Explorer, reprises ici (leur feuille ne sert que l'écran Rubriques). */
.rh24-rech-derniers { container: rh24rd / inline-size; display: block; margin: 0 0 24px; }
.rh24-rech-derniers .rh24x-titre { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--ds-encre); font-size: 20px; font-weight: 700; }
.rh24-rech-derniers .rh24x-titre svg { color: var(--ds-marque); }
.rh24-rech-derniers .rh24x-jaqs { display: grid; grid-template-columns: repeat(auto-fill, 168px); gap: 16px 12px; margin: 0; padding: 0; list-style: none; }
.rh24-rech-derniers .rh24x-jaqs > li { margin: 0; padding: 0; min-width: 0; }
.rh24-rech-derniers .rh24x-jaq { display: flex; flex-direction: column; gap: 8px; width: 168px; color: var(--ds-encre) !important; text-decoration: none !important; }
.rh24-rech-derniers .rh24x-im { position: relative; display: block; width: 168px; height: 224px; border-radius: var(--ds-r-m); background: var(--ds-creux); box-shadow: var(--ds-o-2); }
.rh24-rech-derniers .rh24x-im > img { display: block; width: 100%; height: 100%; margin: 0; object-fit: cover; border-radius: inherit; }
.rh24-rech-derniers .rh24x-im > .rh24-note-pastille { position: absolute; left: 8px; top: 8px; margin: 0; }
.rh24-rech-derniers .rh24x-jaq > b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.25; }
.rh24-rech-derniers a.rh24x-jaq:active .rh24x-im { transform: translate(2px, 2px); box-shadow: none; }
/* Deux rangées pleines, jamais une ligne entamée (une jaquette = 168 + 12). */
@container rh24rd (max-width: 707.98px) {
    .rh24-rech-derniers .rh24x-jaqs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 168px; overflow-x: auto; scrollbar-width: none; padding: 0 3px 4px 0; }
    .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+11) { display: none; }
}
@container rh24rd (min-width: 708px) and (max-width: 887.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+9) { display: none; } }
@container rh24rd (min-width: 888px) and (max-width: 1067.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+11) { display: none; } }
@container rh24rd (min-width: 1068px) and (max-width: 1247.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+13) { display: none; } }
@container rh24rd (min-width: 1248px) and (max-width: 1427.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+15) { display: none; } }
@container rh24rd (min-width: 1428px) and (max-width: 1607.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+17) { display: none; } }
@container rh24rd (min-width: 1608px) and (max-width: 1787.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+19) { display: none; } }
@container rh24rd (min-width: 1788px) and (max-width: 1967.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+21) { display: none; } }
@container rh24rd (min-width: 1968px) and (max-width: 2147.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+23) { display: none; } }
@container rh24rd (min-width: 2148px) and (max-width: 2327.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+25) { display: none; } }
@container rh24rd (min-width: 2328px) and (max-width: 2507.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+27) { display: none; } }
@container rh24rd (min-width: 2508px) and (max-width: 2687.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+29) { display: none; } }
@container rh24rd (min-width: 2688px) and (max-width: 2867.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+31) { display: none; } }
@container rh24rd (min-width: 2868px) and (max-width: 3047.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+33) { display: none; } }
@container rh24rd (min-width: 3048px) and (max-width: 3227.98px) { .rh24-rech-derniers .rh24x-jaqs > :nth-child(n+35) { display: none; } }

/* ---- La liste instantanée, partout où elle s'ouvre ----------------------- */
body.rh24-rech-appli .rh24-rech {
    border: 0; border-radius: var(--ds-r-l); background: var(--ds-surface); color: var(--ds-encre);
    box-shadow: var(--ds-o-2); padding: 8px; font-size: 15px;
}
body.rh24-rech-appli .rh24-rech-sous {
    padding: 10px 6px 6px; font-size: 15px; font-weight: 700; text-transform: none; letter-spacing: 0; opacity: 1; color: var(--ds-encre-2);
}
body.rh24-rech-appli .rh24-rech-bloc { display: grid; gap: 2px; }
body.rh24-rech-appli .rh24-rech-item {
    min-height: 60px; padding: 8px 10px; gap: 14px; border: 0; border-radius: var(--ds-r-m);
}
body.rh24-rech-appli .rh24-rech-item.is-actif { background: var(--ds-surface-2); box-shadow: inset 0 0 0 2px var(--ds-marque); }
@media (hover: hover) { body.rh24-rech-appli .rh24-rech-item:hover { background: var(--ds-surface-2); } }
body.rh24-rech-appli .rh24-rech-img { flex: 0 0 72px; width: 72px; height: 48px; border-radius: var(--ds-r-s); background: var(--ds-creux); }
body.rh24-rech-appli .rh24-rech-titre { font-size: 15px; font-weight: 700; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
body.rh24-rech-appli .rh24-rech-titre mark { color: var(--ds-marque); }
body.rh24-rech-appli .rh24-rech-meta { margin-top: 2px; font-size: 13px; opacity: 1; color: var(--ds-encre-2); }
/* La note : une pastille soulevée à ombre dure (règle des pastilles). */
body.rh24-rech-appli .rh24-rech-note { flex: 0 0 32px; width: 32px; height: 32px; font-size: 14px; font-weight: 800; box-shadow: 2px 2px 0 0 var(--ds-trait); }
body.rh24-rech-appli .rh24-rech-vide { padding: 12px 10px; }
body.rh24-rech-appli .rh24-rech-pied { border-radius: var(--ds-r-m); padding: 12px 10px; }
body.rh24-rech-appli .rh24-rech-pied.est-bouton {
    display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; margin-top: 10px;
    background: var(--ds-marque); color: #fff; font-weight: 700; font-size: 16px; box-shadow: var(--ds-o-1);
}
body.rh24-rech-appli .rh24-rech-pied.est-bouton.is-actif { outline: 3px solid var(--ds-trait); outline-offset: 2px; }
body.rh24-rech-appli .rh24-rech-pied.est-bouton:active { transform: translate(2px, 2px); box-shadow: none; }
body.rh24-rech-appli .rh24-rech-aller { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px 6px; }
body.rh24-rech-appli .rh24-rech-aller a {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--ds-r-m);
    background: var(--ds-surface-2); color: var(--ds-encre) !important; font-weight: 700; font-size: 15px; text-decoration: none !important;
}
body.rh24-rech-appli .rh24-rech-aller a svg { color: var(--ds-marque); }
@media (hover: hover) { body.rh24-rech-appli .rh24-rech-aller a:hover { background: var(--ds-creux); } }

/* Sous le champ de la page : la largeur du champ. */
.rh24-rech-page .rh24-rech { max-width: none; margin: 0; right: 0; }

/* Sous le champ ouvert au centre de la barre (ordinateur) : 760 px, centrée sur lui. */
body.rh24-rech-appli .rh24t-bar-champ .rh24-rech.rh24-rech-sous-champ {
    left: 50%; right: auto; width: min(760px, calc(100vw - 32px)); max-width: none; margin: 0;
    transform: translateX(-50%); top: calc(100% + 10px); max-height: calc(100vh - 100px);
}

/* ---- La feuille : la loupe de la barre ----------------------------------- */
body.rh24-rech-appli .rh24-feuille-hote:not([hidden]) {
    position: fixed; inset: 0; z-index: 10000; display: block; margin: 0; padding: 0;
    width: auto; height: auto; max-width: none; border: 0; border-radius: 0;
    background: rgb(19 19 21 / .6); box-shadow: none; overflow: hidden;
}
body.rh24-rech-appli .rh24-feuille {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; gap: 14px 10px;
    position: absolute; inset: 0; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--ds-fond); color: var(--ds-encre); overflow: auto; overscroll-behavior: contain;
}
@media (min-width: 768px) {
    body.rh24-rech-appli .rh24-feuille {
        inset: 10px auto auto 50%; width: 760px; max-width: calc(100vw - 32px); max-height: calc(100vh - 40px);
        transform: translateX(-50%); padding: 16px; border-radius: var(--ds-r-l); box-shadow: var(--ds-o-2);
    }
}
body.rh24-rech-appli .rh24-feuille > .rh24t-search-form {
    position: static; display: flex; min-width: 0; max-width: none; margin: 0; padding: 0; border: 0; background: none; box-shadow: none;
}
body.rh24-rech-appli .rh24-feuille .rh24t-search-input {
    flex: 1 1 auto; min-width: 0; min-height: 48px; margin: 0; padding: 0 16px;
    border: 2px solid var(--ds-trait); border-radius: var(--ds-r-m); background: var(--ds-surface); color: var(--ds-encre);
    font-size: 16px; box-shadow: none;
}
/* Entrée envoie toujours le formulaire ; « Tous les résultats » fait le même geste en bas. */
body.rh24-rech-appli .rh24-feuille .rh24t-search-submit { display: none; }
body.rh24-rech-appli .rh24-feuille > [data-rh24t-close] {
    width: 48px; height: 48px; min-width: 48px; margin: 0; padding: 0; border: 0; border-radius: var(--ds-r-m);
    background: var(--ds-surface); color: var(--ds-encre); box-shadow: var(--ds-o-1);
    display: inline-flex; align-items: center; justify-content: center;
}
body.rh24-rech-appli .rh24-feuille > .rh24-rech {
    grid-column: 1 / -1; position: static; inset: auto; max-width: none; max-height: none; margin: 0;
    padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible;
}
body.rh24-rech-appli .rh24-feuille > .rh24-rech .rh24-rech-sous { padding: 0 0 8px; }
body.rh24-rech-appli .rh24-feuille > .rh24-rech .rh24-rech-bloc {
    padding: 6px; margin-bottom: 14px; border-radius: var(--ds-r-m); background: var(--ds-surface); box-shadow: var(--ds-o-2);
}
body.rh24-rech-appli .rh24-feuille > .rh24-rech .rh24-rech-aller { padding: 0; }
body.rh24-rech-appli .rh24-feuille > .rh24-rech .rh24-rech-vide,
body.rh24-rech-appli .rh24-feuille > .rh24-rech .rh24-rech-igdb { display: block; border-radius: var(--ds-r-m); background: var(--ds-surface); margin-bottom: 10px; }

/* ---- Les versions ------------------------------------------------------- */
/* Audace : l'en-tête en bandeau rouge, le titre à 40. */
body.rh24-rech-appli.rh24-style-audace.rh24-ecran-recherche .rh24t-page-header {
    padding: 24px 28px; border-radius: var(--ds-r-l); background: var(--ds-marque); color: #fff; box-shadow: var(--ds-o-2);
}
body.rh24-rech-appli.rh24-style-audace.rh24-ecran-recherche .rh24t-page-title { color: #fff; font-size: 40px; line-height: 1.02; letter-spacing: -.03em; }
body.rh24-rech-appli.rh24-style-audace.rh24-ecran-recherche .rh24t-page-compte { background: #131315; color: #fff; }
/* Console : titres légers, l'état actif cerclé. */
body.rh24-rech-appli.rh24-style-console.rh24-ecran-recherche .rh24t-page-title { font-weight: 500; }
body.rh24-rech-appli.rh24-style-console .rh24-rech-pied.est-bouton { background: none; color: var(--ds-encre); box-shadow: inset 0 0 0 3px var(--ds-marque); }

/* La page sur le fond, sans carte blanche autour (maquette). */
body.rh24-rech-appli.rh24-ecran-recherche .rh24t-content { padding: 0; border-radius: 0; background: none; box-shadow: none; }

/* Le flou de la barre ferait d'elle le cadre de la feuille (`position: fixed` s'y enfermerait) :
   retiré tant que la feuille est ouverte, le voile la couvre de toute façon. */
body.rh24-rech-appli .rh24t-bar:has(.rh24-feuille-hote:not([hidden])) { -webkit-backdrop-filter: none; backdrop-filter: none; z-index: 10000; }
