/* =========================================================
   searchbar.css — barre de recherche du site (assets/js/searchbar.js) : celle de l'en-tête de youtube.com en thème
   sombre, mesurée avec rea (Chrome 154, non connecté, 1440 × 900 et 500 px). Accueil, Idées, Idées de miniatures,
   « Analyser une chaîne ».

   Mesures youtube.com (sombre)
   Champ      40 px de haut, fond #121212, contour 1 px #303030 (sans bord droit), rayon 40px 0 0 40px,
              retrait 0 4px 0 16px ; 536 px au repos + bouton 64 px (barre 600 px au plus) ; aucun changement au survol.
   Focus      contour 1 px #1c62b9 sur les 4 côtés (ici --tp-accent-deep : #1c62b9 avec l'accent bleu, sinon la teinte
              foncée de l'accent choisi), le champ s'élargit de 32 px vers la gauche (568 px) et une loupe 20 px blanche
              apparaît dedans (retrait 48 px, loupe à 16 px du bord) ; le texte ne bouge pas.
   Texte      Roboto 16 px 400, interligne 22 px, blanc ; texte indicatif #757575.
   Croix ×    24 px #f1f1f1 dans une zone ronde de 40 px (déborde de 8 px), survol rgba(255,255,255,.2) ; visible dès
              qu'il y a du texte.
   Loupe      bouton 64 × 40, contour 1 px #303030, fond rgba(255,255,255,.08) (#222 sur #0f0f0f), rayon 0 40px 40px 0,
              icône 24 px blanche, même aspect au survol, infobulle du navigateur (title « Rechercher »).
   Bouton rond (micro) 40 px, 12 px après la loupe, fond rgba(255,255,255,.1) (#272727), survol + rgba(255,255,255,.2)
              (#535353), icône 24 px #f1f1f1 ; infobulle : 16 px sous le bouton, fond #616161 à 90 %, blanc 12/18 px,
              retrait 8 px, rayon 4 px.
   Liste      alignée sur le champ au focus (même gauche, même largeur, sans le bouton), 4 px dessous : voir
              compliance.css (.tp-sugg) et da/ecran.css.
   Étroit     sous 657 px (téléphone) : le focus ouvre la barre sur tout l'en-tête (56 px, fond #0f0f0f), flèche
              Retour 40 px à gauche (8 px du bord), champ à 100 px du bord, 8 px à droite ; la liste reste sous le champ.
              Ici, sur téléphone, la liste prend toute la largeur sous la barre (comme m.youtube.com) et « Aléatoire »
              se cache pendant la saisie : à 375 px un champ de 150 px coupait les recherches.

   Adaptation au site
   - Au repos le champ commence 32 px plus à droite que sa place au focus (place de la loupe). Sur les pages (≥ 900 px)
     la barre est décalée de 32 px vers la gauche : au repos elle s'aligne sur le titre de la page, au focus elle
     déborde dans la marge, comme sur YouTube. Dans un encadré (--fit) et sous 900 px : pas de place réservée, la
     loupe apparaît dans le champ (le texte se décale de 32 px).
   - Sur téléphone la barre reste visible au repos (c'est l'outil principal de la page) ; seules les barres avec liste
     (--list : Accueil, Idées) passent en plein écran au focus.

   Variante « héros » (Idées, Idées de miniatures, Analyse ; en bas de ce fichier) : d'après la page d'accueil de
   1of10.com (titre centré très gras sur 2 lignes, 2e ligne dans l'accent, barre en pilule plus claire que la page,
   loupe grise à gauche, pilule blanche à texte noir à l'intérieur à droite). Leur barre de recherche est derrière une
   connexion : mesures faites sur la capture fournie, avec la police (Roboto) et les couleurs du site.

   .tp-ytsb(--list|--fit, .is-full) > .tp-ytsb__bar > .tp-ytsb__back + .tp-ytsb__host > (.tp-ytsb__box > .tp-ytsb__lead +
   .tp-ytsb__input + .tp-ytsb__clear) + .tp-ytsb__go [+ .tp-sugg] ; .tp-ytsb__round (après la barre) ; [data-tip] infobulles
   ========================================================= */

.tp-ytsb { position: relative; display: flex; min-width: 0; min-height: 40px; }
.tp-ytsb__bar { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; }
.tp-ytsb__icon { display: block; flex: none; width: 24px; height: 24px; }

.tp-ytsb__host { position: relative; display: flex; flex: 1 1 auto; min-width: 0; max-width: 632px; height: 40px; }
@media (min-width: 900px) {
  .tp-ytsb:not(.tp-ytsb--fit):not(.tp-ytsb--hero) .tp-ytsb__host { margin-left: -32px; }
}

/* ---------- Field ---------- */
.tp-ytsb__box {
  position: relative; display: flex; align-items: center; flex: 1 1 0%; min-width: 0; height: 40px; margin: 0 0 0 32px;
  padding: 0 4px 0 16px; border: 1px solid #303030; border-right: 0; border-radius: 40px 0 0 40px; background: #121212;
  color: #ffffff; cursor: text;
}
.tp-ytsb--fit .tp-ytsb__box { margin-left: 0; }
@media (max-width: 899px) {
  .tp-ytsb__box { margin-left: 0; }
}
.tp-ytsb__box:focus-within { margin-left: 0; padding: 2px 4px 2px 48px; border: 1px solid var(--tp-accent-deep, #1c62b9); }
.tp-ytsb__lead {
  position: absolute; top: 50%; left: 0; display: none; width: 48px; height: 20px; padding: 0 12px 0 16px; margin-top: -10px;
  color: #ffffff; pointer-events: none;
}
.tp-ytsb__lead .tp-ytsb__icon { width: 20px; height: 20px; }
.tp-ytsb__box:focus-within .tp-ytsb__lead { display: flex; }

.tp-ytsb__input {
  flex: 1 1 auto; width: 100%; min-width: 0; height: 24px; margin: 0; padding: 1px 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: inherit; font-family: "Roboto", Arial, sans-serif; font-size: 16px;
  font-weight: 400; line-height: 22px; -webkit-font-smoothing: antialiased; -webkit-appearance: none; appearance: none;
}
.tp-ytsb__input::placeholder { color: #757575; opacity: 1; }
.tp-ytsb__input::-webkit-search-cancel-button,
.tp-ytsb__input::-webkit-search-decoration { display: none; -webkit-appearance: none; appearance: none; }
:root .tp-ytsb .tp-ytsb__input:focus,
:root .tp-ytsb .tp-ytsb__input:focus-visible { outline: none; box-shadow: none; }

.tp-ytsb__clear {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px;
  margin: -8px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #f1f1f1; cursor: pointer;
}
.tp-ytsb__clear[hidden] { display: none; }
.tp-ytsb__clear:hover { background: rgba(255, 255, 255, 0.2); }

/* List (history + suggestions, compliance.bindSuggest): under the field only, as wide as the focused field */
.tp-ytsb__host > .tp-sugg { left: 0; right: 64px; width: auto; }

/* ---------- Search button ---------- */
.tp-ytsb__go {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 0; flex: none; width: 64px; height: 40px;
  margin: 0; padding: 0; border: 1px solid #303030; border-radius: 0 40px 40px 0; background: rgba(255, 255, 255, 0.08);
  color: #ffffff; cursor: pointer;
}
.tp-ytsb__go:disabled { cursor: default; }
.tp-ytsb__go.is-busy .tp-ytsb__icon { display: none; }
.tp-ytsb__go .tp-spinner { width: 20px; height: 20px; }

/* ---------- Round button (YouTube's microphone button) ---------- */
.tp-ytsb__round {
  position: relative; display: flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px;
  margin: 0 0 0 12px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #f1f1f1; cursor: pointer;
}
.tp-ytsb__round:hover { background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), rgba(255, 255, 255, 0.1); }
.tp-ytsb__round .tp-icon,
.tp-ytsb__round .tp-ytsb__icon { width: 24px; height: 24px; }

/* ---------- Tooltips (YouTube's: 16 px under the button) ---------- */
.tp-ytsb [data-tip]::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 16px); left: 50%; z-index: 40; width: max-content; max-width: 240px;
  padding: 8px; border-radius: 4px; background: rgba(97, 97, 97, 0.9); color: #ffffff; font-family: "Roboto", Arial, sans-serif;
  font-size: 12px; line-height: 18px; font-weight: 400; text-align: center; white-space: normal; pointer-events: none;
  opacity: 0; visibility: hidden; transform: translateX(-50%); transition: opacity 100ms linear, visibility 100ms linear;
}
.tp-ytsb [data-tip]:hover::after,
.tp-ytsb [data-tip]:focus-visible::after { opacity: 1; visibility: visible; transition-delay: 300ms; }
.tp-ytsb__back[data-tip]::after { left: 0; transform: none; }

/* ---------- Back arrow (phone, full-screen bar) ---------- */
.tp-ytsb__back {
  position: relative; display: none; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: #f1f1f1; cursor: pointer;
}
.tp-ytsb__back:hover { background: rgba(255, 255, 255, 0.1); }

/* ---------- Phone: the focused bar takes the whole header, as youtube.com under 657 px ---------- */
@media (max-width: 656px) {
  .tp-ytsb--list.is-full .tp-ytsb__bar {
    position: fixed; top: 0; right: 0; left: 0; z-index: 70; height: 56px; padding: 8px; background: #0f0f0f;
  }
  .tp-ytsb--list.is-full .tp-ytsb__back { display: flex; }
  .tp-ytsb--list.is-full .tp-ytsb__host { max-width: none; margin-left: 52px; }
  .tp-ytsb--list.is-full .tp-ytsb__round { display: none; }
  /* The list takes the whole width under the bar (as m.youtube.com): a phone-wide field would cut the searches short. */
  :root .tp-ytsb--list.is-full .tp-sugg {
    position: fixed; top: 56px; right: 0; left: 0; width: auto; max-height: calc(100vh - 56px); max-height: calc(100dvh - 56px);
    border-radius: 0;
  }
}

/* =========================================================
   Variante « héros » : section.tp-sbhero > h1.tp-sbhero__title + form.tp-sbhero__form > .tp-ytsb.tp-ytsb--hero
   Titre      Roboto 700, 46/52 px (téléphone 28/34 px), -0,02em, centré, 2 lignes ; 2e ligne var(--tp-accent).
   Barre      pilule 56 px (téléphone 52 px), 640 px au plus, centrée, fond #1c1c1c (page #0f0f0f), contour 1 px #303030
              (survol #3f3f3f, focus --tp-accent-deep comme la barre de YouTube), loupe 20 px #909090 à 20 px du bord
              (blanche au focus), texte 16 px, indicatif #909090.
   Boutons    pilule blanche #f1f1f1 40 px de haut à 8 px du bord droit, texte #0f0f0f 14 px 500 ; survol #d9d9d9.
              --alt : la pilule « alt » (ex. Aléatoire) remplace celle d'envoi tant que le champ est vide.
   Liste      (historique) sous toute la pilule, 6 px dessous.
   Compact    .tp-sbhero.is-compact : titre masqué à l'écran (gardé pour les lecteurs d'écran), barre gardée en haut.
   Téléphone  barres avec liste : plein écran au focus comme les autres (pilule 40 px, envoi en rond blanc 32 px).
   ========================================================= */
.tp-sbhero { display: flex; flex-direction: column; align-items: center; padding: 40px 0 0; margin-bottom: 24px; text-align: center; }
.tp-sbhero__title {
  max-width: 820px; margin: 0 0 28px; color: #f1f1f1; font-family: "Roboto", Arial, sans-serif; font-size: 46px; line-height: 52px;
  font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: anywhere;
}
.tp-sbhero__title > span { display: block; }
.tp-sbhero__accent { color: var(--tp-accent, #3ea6ff); }
.tp-sbhero .tp-sbhero__form { display: flex; flex-direction: column; align-items: stretch; width: 100%; max-width: 640px; margin: 0 auto; }
.tp-sbhero.is-compact { padding-top: 0; }
.tp-sbhero.is-compact .tp-sbhero__title {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.tp-ytsb--hero { width: 100%; min-height: 56px; }
.tp-ytsb--hero .tp-ytsb__host {
  align-items: center; max-width: none; height: 56px; padding: 0 8px 0 0; border: 1px solid #303030; border-radius: 999px;
  background: #1c1c1c; transition: border-color 120ms linear;
}
.tp-ytsb--hero .tp-ytsb__host:hover { border-color: #3f3f3f; }
.tp-ytsb--hero .tp-ytsb__host:focus-within { border-color: var(--tp-accent-deep, #1c62b9); }
.tp-ytsb--hero .tp-ytsb__box,
.tp-ytsb--hero .tp-ytsb__box:focus-within {
  height: 100%; margin: 0; padding: 0 8px 0 0; border: 0; border-radius: 999px 0 0 999px; background: transparent;
}
.tp-ytsb--hero .tp-ytsb__lead,
.tp-ytsb--hero .tp-ytsb__box:focus-within .tp-ytsb__lead {
  position: static; display: flex; align-items: center; width: auto; height: 20px; margin: 0; padding: 0 12px 0 20px; color: #909090;
}
.tp-ytsb--hero .tp-ytsb__box:focus-within .tp-ytsb__lead { color: #f1f1f1; }
.tp-ytsb--hero .tp-ytsb__input::placeholder { color: #909090; }

.tp-ytsb--hero .tp-ytsb__go,
.tp-ytsb__alt {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; width: auto; height: 40px;
  margin: 0; padding: 0 18px; border: 0; border-radius: 999px; background: #f1f1f1; color: #0f0f0f; cursor: pointer;
  font-family: "Roboto", Arial, sans-serif; font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap;
  transition: background-color 120ms linear;
}
.tp-ytsb--hero .tp-ytsb__go:hover,
.tp-ytsb__alt:hover { background: #d9d9d9; }
.tp-ytsb--hero .tp-ytsb__go:focus-visible,
.tp-ytsb__alt:focus-visible { outline: 2px solid var(--tp-accent, #3ea6ff); outline-offset: 2px; }
.tp-ytsb--hero .tp-ytsb__go:disabled { background: #d9d9d9; }
.tp-ytsb--hero .tp-ytsb__go .tp-ytsb__icon { display: none; }
.tp-ytsb--hero .tp-ytsb__go .tp-spinner { width: 16px; height: 16px; color: #0f0f0f; }
.tp-ytsb__alt .tp-icon,
.tp-ytsb__alt .tp-ytsb__icon { width: 18px; height: 18px; flex: none; transition: transform 400ms cubic-bezier(.34, 1.56, .64, 1); }
.tp-ytsb__alt.is-spinning .tp-icon { transform: rotate(180deg); }
.tp-ytsb__alt[aria-disabled="true"] { background: #3f3f3f; color: #aaaaaa; cursor: help; }
/* Empty field: « alt » (e.g. Aléatoire) instead of the send pill; with text: the send pill. */
.tp-ytsb--alt:has(.tp-ytsb__input:placeholder-shown) .tp-ytsb__go { display: none; }
.tp-ytsb--alt:not(:has(.tp-ytsb__input:placeholder-shown)) .tp-ytsb__alt { display: none; }

:root .tp-ytsb--hero:not(.is-full) .tp-ytsb__host > .tp-sugg { top: calc(100% + 6px); left: 0; right: 0; width: auto; }

@media (max-width: 599px) {
  .tp-sbhero { padding-top: 16px; margin-bottom: 20px; }
  .tp-sbhero__title { margin-bottom: 20px; font-size: 28px; line-height: 34px; letter-spacing: -0.01em; }
  .tp-ytsb--hero { min-height: 52px; }
  .tp-ytsb--hero .tp-ytsb__host { height: 52px; padding-right: 6px; }
  .tp-ytsb--hero .tp-ytsb__lead,
  .tp-ytsb--hero .tp-ytsb__box:focus-within .tp-ytsb__lead { padding: 0 10px 0 16px; }
  .tp-ytsb--hero .tp-ytsb__go,
  .tp-ytsb__alt { padding: 0 14px; }
}

/* Phone: full-screen bar on focus (bars with a list), as the YouTube bar above */
@media (max-width: 656px) {
  .tp-ytsb--hero.is-full .tp-ytsb__host { height: 40px; padding-right: 4px; }
  .tp-ytsb--hero.is-full .tp-ytsb__lead,
  .tp-ytsb--hero.is-full .tp-ytsb__box:focus-within .tp-ytsb__lead { padding: 0 8px 0 14px; }
  .tp-ytsb--hero.is-full .tp-ytsb__alt { display: none; }
  .tp-ytsb--hero.is-full .tp-ytsb__go { width: 32px; height: 32px; padding: 0; }
  .tp-ytsb--hero.is-full .tp-ytsb__go .tp-ytsb__icon { display: block; width: 18px; height: 18px; }
  .tp-ytsb--hero.is-full .tp-ytsb__go .tp-ytsb__gotext { display: none; }
}
