/* Dréa Digital, Brin de Stef, barre de recherche (direction Didone).
   2026-09-14. Complément de index-didone-v1.css et header-didone-v1.css.

   La loupe du chapeau fait descendre un bandeau sous le chapeau, pas une
   fenêtre au milieu de l'écran : la recherche reste un geste de navigation,
   elle ne coupe pas la lecture. main.js et recherche.js basculent la classe
   .open sur #searchOverlay et #searchBar, noms repris du site V1. */

/* Le libellé du champ existe pour les lecteurs d'écran, il ne se voit pas. */
.hors-ecran {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.search-overlay {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(33, 30, 21, .34);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s var(--ease);
}
.search-overlay.open { opacity: 1; visibility: visible; }

.search-bar {
  position: fixed; z-index: 21; top: 0; left: 0; right: 0;
  background: var(--surface-page);
  border-bottom: 1px solid var(--hairline);
  box-shadow: 0 18px 40px rgba(33, 30, 21, .1);
  transform: translateY(-101%);
  transition: transform .42s var(--ease);
  max-height: 100dvh; overflow-y: auto;
}
.search-bar.open { transform: none; }

.search-bar-inner {
  max-width: var(--maxw); margin-inline: auto;
  padding: clamp(18px, 3vw, 28px) var(--gut);
  display: flex; align-items: flex-end; gap: clamp(12px, 2vw, 24px);
}
.search-bar-lede { flex: 1; min-width: 0; }
.search-eyebrow {
  margin: 0 0 -2px; color: var(--accent-strong);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem); line-height: 1;
}
.search-bar-inner input {
  width: 100%; min-height: 44px;
  appearance: none; border: 0; border-bottom: 1px solid var(--hairline);
  border-radius: 0; background: none; color: var(--ink);
  font-family: var(--serif); font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  padding: 6px 2px;
  transition: border-color .25s var(--ease);
}
.search-bar-inner input::placeholder { color: var(--ink-faint); font-style: italic; }
.search-bar-inner input:focus { outline: none; border-bottom-color: var(--accent); }
.search-bar-inner input::-webkit-search-cancel-button { appearance: none; }

.search-close {
  appearance: none; background: none; border: 0; border-radius: 0; cursor: pointer;
  font-family: var(--serif); color: var(--ink-muted);
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500;
  border-bottom: 1px solid var(--hairline);
  min-height: 44px; padding: 0 2px; white-space: nowrap;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.search-close:hover { color: var(--accent-strong); border-bottom-color: var(--accent); }

/* --------------------------------------------------------- RÉSULTATS */
.search-results {
  max-width: var(--maxw); margin-inline: auto;
  padding-inline: var(--gut);
}
.search-results:empty { display: none; }
.search-results ul { list-style: none; margin: 0; padding: 0 0 clamp(18px, 3vw, 28px); }

.search-result {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: clamp(14px, 2vw, 22px);
  padding: 12px 0; min-height: 44px;
  border-top: 1px solid var(--hairline);
  animation: search-result-in .3s var(--ease) backwards;
}
.search-results li:nth-child(2) .search-result { animation-delay: .03s; }
.search-results li:nth-child(3) .search-result { animation-delay: .06s; }
.search-results li:nth-child(4) .search-result { animation-delay: .09s; }
.search-results li:nth-child(n+5) .search-result { animation-delay: .12s; }
@keyframes search-result-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.search-result:hover .search-result-nom { color: var(--accent-strong); }
.search-result-img { background: var(--sand-200); aspect-ratio: 1; overflow: hidden; }
.search-result-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-nom {
  font-size: 1rem; line-height: 1.3; letter-spacing: -.01em; font-weight: 600;
  transition: color .25s var(--ease);
}
.search-result-cat { margin: 2px 0 0; }
.search-result-prix {
  font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.search-vide {
  margin: 0; padding: 16px 0 clamp(18px, 3vw, 28px);
  border-top: 1px solid var(--hairline);
  color: var(--ink-muted); font-style: italic;
}
.search-vide a { border-bottom: 1px solid var(--accent); }

@media (max-width: 620px) {
  .search-result { grid-template-columns: 48px 1fr; }
  .search-result-prix { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .search-overlay, .search-bar, .search-close, .search-result-nom, .search-bar-inner input { transition: none; }
  .search-result { animation: none; }
}
