/* La barre de recherche (assets/recherche.js) et la page /recherche (api/recherche.js). Chargée au premier clic.
   Clair seulement : color-scheme vient du :root des pages.

   15/11 (Clément, n° 45 : « refais ce panneau de recherche, rends-le vraiment super clean »). Une palette de commande :
   une seule pièce blanche, une ligne de saisie qui respire, des résultats en LIGNES (pas en cartes empilées), la ligne
   choisie posée sur un gris très doux avec un trait bordeaux, le genre du résultat à droite au lieu d'un surtitre, un pied
   qui dit les touches et porte l'appel. Les icônes : au trait rouge, dans une pastille rose pâle (le style des dessins). */
:root { color-scheme: light; color-scheme: only light; }
html.rch-ouvert { overflow: hidden; }
.rch[hidden] { display: none; }
.rch {
    --rch-encre: #0a0a0a; --rch-doux: #5c5f66; --rch-mute: #8a8c92; --rch-filet: rgba(10, 10, 10, 0.07); --rch-accent: #7b2d3b;
    --rch-rose: #fbeef0; --rch-choix: #f6f6f7;
    position: fixed; inset: 0; z-index: 2147483000;
    font-family: Geist, Outfit, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--rch-encre);
}
.rch-voile { position: absolute; inset: 0; background: rgba(20, 14, 16, 0.32); -webkit-backdrop-filter: blur(6px) saturate(0.9); backdrop-filter: blur(6px) saturate(0.9); animation: rchVoile 0.18s ease-out; }
.rch-boite {
    position: relative; display: flex; flex-direction: column;
    width: min(680px, calc(100vw - 32px)); max-height: min(72vh, 640px); margin: 12vh auto 0;
    background: #fff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.06), 0 1px 2px rgba(10, 10, 10, 0.05), 0 8px 16px -8px rgba(10, 10, 10, 0.12), 0 32px 64px -24px rgba(10, 10, 10, 0.32);
    animation: rchBoite 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* La saisie. */
.rch-tete { position: relative; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0 12px 0 8px; border-bottom: 1px solid var(--rch-filet); }
.rch-loupe { flex: none; display: grid; place-items: center; width: 44px; height: 64px; color: var(--rch-accent); cursor: text; }
.rch-loupe svg { width: 21px; height: 21px; }
.rch-champ {
    flex: 1; min-width: 0; height: 64px; border: 0; outline: 0; background: none; padding: 0 8px 0 0;
    font: 450 19px/1.2 inherit; font-family: inherit; letter-spacing: -0.022em; color: var(--rch-encre); -webkit-appearance: none; appearance: none;
}
.rch-champ::placeholder { color: var(--rch-mute); font-weight: 400; }
.rch-champ::-webkit-search-cancel-button { display: none; }
.rch-fermer { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; background: none; cursor: pointer; font-family: inherit; color: var(--rch-doux); }
.rch-fermer span { display: none; font-size: 14px; font-weight: 520; }
.rch kbd {
    display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 6px;
    background: #fff; box-shadow: inset 0 0 0 1px rgba(10, 10, 10, 0.12), 0 1px 0 rgba(10, 10, 10, 0.08);
    font: 500 12px/1 inherit; font-family: inherit; color: var(--rch-doux);
}
.rch-fermer:hover kbd { color: var(--rch-encre); box-shadow: inset 0 0 0 1px rgba(10, 10, 10, 0.3), 0 1px 0 rgba(10, 10, 10, 0.08); }
.rch-fermer:focus-visible { outline: 2px solid var(--rch-accent); outline-offset: 3px; border-radius: 7px; }

/* Le corps. */
.rch-corps { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 10px 8px 10px; -webkit-overflow-scrolling: touch; }
.rch-amorce { margin: 6px 12px 8px; font-size: 13px; font-weight: 500; color: var(--rch-mute); }
.rch-compris { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 12px 10px; font-size: 13px; font-weight: 500; color: var(--rch-mute); }
.rch-compris span { margin-right: 4px; }
.rch-compris b { padding: 4px 10px; border-radius: 999px; background: var(--rch-rose); color: var(--rch-accent); font-weight: 560; }
.rch-liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.rch-r {
    position: relative; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 9px 12px; border-radius: 10px;
    color: inherit; text-decoration: none; transition: background-color 0.12s;
}
.rch-r[aria-selected="true"] { background: var(--rch-choix); }
.rch-r[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rch-accent); }
.rch-r:focus-visible { outline: 2px solid var(--rch-accent); outline-offset: -2px; }
.rch-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--rch-rose); color: var(--rch-accent); }
.rch-ico svg { width: 18px; height: 18px; }
.rch-texte { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.rch-titre { display: block; font-size: 15px; font-weight: 520; line-height: 1.35; letter-spacing: -0.012em; }
.rch-r--tete .rch-titre { font-weight: 600; }
.rch-titre mark { background: none; color: var(--rch-accent); }
.rch-extrait { display: block; margin-top: 2px; overflow: hidden; font-size: 13px; line-height: 1.45; color: var(--rch-doux); white-space: nowrap; text-overflow: ellipsis; }
.rch-genre { flex: none; font-size: 12px; font-weight: 500; color: var(--rch-mute); }
.rch-fl { flex: none; width: 7px; height: 7px; margin: 0 4px 0 -4px; border-top: 1.75px solid transparent; border-right: 1.75px solid transparent; rotate: 45deg; transition: border-color 0.12s, translate 0.12s; }
.rch-r[aria-selected="true"] .rch-fl { border-color: var(--rch-accent); translate: 2px 0; }
.rch-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Le pied : les touches à gauche, l'appel à droite. */
.rch-pied { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; border-top: 1px solid var(--rch-filet); background: #fcfcfc; }
.rch-touches { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--rch-mute); }
.rch-touches kbd { min-width: 22px; height: 22px; padding: 0 5px; }
.rch-touches kbd:nth-of-type(3) { margin-left: 8px; }
.rch-appel {
    display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 16px; border-radius: 10px;
    background: var(--rch-accent); color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
    box-shadow: inset 0 -2px 0 rgba(30, 4, 10, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 0 rgba(30, 4, 10, 0.35), 0 6px 12px -8px rgba(60, 12, 24, 0.6);
    transition: translate 0.16s cubic-bezier(0.22, 0.68, 0.24, 1), background-color 0.16s;
}
.rch-appel i::before { content: "→"; font-style: normal; }
.rch-appel:hover { background: #6b2533; translate: 0 -1px; }
.rch-appel:active { translate: 0 1px; }
.rch-appel:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; }

.rch-attente { display: grid; gap: 4px; padding: 4px; }
.rch-attente i { display: block; height: 48px; border-radius: 10px; background: linear-gradient(90deg, #f3f3f4, #f9f9fa, #f3f3f4); background-size: 200% 100%; animation: rchAttente 1.1s linear infinite; }
.rch-vide { margin: 18px 12px; font-size: 14.5px; line-height: 1.5; color: var(--rch-doux); }
.rch-vide a { color: var(--rch-accent); }
@keyframes rchVoile { from { opacity: 0; } }
@keyframes rchBoite { from { opacity: 0; translate: 0 -6px; scale: 0.99; } }
@keyframes rchAttente { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rch-voile, .rch-boite, .rch-attente i { animation: none; } .rch-r, .rch-appel, .rch-fl { transition: none; } }

/* Téléphone : la palette prend l'écran, « Fermer » remplace la touche Échap, l'appel prend la largeur. */
@media (max-width: 640px), (hover: none) {
    .rch-fermer kbd { display: none; }
    .rch-fermer span { display: inline; }
    .rch-touches { display: none; }
}
@media (max-width: 640px) {
    .rch-boite { width: 100%; max-height: none; height: 100%; height: 100dvh; margin: 0; border-radius: 0; animation: none; }
    .rch-tete { padding: 0 14px 0 4px; }
    .rch-loupe, .rch-champ { height: 60px; }
    .rch-champ { font-size: 17px; }
    .rch-corps { padding: 8px 6px; }
    .rch-r { gap: 12px; padding: 10px; }
    .rch-genre { display: none; }
    .rch-extrait { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .rch-pied { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fff; }
    .rch .rch-appel { flex: 1; justify-content: space-between; min-height: 48px; font-size: 15px; }
}

/* ═════ LA PAGE /recherche ═════ (api/recherche.js) Servie sans script, pour les assistants, les robots et les liens partagés :
   le gris du site, une barre avec la marque et le devis, le champ comme dans la palette, les résultats en lignes. */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/geist-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/geist-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C0; }
.rch-page {
    --rch-encre: #0a0a0a; --rch-doux: #5c5f66; --rch-mute: #7a7c82; --rch-filet: rgba(10, 10, 10, 0.07); --rch-accent: #7b2d3b; --rch-rose: #fbeef0; --rch-choix: #f6f6f7;
    margin: 0; min-height: 100vh; background: #f4f4f5; color: var(--rch-encre);
    font: 16px/1.55 Geist, Outfit, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
.rch-p-barre { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; padding: 0 max(20px, calc((100vw - 1040px) / 2)); background: rgba(255, 255, 255, 0.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rch-filet); }
.rch-p-marque { display: inline-flex; align-items: center; gap: 10px; color: var(--rch-encre); text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.rch-p-marque img { display: block; width: 30px; height: 30px; }
.rch-p-devis { min-height: 40px; }
.rch-p-main { max-width: 760px; margin: 0 auto; padding: 56px 20px 80px; }
.rch-p-main h1 { margin: 0 0 22px; font-size: clamp(34px, 5vw, 48px); font-weight: 640; line-height: 1.04; letter-spacing: -0.045em; }
.rch-p-form {
    display: flex; align-items: center; gap: 4px; padding: 0 8px 0 6px; border-radius: 16px; background: #fff;
    box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.07), 0 1px 2px rgba(10, 10, 10, 0.05), 0 12px 28px -18px rgba(10, 10, 10, 0.3);
}
.rch-p-form:focus-within { box-shadow: 0 0 0 2px var(--rch-accent), 0 12px 28px -18px rgba(10, 10, 10, 0.3); }
.rch-p-form .rch-loupe { flex: none; display: grid; place-items: center; width: 44px; height: 62px; color: var(--rch-accent); }
.rch-p-form .rch-loupe svg { width: 21px; height: 21px; }
.rch-p-form .rch-champ { flex: 1; min-width: 0; height: 62px; border: 0; outline: 0; background: none; font: 450 18px/1.2 inherit; font-family: inherit; letter-spacing: -0.02em; color: var(--rch-encre); -webkit-appearance: none; appearance: none; }
.rch-p-ok {
    flex: none; min-height: 46px; padding: 0 20px; border: 0; border-radius: 11px; background: var(--rch-accent); color: #fff; cursor: pointer;
    font: 600 15px/1 inherit; font-family: inherit; box-shadow: inset 0 -2px 0 rgba(30, 4, 10, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 1px 0 rgba(30, 4, 10, 0.35);
}
.rch-p-ok:hover { background: #6b2533; }
.rch-p-ok:focus-visible { outline: 2px solid #0a0a0a; outline-offset: 2px; }
.rch-p-res { margin-top: 18px; padding: 10px 8px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.06), 0 1px 2px rgba(10, 10, 10, 0.04); }
.rch-p-amorce { margin: 8px 12px 6px; font-size: 13px; font-weight: 500; color: var(--rch-mute); }
.rch-p-compris { margin: 8px 12px 8px; }
.rch-p-liste { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; padding: 0; list-style: none; }
.rch-page .rch-r:hover { background: var(--rch-choix); }
.rch-page .rch-extrait { white-space: normal; }
.rch-p-vide { margin: 14px 12px; color: var(--rch-doux); }
.rch-p-vide a, .rch-p-note a { color: var(--rch-accent); }
.rch-p-appel-bloc { display: flex; justify-content: flex-end; margin-top: 18px; }
.rch-p-note { margin: 22px 4px 0; font-size: 13px; line-height: 1.55; color: var(--rch-doux); }
.rch-p-api { margin-top: 8px; }
@media (max-width: 640px) {
    .rch-p-barre { height: 60px; padding: 0 16px; }
    .rch-p-main { padding: 32px 16px 64px; }
    .rch-p-form .rch-champ { font-size: 16.5px; }
    .rch-p-ok { padding: 0 14px; }
    .rch-p-appel-bloc .rch-appel { flex: 1; justify-content: space-between; min-height: 48px; }
    .rch-page .rch-genre { display: none; }
}
