/* Recherche de l'app (/app/recherche). Servie après /style.css, /app/app.css et
 * /app/fil.css (barres noires du haut et du bas). Champ sur le noir, onglets en
 * mono soulignés jaune comme les filtres du fil, résultats sur le papier en
 * liste à filets (aucune carte), mots trouvés surlignés au fluo.
 */

.hors-ecran {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* -- le champ ------------------------------------------------------------- */

/* Le même haut que le fil (ses filtres, au même endroit), le champ dessous. */
.haut-recherche {
  flex-wrap: wrap;
  align-content: stretch;
  row-gap: 0;
  height: calc(var(--haut-app) * 2 + env(safe-area-inset-top));
}
.haut-recherche .filtres { flex: 1 0 100%; height: var(--haut-app); }
.haut-recherche .cherche { flex: 1 0 100%; height: var(--haut-app); }
.cherche {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  max-width: var(--colonne);
  margin: 0 auto;
}
.cherche .icone {
  position: absolute;
  left: 9px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--encre);
  stroke-width: 2.4;
  stroke-linecap: round;
  pointer-events: none;
}
.cherche input {
  width: 100%;
  height: 34px;
  padding: 0 10px 0 34px;
  border: 0;
  border-radius: 0;
  background: var(--papier);
  color: var(--encre);
  /* 16 px : sous cette taille, l'iPhone agrandit la page au toucher. */
  font: 16px/1 var(--texte);
  letter-spacing: 0;
  text-transform: none;
  -webkit-appearance: none;
  appearance: none;
}
.cherche input::placeholder { color: var(--encre-douce); }
.cherche input:focus-visible { outline: 3px solid var(--fluo); outline-offset: 0; }
.cherche input::-webkit-search-cancel-button { filter: grayscale(1); }

/* -- la page ---------------------------------------------------------------- */

.recherche {
  position: fixed;
  inset: calc(var(--haut-app) * 2 + env(safe-area-inset-top)) 0 calc(var(--barre-app) + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--papier);
  color: var(--encre);
}
.recherche > :not(.outils, .pied-app) {
  max-width: var(--colonne);
  margin-inline: auto;
  padding-inline: var(--marge);
}
.recherche [hidden] { display: none; }

/* Onglets et tri : suite de la barre noire, collée en haut. */
.outils {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--noir);
  color: var(--fluo);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.sortes,
.tri {
  display: flex;
  gap: 18px;
  max-width: var(--colonne);
  margin: 0 auto;
  padding: 0 var(--marge);
  overflow-x: auto;
  scrollbar-width: none;
}
.sortes::-webkit-scrollbar { display: none; }
.outils button {
  flex: none;
  min-height: 40px;
  padding: 3px 0 0;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  opacity: 0.66;
  cursor: pointer;
}
.outils button[aria-pressed="true"] { border-bottom-color: var(--fluo); opacity: 1; }
.outils button:disabled { opacity: 0.3; cursor: default; }
.sortes span:empty { display: none; }
.tri { gap: 14px; border-top: 1px solid var(--fluo-filet); font-size: 10px; }
.tri button { min-height: 32px; }

.statut {
  margin: 14px auto 0;
  color: var(--encre-douce);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.statut:empty { display: none; }

/* -- les résultats : une liste à filets, filet épais en tête ------------------ */

.resultats {
  margin: 12px auto 0;
  padding: 0;
  border-top: 3px solid var(--encre);
  list-style: none;
}
.resultats:empty { display: none; }
.resultat { border-bottom: 1px solid var(--trait); }
.resultat [hidden] { display: none; }
.resultat-lien {
  display: block;
  padding: 14px 0 15px;
  color: inherit;
  text-decoration: none;
}
.resultat .oeil { color: var(--encre-douce); font-size: 11px; }
.resultat-titre {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 19px;
  font-variation-settings: "wdth" 104;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-transform: uppercase;
}
.resultat-lien:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.resultat mark {
  padding: 0 2px;
  background: var(--fluo);
  color: var(--noir);
}
.resultat-vote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.verdict { padding: 3px 7px; border: 2px solid var(--encre); }
.verdict[data-sens="adopt"] { background: var(--noir); border-color: var(--noir); color: var(--fluo); }
.verdict[data-sens="autre"] { border-color: var(--papier-creux); background: var(--papier-creux); }
.resultat-source {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.resultat-extrait {
  margin: 6px 0 0;
  color: var(--encre-douce);
  font-size: 15px;
  line-height: 1.5;
}
.resultat-extrait mark { color: var(--noir); }

.aucun { margin-top: 22px; font-size: 17px; }
.aucun p { margin: 0 0 6px; }
.ailleurs {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: var(--noir);
  color: var(--fluo);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  cursor: pointer;
}
.ailleurs:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }
.aucun a { color: inherit; font-weight: 700; text-decoration-color: var(--fluo); text-decoration-thickness: 3px; }

/* -- l'écran vide ----------------------------------------------------------------- */

.ecran-vide { padding-bottom: 8px; }
.bloc { margin-top: 24px; }
.bloc .resultats { margin-top: 8px; padding: 0; }
.recentes,
.reviennent {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.recentes { border-top: 3px solid var(--encre); }
.recentes li { display: flex; border-bottom: 1px solid var(--trait); }
.recentes button {
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: 16px/1.3 var(--texte);
  cursor: pointer;
}
.recentes .relancer { flex: 1; padding: 0; text-align: left; }
.recentes .effacer { width: 44px; color: var(--encre-douce); font-size: 22px; }
.reviennent { display: flex; flex-wrap: wrap; gap: 8px; }
.reviennent button {
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid var(--encre);
  border-radius: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform var(--t-base) var(--c-ressort), box-shadow var(--t-rapide) var(--c-sortie);
}
.reviennent button:active { transform: scale(var(--pression)); transition-duration: var(--t-instant); }
@media (hover: hover) {
  .reviennent button:hover { box-shadow: var(--decale) var(--decale) 0 var(--encre); transform: translate(calc(-1 * var(--decale)), calc(-1 * var(--decale))); }
}
.prochaine-ligne {
  display: block;
  margin-top: 8px;
  padding: 14px 16px 16px;
  background: var(--noir);
  color: var(--fluo);
  font-family: var(--display);
  font-size: 22px;
  font-variation-settings: "wdth" 104;
  font-weight: 900;
  line-height: 1.05;
  text-decoration: none;
  text-transform: uppercase;
}
.prochaine-ligne strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: -0.02em;
}
.astuces {
  margin: 28px auto 0;
  color: var(--encre-douce);
  font-size: 14px;
  line-height: 1.6;
}
.astuces code { font-family: var(--mono); font-size: 12px; color: var(--encre); }

.pied-app { margin-top: 32px; }
.pied-app .lisere { margin-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .reviennent button { transition: none; }
}
