/* ============================================================================
   Senego — Page de résultats de recherche (MeiliSearch)
   Design dédié : full width, pas de sidebar, filtres + tri + facettes.
   Toutes les classes sont préfixées `senego-search-*` pour ne pas entrer
   en conflit avec le thème existant.
   ============================================================================ */

/* --- Reset minimal sur le container — on neutralise le 2-cols du thème --- */
.senego-search-page .standard-content-area,
body.search .standard-content-area {
  display: block !important;
  grid-template-columns: none !important;
  max-width: none !important;
}

/* --- Fond blanc sur toute la page de recherche (override du body gris du thème) --- */
body.search {
  background: #ffffff !important;
}

.senego-search-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  color: #1a1a1a;
  font-size: 16px;
  line-height: 1.55;
}

/* --- Bandeau supérieur : champ + meta --- */
.senego-search-hero {
  margin-bottom: 24px;
}

.senego-search-form {
  display: flex;
  gap: 8px;
  position: relative;
}

.senego-search-form input[type="search"] {
  flex: 1;
  font-size: 18px;
  padding: 14px 18px;
  border: 2px solid #e5e5e5;
  border-radius: 999px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.senego-search-form input[type="search"]:focus {
  border-color: #ff9900;
  box-shadow: 0 0 0 3px rgba(194,0,42,.12);
}
.senego-search-form button[type="submit"] {
  background: #ff9900;
  color: #fff;
  border: 0;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: background .15s;
}
.senego-search-form button[type="submit"]:hover { background: #a00020; }

/* --- Autocomplete dropdown --- */
.senego-autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}
.senego-autocomplete.is-open { display: block; }
.senego-autocomplete a {
  display: block;
  padding: 10px 16px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 14px;
  border-bottom: 1px solid #f4f4f4;
}
.senego-autocomplete a:last-child { border-bottom: 0; }
.senego-autocomplete a:hover,
.senego-autocomplete a.is-active { background: #f7f7f7; }

/* --- Méta : nombre de résultats + durée --- */
.senego-search-meta {
  margin-top: 12px;
  color: #6c6c6c;
  font-size: 14px;
}
.senego-search-meta strong { color: #1a1a1a; font-weight: 600; }

/* --- Toolbar filtres + tri --- */
.senego-search-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  margin-bottom: 16px;
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #ececec;
}

.senego-filter {
  position: relative;
}
.senego-filter-btn {
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #333;
  transition: all .12s;
}
.senego-filter-btn:hover { border-color: #ff9900; color: #ff9900; }
.senego-filter-btn[aria-expanded="true"] {
  border-color: #ff9900;
  background: #fff5f6;
  color: #ff9900;
}
.senego-filter-btn.is-active {
  background: #ff9900;
  color: #fff;
  border-color: #ff9900;
}
.senego-filter-btn .caret { font-size: 10px; line-height: 1; }

.senego-filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px;
  z-index: 40;
  display: none;
}
.senego-filter-panel.is-open { display: block; }
.senego-filter-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
}
.senego-filter-option:hover { background: #f7f7f7; }
.senego-filter-option.is-selected { background: #fff5f6; color: #ff9900; font-weight: 500; }
.senego-filter-option .count { color: #a0a0a0; font-size: 13px; margin-left: 12px; }

.senego-active-filters {
  margin-bottom: 16px;
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.senego-active-filters:empty { display: none; }
.senego-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff5f6;
  color: #ff9900;
  border: 1px solid #ffd4dc;
  border-radius: 999px;
  padding: 5px 10px 5px 12px;
  font-size: 13px;
  font-weight: 500;
}
.senego-chip-close {
  cursor: pointer;
  background: none;
  border: 0;
  color: #ff9900;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
}
.senego-chip-close:hover { color: #800018; }

/* --- Liste des résultats --- */
.senego-search-results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.senego-result {
  border-bottom: 1px solid #ececec;
  padding: 16px 0;
}
.senego-result:last-child { border-bottom: 0; }

.senego-result-link {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}
.senego-result-link:hover .senego-result-title { color: #ff9900; }

.senego-result-thumb {
  width: 140px;
  height: 95px;
  border-radius: 6px;
  overflow: hidden;
  background: #f4f4f4;
  flex-shrink: 0;
}
.senego-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.senego-result-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c5c5c5;
  font-size: 12px;
}

.senego-result-title {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
  color: #1a1a1a;
  transition: color .15s;
}
.senego-result-excerpt {
  margin: 0 0 8px;
  font-size: 14px;
  color: #555;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.senego-result-excerpt mark,
.senego-result-title mark {
  background: #fff3a8;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: inherit;
}
.senego-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: #888;
  align-items: center;
}
.senego-result-cat {
  background: #f0f0f0;
  color: #555;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

/* --- Pagination --- */
.senego-pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.senego-pagination a,
.senego-pagination .current,
.senego-pagination .disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  color: #333;
  border: 1px solid #e5e5e5;
  background: #fff;
}
.senego-pagination a:hover { border-color: #ff9900; color: #ff9900; }
.senego-pagination .current {
  background: #ff9900;
  color: #fff;
  border-color: #ff9900;
  font-weight: 600;
}
.senego-pagination .disabled {
  color: #c5c5c5;
  cursor: not-allowed;
  background: #fafafa;
}
.senego-pagination .ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  color: #888;
}

/* --- État vide / erreur --- */
.senego-empty {
  text-align: center;
  padding: 60px 20px;
  color: #555;
}
.senego-empty h2 {
  font-size: 22px;
  margin: 0 0 8px;
}
.senego-empty p { margin: 0 0 16px; color: #777; }

/* --- État de chargement --- */
.senego-loading {
  opacity: .5;
  pointer-events: none;
  transition: opacity .15s;
}
.senego-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #e5e5e5;
  border-top-color: #ff9900;
  border-radius: 50%;
  animation: senego-spin 0.7s linear infinite;
}
@keyframes senego-spin {
  to { transform: rotate(360deg); }
}

/* ============================================================================
   Promo bar — bannière nouveau moteur, affichée sur toutes les pages frontend
   sauf is_search (où la landing prend le relais).
   ============================================================================ */
/* Card pleine largeur du container du thème, alignée sur le design system Senego
   (border-radius 16px comme .popular-posts-section / .services-bar-section). */
.senego-promo-bar {
  position: relative;
  margin: 16px 0 32px;        /* 16px en haut, 32px en bas — pas de max-width */
  padding: 28px 32px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,153,0,.10), transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(230,57,0,.08), transparent 55%),
    #fffaf2;
  border: 1px solid #ffe0b3;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.06);
  /* PAS de overflow:hidden ici : sinon le dropdown autocomplete est clippé. */
}
.senego-promo-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 28px;
  align-items: center;
}
.senego-promo-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: 0;
  color: #b88858;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 50%;
  transition: all .15s;
}
.senego-promo-close:hover { background: rgba(184,136,88,.12); color: #6b4520; }

.senego-promo-text { min-width: 0; }
.senego-promo-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff9900, #e63900);
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(230,57,0,.25);
}
.senego-promo-title {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -0.3px;
}
.senego-promo-subtitle {
  margin: 0;
  font-size: 14.5px;
  color: #555;
  line-height: 1.5;
}
.senego-promo-subtitle strong { color: #ff9900; font-weight: 700; }

.senego-promo-form {
  position: relative;
  margin: 0;
}
/* Le champ et le bouton héritent du style .senego-landing-form ;
   on n'a qu'à ajuster légèrement la taille pour qu'elle entre dans la promo bar. */
.senego-promo-form input[type="search"] { font-size: 17px; padding: 15px 60px 15px 52px; }
.senego-promo-form button[type="submit"] { height: 44px; padding: 0 20px; font-size: 14px; }

.senego-promo-hints {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  font-size: 13px;
}
.senego-promo-hints-label {
  color: #b88858;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-right: 4px;
}
.senego-promo-hints a {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ffd8a3;
  color: #8a4d00;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  text-decoration: none;
  transition: all .15s;
}
.senego-promo-hints a:hover {
  background: linear-gradient(135deg, #ff9900, #e63900);
  border-color: transparent;
  color: #fff;
}

@media (max-width: 880px) {
  .senego-promo-bar {
    padding: 20px 18px;
    margin: 12px 12px 24px;   /* marge latérale pour que la card respire */
    border-radius: 14px;       /* légèrement réduit sur mobile */
  }
  .senego-promo-inner {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .senego-promo-title { font-size: 19px; }
  .senego-promo-subtitle { font-size: 13.5px; }
  .senego-promo-form input[type="search"] { font-size: 15px; padding: 12px 56px 12px 44px; background-position: 16px center; }
  .senego-promo-form button[type="submit"] { height: 38px; padding: 0 14px; font-size: 13px; }
}

/* ============================================================================
   Landing — page de recherche sans query (style « Google ») + bannière annonce
   ============================================================================ */
.senego-search-landing {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 20px 100px;
  text-align: center;
}
.senego-landing-banner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fff5e0, #fff);
  border: 1px solid #ffd285;
  color: #8a4d00;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 28px;
  letter-spacing: 0.2px;
}
.senego-landing-banner .badge {
  background: linear-gradient(135deg, #ff9900, #e63900);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.senego-landing-title {
  font-size: 38px;
  line-height: 1.15;
  font-weight: 800;
  color: #1a1a1a;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.senego-landing-subtitle {
  font-size: 17px;
  line-height: 1.55;
  color: #555;
  margin: 0 0 36px;
}
.senego-landing-subtitle strong { color: #ff9900; font-weight: 700; }

.senego-landing-form {
  position: relative;
  margin-bottom: 32px;
}
.senego-landing-form input[type="search"] {
  width: 100%;
  font-size: 19px;
  padding: 18px 64px 18px 56px;
  border: 2px solid #e5e5e5;
  border-radius: 36px;
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>")
    no-repeat 22px center;
  outline: none;
  transition: all .15s;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.senego-landing-form input[type="search"]:focus {
  border-color: #ff9900;
  box-shadow: 0 4px 20px rgba(255,153,0,.18);
}
.senego-landing-form button[type="submit"] {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #ff9900, #e63900);
  color: #fff;
  border: 0;
  padding: 0 22px;
  height: 48px;
  border-radius: 36px;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(230,57,0,.18);
  transition: box-shadow .15s, transform .15s;
}
.senego-landing-form button[type="submit"]:hover {
  box-shadow: 0 4px 12px rgba(230,57,0,.32);
  transform: translateY(-50%) scale(1.02);
}
.senego-landing-form .senego-autocomplete {
  top: calc(100% + 8px);
  border-radius: 14px;
}

.senego-landing-trust {
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
  color: #666;
  font-size: 14px;
  margin-bottom: 36px;
}
.senego-landing-trust .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.senego-landing-trust strong { color: #ff9900; font-weight: 700; }

.senego-landing-hints {
  text-align: left;
  background: #fafafa;
  border: 1px solid #ececec;
  border-radius: 14px;
  padding: 20px 22px;
}
.senego-landing-hints-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 0 0 12px;
}
.senego-landing-hints-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.senego-landing-hint {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  transition: all .15s;
}
.senego-landing-hint:hover {
  border-color: #ff9900;
  color: #ff9900;
  background: #fff8eb;
}

/* ============================================================================
   Autocomplete dans le header (chargé partout)
   ============================================================================ */
.senego-header-autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  max-height: 380px;
  overflow-y: auto;
  z-index: 9999;
  padding: 6px;
}
.senego-header-autocomplete-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #999;
  padding: 8px 12px 4px;
}
.senego-header-autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  border-radius: 8px;
}
.senego-header-autocomplete-item svg {
  color: #999;
  flex-shrink: 0;
}
.senego-header-autocomplete-item:hover { background: #fff8eb; color: #1a1a1a; }
.senego-header-autocomplete-item:hover svg { color: #ff9900; }
.senego-header-autocomplete-all {
  display: block;
  padding: 10px 12px;
  margin-top: 4px;
  background: #fff8eb;
  color: #b36b00;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  text-align: center;
  border: 1px dashed #ffcc66;
}
.senego-header-autocomplete-all:hover { background: #fff0d4; color: #8a4d00; }

/* Anim shake quand submit vide */
.search-shake {
  animation: senego-shake 0.4s ease-in-out;
}
@keyframes senego-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* --- Mobile --- */
@media (max-width: 767px) {
  .senego-search-landing { padding: 32px 16px 60px; }
  .senego-landing-title { font-size: 26px; }
  .senego-landing-subtitle { font-size: 15px; margin-bottom: 24px; }
  .senego-landing-form input[type="search"] {
    font-size: 16px;
    padding: 14px 56px 14px 46px;
    background-position: 18px center;
  }
  .senego-landing-form button[type="submit"] {
    height: 40px;
    padding: 0 16px;
    font-size: 13px;
  }
  .senego-landing-trust { gap: 14px; font-size: 13px; }
}
@media (max-width: 767px) {
  .senego-search-page { padding: 16px 12px 60px; }

  .senego-search-form input[type="search"] {
    font-size: 16px;
    padding: 12px 16px;
  }
  .senego-search-form button[type="submit"] { padding: 0 18px; font-size: 14px; }

  .senego-search-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 12px 0;
    margin: 0 -12px 16px;
    padding-left: 12px;
    padding-right: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .senego-search-toolbar::-webkit-scrollbar { display: none; }
  .senego-filter-btn { white-space: nowrap; flex-shrink: 0; }

  .senego-filter-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: 12px;
    max-height: 60vh;
    min-width: 0;
  }

  .senego-result-link {
    grid-template-columns: 90px 1fr;
    gap: 12px;
  }
  .senego-result-thumb {
    width: 90px;
    height: 65px;
  }
  .senego-result-title { font-size: 15px; }
  .senego-result-excerpt {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }
}

/* --- Cacher les éléments du thème qui débordent sur la page de recherche --- */
body.search .gam-ad-container.sidebar_top,
body.search .senego-dossiers-sidebar,
body.search .series-sidebar-block,
body.search .radios-sidebar-block,
body.search .sidebar-sticky-ad-wrapper,
body.search #secondary,
body.search aside.widget-area,
body.search .gam-ad-container.in_feed,
body.search .gam-ad-container.in-feed,
body.search [class*="sidebar-"],
body.search [id*="sidebar"],
body.search .ad-desktop-only,
body.search .ad-mobile-only,
body.search [class*="gam-ad-"],
body.search .adsbygoogle {
  display: none !important;
}
