/* =====================================================================
   ROUXMESNIL – RECHERCHE RAPIDE
   ===================================================================== */
:root {
  --rs-navy: var(--rb-navy, #123e61);
  --rs-deep: var(--rb-navy-deep, #0b2c49);
  --rs-yellow: var(--rb-yellow, #f6c916);
  --rs-green: var(--rb-green-dark, #23782c);
  --rs-muted: var(--rb-muted, #5d7383);
  --rs-line: var(--rb-line, #dfe8ec);
  --rs-pale: var(--rb-pale, #f0f7f2);
  --rs-link: var(--rb-link, #08759c);
}

/* --- Bouton dans le menu --- */
.rb-search-menu-item { display: flex; align-items: center; margin-left: 10px !important; }
.rb-search-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  color: var(--rs-deep);
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  background: var(--rs-yellow);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .16);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.rb-search-open:hover { background: #ffdc4a; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(0, 0, 0, .22); }
.rb-search-open:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.rb-search-open svg { flex: none; }

/* Menu chargé (1025–1366 px) : seulement la loupe */
@media (max-width: 1366px) {
  .rb-search-menu-item .rb-search-open { width: 42px; padding: 0; justify-content: center; }
  .rb-search-menu-item .rb-search-open-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Loupe de l'en-tête mobile, à gauche du menu « hamburger » */
.rb-search-open--mobile {
  width: 44px;
  height: 44px;
  min-height: 0;
  margin-right: 8px;
  padding: 0;
  justify-content: center;
}
@media (min-width: 1025px) {
  .rb-search-open--mobile { display: none !important; }
}

/* --- Fenêtre de recherche --- */
.rb-search-lock,
.rb-search-lock body { overflow: hidden; }
.rb-search { position: fixed; inset: 0; z-index: 100000; }
.rb-search[hidden] { display: none; }
.rb-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 31, 51, .62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .18s ease;
}
.rb-search-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100% - 32px));
  max-height: min(78vh, 720px);
  margin: clamp(16px, 9vh, 110px) auto 0;
  overflow: hidden;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(-12px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
}
.rb-search.is-open .rb-search-backdrop { opacity: 1; }
.rb-search.is-open .rb-search-panel { opacity: 1; transform: none; }

.rb-search-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--rs-line);
}
.rb-search-form::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--rb-strip, linear-gradient(90deg, #2e9b3a, #b5d20f, #f6c916, #0aa3dc));
}
.rb-search-icon { flex: none; color: var(--rs-navy); }
.rb-search-input {
  flex: 1;
  min-width: 0;
  padding: 8px 0 !important;
  color: var(--rs-deep) !important;
  font: inherit;
  font-size: clamp(17px, 2.2vw, 21px) !important;
  font-weight: 600;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.rb-search-input::placeholder { color: #93a3ae; font-weight: 500; }
.rb-search-input::-webkit-search-cancel-button { display: none; }
.rb-search-close {
  flex: none;
  padding: 6px 10px;
  color: var(--rs-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: #f2f5f7;
  border: 1px solid var(--rs-line);
  border-radius: 7px;
  cursor: pointer;
}
.rb-search-close:hover { color: var(--rs-deep); background: #e8eef2; }

.rb-search-body { flex: 1; overflow-y: auto; padding: 10px 10px 4px; overscroll-behavior: contain; }
.rb-search-intro { padding: 8px 8px 14px; }
.rb-search-intro[hidden] { display: none; }
.rb-search-heading {
  margin: 0 0 10px !important;
  color: var(--rs-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.rb-search-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rb-search-chip {
  padding: 8px 14px;
  color: var(--rs-navy);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  background: var(--rs-pale);
  border: 1px solid #dce8e2;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}
.rb-search-chip:hover,
.rb-search-chip:focus-visible { background: #fff; border-color: var(--rb-green, #2e9b3a); }

.rb-search-results { margin: 0 !important; padding: 0 !important; list-style: none; }
.rb-search-item { margin: 0 0 4px !important; }
.rb-search-item a {
  display: block;
  padding: 11px 14px;
  color: var(--rs-deep) !important;
  text-decoration: none !important;
  border-radius: 12px;
  transition: background-color .15s ease;
}
.rb-search-item a:hover,
.rb-search-item.is-active a { background: #eef6fb; }
.rb-search-item.is-active a { box-shadow: inset 3px 0 0 var(--rs-yellow); }
.rb-search-item-top { display: flex; align-items: center; gap: 10px; margin-bottom: 3px; }
.rb-search-badge {
  padding: 2px 8px;
  color: var(--rs-navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: #e8eef3;
  border-radius: 999px;
}
.rb-search-badge--acces-direct { color: var(--rs-deep); background: var(--rs-yellow); }
.rb-search-badge--actualite { color: #08617f; background: #e5f4fa; }
.rb-search-badge--agenda { color: var(--rs-green); background: #e7f4e7; }
.rb-search-meta { color: var(--rs-muted); font-size: 12.5px; }
.rb-search-item-title { display: block; font-size: 16px; font-weight: 750; line-height: 1.35; }
.rb-search-item-excerpt {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--rs-muted);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.rb-search-item.is-shortcut .rb-search-item-title::after { content: " →"; color: var(--rb-green, #2e9b3a); }
.rb-search-all a { color: var(--rs-link) !important; font-weight: 800; text-align: center; background: #f6f9fb; }

.rb-search-status { margin: 0 !important; padding: 8px 14px 12px; color: var(--rs-muted); font-size: 13.5px; }
.rb-search-status:empty { display: none; }
.rb-search-foot {
  margin: 0 !important;
  padding: 10px 18px;
  color: var(--rs-muted);
  font-size: 12px;
  background: #f7f9fa;
  border-top: 1px solid var(--rs-line);
}
.rb-search-foot kbd {
  display: inline-block;
  min-width: 20px;
  margin: 0 2px;
  padding: 1px 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: #fff;
  border: 1px solid #cfd9df;
  border-radius: 5px;
  box-shadow: 0 1px 0 #cfd9df;
}

/* --- Grand champ [rb_recherche] --- */
.rb-search-inline {
  display: flex;
  gap: 8px;
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 6px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
}
.rb-search-inline input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px !important;
  color: var(--rs-deep) !important;
  font: inherit;
  font-size: 16px !important;
  background: transparent !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.rb-search-inline button {
  padding: 0 22px;
  color: var(--rs-deep);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  background: var(--rs-yellow);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.rb-search-inline button:hover { background: #ffdc4a; }

/* --- Page de résultats : suggestions --- */
.rb-search-suggest {
  grid-column: 1 / -1;
  margin: 0 0 22px;
  padding: 16px 20px;
  background: #fff8db;
  border-left: 4px solid var(--rs-yellow);
  border-radius: 0 12px 12px 0;
}
.rb-search-suggest p { margin: 0 0 8px !important; color: var(--rs-deep); font-weight: 800; }
.rb-search-suggest ul { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 !important; padding: 0 !important; list-style: none; }
.rb-search-suggest a { color: var(--rs-link) !important; font-weight: 700; text-decoration: none !important; }
.rb-search-suggest a:hover { text-decoration: underline !important; }

@media (max-width: 600px) {
  .rb-search-panel { width: 100%; max-height: 100%; height: 100%; margin: 0; border-radius: 0; }
  .rb-search-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rb-search-backdrop,
  .rb-search-panel,
  .rb-search-open { transition: none; }
}

.rb-k-mob { display: none; }
@media (max-width: 600px), (hover: none) {
  .rb-k-desk { display: none; }
  .rb-k-mob { display: inline; }
}
