@charset "utf-8";
/* ═══════════════════════════════════════════════════════════════════════════
   COMBOBOX — the suggestion panel for the hero search bar

   Additive layer over the design system: every colour, radius, shadow and type
   step below is an existing token from styles.css. Nothing here introduces a
   new value, because the panel has to sit directly under the search bar and
   read as part of the same control, not as a widget bolted on top of it.
   ═══════════════════════════════════════════════════════════════════════════ */

.cb-host{position:relative}

.cb{
  position:absolute;
  z-index:60;
  inset-inline:0;
  top:calc(100% + 8px);
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--r-md);
  box-shadow:var(--sh-lg);
  overflow:hidden;
  /* --cb-max is set by the script from the real space available, so the panel
     can never run off the bottom of a short viewport. */
  max-height:var(--cb-max,320px);
  display:flex;
  flex-direction:column;
  animation:cb-in .12s ease-out both;
}

/* Flipped above the field when there is no room below. */
.cb--up{top:auto;bottom:calc(100% + 8px);transform-origin:bottom;}

@keyframes cb-in{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.cb{animation:none}}

.cb__list{
  margin:0;
  padding:6px;
  list-style:none;
  overflow-y:auto;
  overscroll-behavior:contain;   /* stop the page scrolling once the list ends */
  -webkit-overflow-scrolling:touch;
}

.cb__group{
  padding:10px 10px 4px;
  font-size:var(--fs-3xs);
  font-weight:600;
  letter-spacing:var(--tr-caps);
  text-transform:uppercase;
  color:var(--slate-300);
}
.cb__group:first-child{padding-top:6px}

.cb__opt{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 10px;
  border-radius:var(--r-sm);
  cursor:pointer;
  font-size:var(--fs-md);
  color:var(--ink);
  line-height:1.3;
}

/* One highlight style for both keyboard and pointer. Two different treatments
   for "the thing Enter will pick" is the classic combobox bug — the user ends
   up watching one highlight while acting on the other. */
.cb__opt.is-active{background:var(--brand-25);color:var(--brand-700)}
.cb__opt.is-active .cb__meta{color:var(--brand-700);opacity:.75}

.cb__prefix{
  flex:none;
  width:1.5em;
  text-align:center;
  font-size:var(--fs-lg);
  line-height:1;
}

.cb__label{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* The matched substring, returned by the API rather than guessed on the client
   so the highlight always agrees with why the row actually ranked. */
.cb__label mark{
  background:none;
  color:inherit;
  font-weight:650;
  text-decoration:underline;
  text-decoration-color:var(--brand-200);
  text-decoration-thickness:2px;
  text-underline-offset:2px;
}

.cb__meta{
  flex:none;
  font-size:var(--fs-2xs);
  color:var(--slate-300);
  font-variant-numeric:tabular-nums;
}

.cb__status{
  margin:0;
  padding:16px 14px;
  font-size:var(--fs-sm);
  color:var(--slate-400);
  text-align:center;
}

/* Busy state: a hairline sweep across the top of the panel. Deliberately not a
   spinner over the list — the previous results stay readable and clickable
   while a newer query is in flight. */
.cb.is-busy::before{
  content:"";
  position:absolute;
  inset-inline:0;
  top:0;
  height:2px;
  background:linear-gradient(90deg,transparent,var(--brand),transparent);
  animation:cb-sweep 1s linear infinite;
}
@keyframes cb-sweep{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
@media (prefers-reduced-motion:reduce){
  .cb.is-busy::before{animation:none;background:var(--brand-200)}
}

/* ── hero search bar integration ─────────────────────────────────────────────
   The country <select> stays in the DOM as the form's real value — it is what
   app.js reads and what submits without JavaScript. It is taken out of the
   layout and the a11y tree once the combobox input takes its place, rather than
   `display:none`, so it still participates in form submission. */
.sbar__f--c .sbar__native-hidden{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
}

/* Sits in the same grid cell the select occupied, so nothing shifts. */
.sbar__f--c .sbar__cb{grid-column:2;padding-right:2px;text-overflow:ellipsis}

/* The panel is anchored to the whole field, not to the input, so it lines up
   with the field's rounded edge rather than with the text. */
.sbar__f{position:relative}
.sbar .cb{top:calc(100% + 10px)}

@media (max-width:720px){
  /* Touch targets go to 44px and the panel spans the whole field group, since
     at this width the three fields are stacked rather than side by side. */
  .cb__opt{padding:12px 10px;min-height:44px}
  .cb{max-height:min(var(--cb-max,60vh),60vh)}
}

@media (prefers-contrast:more){
  .cb{border-width:2px}
  .cb__opt.is-active{outline:2px solid var(--brand-700);outline-offset:-2px}
}
