/* ============================================================
   WC26 Hub · global header search (js/search.js) · PAGE 302
   (teletext + pixel). Everything scoped under .wc-search; lives
   inside .header-inner (header is sticky, z-index 100 · the
   dropdown rides inside it). The dropdown reads like a teletext
   index page: cyan section caps, mono rows, gold cursor bar.
   ============================================================ */

.wc-search {
  position: relative;
  flex: 0 1 250px;
  min-width: 170px;
  margin-left: auto;
}

/* ---------------- input ---------------- */

/* the emoji glyph retires - a square-capped magnifier takes its place */
.wc-search .wc-search-glass {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  font-size: 0;
  line-height: 0;
  opacity: .8;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2319d8e8' stroke-width='2' stroke-linecap='square'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 20.5 20.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.wc-search .wc-search-input {
  width: 100%;
  padding: 7px 28px 7px 31px;
  background: #000;
  border: 2px solid var(--line-2);
  border-radius: 0;
  color: var(--gold);
  caret-color: var(--gold);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s, background .15s;
}
.wc-search .wc-search-input::placeholder { color: var(--text-faint); }
.wc-search .wc-search-input:focus {
  border-color: var(--gold);
  background: #000;
}

/* '/' shortcut hint - hidden once typing/focused */
.wc-search .wc-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 6px;
  font-family: var(--font-cond);
  font-size: .6rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-faint);
  border: 1px solid var(--line-2);
  border-radius: 0;
  pointer-events: none;
}
.wc-search .wc-search-input:focus ~ .wc-search-kbd,
.wc-search .wc-search-input:not(:placeholder-shown) ~ .wc-search-kbd { display: none; }

/* ---------------- dropdown: the index page ---------------- */

.wc-search .wc-search-drop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(430px, calc(100vw - 28px));
  max-height: 60vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0 6px;
  background: var(--surface);
  border: 2px solid var(--line-2);
  border-top: 4px solid var(--gold);
  border-radius: 0;
  box-shadow: 8px 8px 0 rgba(47, 107, 255, .25);
  z-index: 40; /* inside the sticky header (z-index 100), so above page content */
}
.wc-search .wc-search-drop[hidden] { display: none; }

/* cyan category cap with a checkered rule running off it */
.wc-search .wc-search-cat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 4px;
  font-family: var(--font-cond);
  font-size: .62rem;
  font-weight: 400;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--cyan);
}
.wc-search .wc-search-cat::before {
  content: '\2588\2592';
  color: var(--cyan);
  font-family: var(--font);
  line-height: 1;
}
.wc-search .wc-search-cat::after {
  content: '';
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 10px);
}

/* ---------------- result rows ---------------- */

.wc-search .wc-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
}
.wc-search .wc-search-item.active {
  background: var(--surface-2);
  border-left-color: var(--gold);
}

.wc-search .wc-search-ic {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 1rem;
  line-height: 1;
}
.wc-search .wc-search-ic img {
  display: block;
  width: 20px;
  height: auto;
  border-radius: 0;
  box-shadow: 0 0 0 1px var(--line-2);
}
.wc-search .wc-search-em { font-size: 1rem; line-height: 1; }

.wc-search .wc-search-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.wc-search .wc-search-label {
  font-size: 1rem;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wc-search .wc-search-sub {
  font-size: .85rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* matched substring - teletext yellow, the highlight */
.wc-search mark {
  background: none;
  color: var(--gold);
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: rgba(255, 212, 0, .5);
  text-underline-offset: 2px;
}

.wc-search .wc-search-empty {
  padding: 16px 14px;
  text-align: center;
  font-size: .95rem;
  color: var(--text-dim);
}

/* ---------------- mobile: own full-width row ---------------- */

@media (max-width: 760px) {
  .wc-search {
    order: 10;             /* drop below brand + nav */
    flex: 1 1 100%;
    min-width: 100%;
    margin-left: 0;
  }
  .wc-search .wc-search-drop {
    left: 0;
    right: 0;
    width: auto;
    max-height: 55vh;
  }
  .wc-search .wc-search-kbd { display: none; }
}
