/* brand/ask.css — Barre de recherche NLWeb Ferr Studio (style Meeeters) */

.nav-search {
  position: relative;
  flex: 0 1 340px;
  width: 340px;
  max-width: 36%;
  min-width: 200px;
  font-family: Archivo, ui-sans-serif, system-ui, sans-serif;
  margin: 0 12px;
}

@keyframes ask-borderflow {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes ask-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
}
@keyframes ask-rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ask-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.ask-box-wrap {
  border-radius: 999px;
  padding: 1.5px;
  background-color: var(--line, rgba(20, 20, 20, 0.12));
  background-size: 100% 100%;
  transition: background-color 0.25s, box-shadow 0.25s;
}

.ask-box-wrap.is-focused {
  background-image: linear-gradient(90deg, #e4002b, #ff6b81, #e4002b);
  background-size: 100% 100%;
  box-shadow: 0 0 0 3px rgba(228, 0, 43, 0.15);
}

.ask-box-wrap.is-loading {
  background-image: linear-gradient(90deg, #e4002b, #ff6b81, #e4002b, #ff6b81);
  background-size: 300% 100%;
  animation: ask-borderflow 1.4s linear infinite;
}

.ask-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface, #ffffff);
  border-radius: 999px;
  padding: 6px 12px 6px 14px;
  height: 38px;
}

.ask-ico {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  color: var(--muted, #6a6a72);
  transition: color 0.2s;
}

.is-loading .ask-ico {
  color: var(--brand, #e4002b);
  animation: ask-pulse 1s ease-in-out infinite;
}

.ask-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink, #141414);
  min-width: 0;
  padding: 0;
}

.ask-input::placeholder {
  color: rgba(20, 20, 20, 0.45);
}

.ask-kbd {
  font-size: 10px;
  font-weight: 700;
  color: rgba(20, 20, 20, 0.45);
  background: rgba(20, 20, 20, 0.06);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: 4px;
  padding: 2px 5px;
  user-select: none;
  letter-spacing: 0.04em;
}

/* Panneau de resultats */
.ask-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(440px, 92vw);
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, rgba(20, 20, 20, 0.12));
  border-radius: 16px;
  box-shadow: 0 20px 48px -12px rgba(20, 20, 20, 0.22), 0 2px 8px rgba(20, 20, 20, 0.06);
  padding: 14px;
  z-index: 100;
  animation: ask-rise 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

.ask-panel[hidden] {
  display: none;
}

.ask-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.06);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #6a6a72);
}

.ask-panel-head .ask-tag-ai {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand, #e4002b);
}

.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.ask-chip {
  appearance: none;
  border: 1px solid rgba(20, 20, 20, 0.1);
  background: var(--surface-alt, #f7f7f8);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink, #141414);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.ask-chip:hover {
  background: #ffffff;
  border-color: var(--brand, #e4002b);
  color: var(--brand, #e4002b);
  transform: translateY(-1px);
}

.ask-results {
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ask-item {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.ask-item:hover,
.ask-item.is-active {
  background: var(--surface-alt, #f7f7f8);
}

.ask-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.ask-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink, #141414);
}

.ask-item-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.06);
  color: var(--muted, #6a6a72);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.ask-item-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted, #6a6a72);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ask-skeleton {
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ask-skel-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(20,20,20,.05) 25%, rgba(20,20,20,.12) 50%, rgba(20,20,20,.05) 75%);
  background-size: 200% 100%;
  animation: ask-shimmer 1.5s infinite;
}

.ask-empty {
  padding: 20px 10px;
  text-align: center;
  font-size: 13px;
  color: var(--muted, #6a6a72);
}

/* Adaptation Responsive & Disposition dans header.nav */
@media (min-width: 901px) {
  header.nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 16px !important;
  }
  header.nav > .nav-avatar {
    flex: 0 0 auto !important;
  }
  header.nav > .nav-search {
    flex: 0 1 300px !important;
    min-width: 170px !important;
    margin: 0 !important;
  }
  header.nav > .nav-links {
    position: static !important;
    transform: none !important;
    flex: 1 1 auto !important;
    display: flex !important;
    justify-content: center !important;
    gap: 20px !important;
  }
  header.nav > .nav-lang {
    flex: 0 0 auto !important;
  }
  header.nav > .cta {
    flex: 0 0 auto !important;
    margin-left: auto !important;
  }
  header.nav > .nav-burger {
    display: none !important;
  }
}

@media (max-width: 1100px) and (min-width: 901px) {
  header.nav > .nav-search {
    flex: 0 1 220px !important;
  }
  header.nav > .nav-links {
    gap: 14px !important;
  }
}

@media (max-width: 900px) {
  .nav-search {
    display: none;
    max-width: 100%;
    width: 100%;
    margin: 12px 0 6px;
  }
  header.nav.is-open .nav-search {
    display: block;
    position: fixed;
    top: var(--nav, 72px);
    left: 18px;
    right: 18px;
    width: calc(100% - 36px);
    max-width: none;
    margin: 12px 0 0;
    z-index: calc(var(--z-overlay, 50) + 5);
  }
  header.nav.is-open .nav-links {
    padding-top: 76px !important;
  }
  .ask-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
    border-color: rgba(20, 20, 20, 0.08);
  }
}
