/* Site-wide search — header trigger + full-screen overlay.
   Gradient-forward per brand (blue #0099DC → #33ADE3 → #8E51FF → #CB58D5 → red #E94142).
   Loaded on every page via the header widget (nav-render.js). */

/* ---- Header trigger (desktop pill + mobile icon) ---- */
.ap-search-trigger{
  display:inline-flex;align-items:center;gap:9px;height:38px;padding:0 12px 0 14px;
  border-radius:999px;background:rgba(20,28,40,.55);border:1px solid #243042;
  color:#9AA7B8;font:500 13px/1 'Poppins',sans-serif;cursor:pointer;
  transition:border-color .2s,color .2s,box-shadow .2s,background .2s;min-width:190px;justify-content:space-between;
}
.ap-search-trigger:hover{border-color:rgba(0,153,220,.55);color:#E6ECF3;background:rgba(20,28,40,.8);box-shadow:0 0 0 3px rgba(0,153,220,.08);}
.ap-search-trigger .ap-search-trigger-l{display:inline-flex;align-items:center;gap:9px;}
.ap-search-trigger svg{width:16px;height:16px;flex:none;}
.ap-search-trigger .ap-kbd{padding:2px 7px;border-radius:6px;border:1px solid #2b3849;font-size:11px;color:#6B7889;background:rgba(0,0,0,.2);}
.ap-search-iconbtn{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;color:#E6ECF3;background:none;border:none;cursor:pointer;}
.ap-search-iconbtn svg{width:20px;height:20px;}

/* Mobile nav controls (search icon + hamburger) must follow the JS-overflow nav
   system — exactly like #mobile-toggle — NOT a CSS breakpoint, or the group gets
   hidden at the ≥1024px widths where the nav still collapses. Kept display:none
   during the measuring pass so it never inflates desktopFits()'s width math. */
.ap-nav-mobile{display:flex;}
@media (min-width:1024px){ .ap-nav-mobile{display:none;} }
@media (min-width:1024px) and (max-width:1390px){ .ap-nav-mobile{display:flex !important;} }
html.js-nav header .ap-nav-mobile{display:none !important;}
html.js-nav.nav-collapsed header .ap-nav-mobile{display:flex !important;}
html.nav-measuring header .ap-nav-mobile{display:none !important;}

/* Search row inside the mobile drawer menu. */
.ap-search-mobile-row{display:flex;align-items:center;gap:11px;width:100%;padding:13px 15px;margin-bottom:10px;
  border-radius:12px;background:rgba(20,28,40,.6);border:1px solid #243042;color:#9AA7B8;
  font:500 15px/1 'Poppins',sans-serif;cursor:pointer;text-align:left;}
.ap-search-mobile-row svg{width:18px;height:18px;flex:none;}
.ap-search-mobile-row:hover,.ap-search-mobile-row:active{border-color:rgba(0,153,220,.5);color:#E6ECF3;}

/* ---- Overlay ---- */
.ap-search-overlay{
  position:fixed;inset:0;z-index:1000;display:none;
  align-items:flex-start;justify-content:center;padding:13vh 20px 24px;
  /* Fully opaque — the page behind is not visible. */
  background:radial-gradient(120% 90% at 50% 28%, #10161f 0%, #080c12 58%, #05070b 100%);
  opacity:0;transition:opacity .18s ease;
}
.ap-search-overlay.ap-open{display:flex;opacity:1;}
body.ap-search-lock{overflow:hidden;}
.ap-search-panel{width:100%;max-width:720px;position:relative;}
/* Anchor the glow to the search box (not the whole panel) so the bloom sits at
   the box's bottom edge, matching the reference. */
#ap-search-form{position:relative;}

/* The gradient glow — a static bloom concentrated at the bottom edge of the box
   (matches the reference: teal → blue → violet → magenta, brightest below). */
.ap-search-glow{
  position:absolute;left:4%;right:4%;bottom:-22px;height:112px;border-radius:48px;z-index:0;
  background:linear-gradient(90deg,#0099DC 0%,#9E5FA6 50%,#E94142 100%);
  filter:blur(36px);opacity:.95;pointer-events:none;
}

/* The search box itself. */
.ap-search-box{
  position:relative;z-index:1;border-radius:20px;
  background:linear-gradient(180deg,rgba(20,28,40,.96),rgba(11,17,23,.97));
  border:1px solid rgba(255,255,255,.08);box-shadow:0 26px 70px rgba(0,0,0,.55);
}
/* Crisp gradient hairline along the bottom edge (matches the reference). */
.ap-search-box::after{
  content:"";position:absolute;left:5%;right:5%;bottom:-1px;height:2px;border-radius:2px;z-index:3;
  background:linear-gradient(90deg,transparent,#0099DC,#9E5FA6,#E94142,transparent);
}
.ap-search-inputrow{display:flex;align-items:center;gap:13px;padding:19px 20px;}
.ap-search-inputrow .ap-search-mag{width:22px;height:22px;flex:none;color:#33ADE3;}
.ap-search-inputrow input{
  flex:1;min-width:0;background:none;border:none;outline:none;color:#fff;
  font:500 20px/1.3 'Poppins',sans-serif;caret-color:#33ADE3;
}
.ap-search-inputrow input::placeholder{color:#6B7889;}
.ap-search-clear{background:none;border:none;color:#6B7889;cursor:pointer;padding:4px;display:none;}
.ap-search-clear.ap-show{display:inline-flex;}
.ap-search-clear svg{width:16px;height:16px;}

/* Results panel (below the box). */
.ap-search-results{
  position:relative;z-index:1;margin-top:14px;border-radius:16px;overflow:hidden auto;max-height:52vh;
  background:linear-gradient(180deg,rgba(20,28,40,.92),rgba(11,17,23,.94));
  border:1px solid rgba(255,255,255,.06);box-shadow:0 20px 50px rgba(0,0,0,.45);
}
.ap-search-results:empty{display:none;}
.ap-search-result{
  display:flex;align-items:flex-start;gap:12px;padding:13px 18px;text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,.04);transition:background .12s;
}
.ap-search-result:last-child{border-bottom:none;}
.ap-search-result:hover,.ap-search-result.ap-active{background:rgba(0,153,220,.10);}
.ap-search-result .ap-r-body{min-width:0;flex:1;}
.ap-search-result .ap-r-title{color:#E6ECF3;font:500 15px/1.3 'Poppins',sans-serif;margin:0 0 2px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ap-search-result:hover .ap-r-title,.ap-search-result.ap-active .ap-r-title{color:#fff;}
.ap-search-result .ap-r-snippet{color:#9AA7B8;font:400 12.5px/1.45 'Poppins',sans-serif;margin:0;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.ap-r-tag{flex:none;margin-top:2px;font:600 10px/1 'Poppins',sans-serif;letter-spacing:.08em;text-transform:uppercase;
  padding:5px 9px;border-radius:999px;color:#33ADE3;background:rgba(0,153,220,.12);border:1px solid rgba(0,153,220,.28);white-space:nowrap;}
.ap-r-tag[data-t="Page"]{color:#CB58D5;background:rgba(203,88,213,.12);border-color:rgba(203,88,213,.3);}
.ap-r-tag[data-t="Press"]{color:#F4A0A0;background:rgba(233,65,66,.12);border-color:rgba(233,65,66,.28);}

.ap-search-state{padding:16px 20px;color:#6B7889;font:400 13.5px/1.5 'Poppins',sans-serif;}
.ap-search-foot{
  position:relative;z-index:1;margin-top:12px;display:flex;justify-content:space-between;align-items:center;
  color:#6B7889;font:400 12px/1 'Poppins',sans-serif;padding:0 4px;
}
.ap-search-foot a{color:#33ADE3;text-decoration:none;font-weight:500;}
.ap-search-foot a:hover{text-decoration:underline;}
.ap-search-foot .ap-kbd{padding:2px 6px;border-radius:5px;border:1px solid #2b3849;color:#6B7889;margin:0 2px;}

@media (max-width:640px){
  .ap-search-overlay{padding:8vh 12px 16px;}
  .ap-search-inputrow input{font-size:17px;}
}
