/* =====================================================================
 * NEON CABINET — companion kit glue.
 *
 * The homepage widget builder, the global search chrome, the author page
 * and the gp_video skin were ported from the GeekPress companion kit, and
 * those stylesheets speak the kit's short token vocabulary
 * (--gold, --cream, --bg, --surface …). Neon Cabinet speaks the --geekui-*
 * contract. Rather than rewrite ~3k lines of widget CSS, the short names are
 * aliased onto this theme's palette here, so they inherit the light/dark
 * switch for free — the --geekui-* values are what flip on
 * body[data-theme="light"].
 *
 * Their embedded literal colours were remapped to the cabinet palette in a
 * separate pass (backups: *.css.bak-reel).
 *
 * Must load BEFORE homepage-widgets.css / header-extras.css so the aliases
 * exist by the time those files resolve their var() calls.
 * ===================================================================== */

body,
[id^="geekui-root"],
[class*="gpg-"] {
  /* canvas → surfaces, in the kit's order of elevation */
  --bg:          var(--geekui-bg);
  --bg-2:        var(--geekui-bg-2);
  --surface:     var(--geekui-bg-2);
  --surface-soft: var(--geekui-surface-2);
  --elev:        var(--geekui-surface);

  /* accent — hot magenta stands in for the kit's gold */
  --gold:        var(--geekui-accent);
  --gold-soft:   var(--geekui-accent-d);
  --cyan:        var(--geekui-accent-2);
  --magenta:     var(--geekui-accent);

  /* text */
  --cream:       var(--geekui-text);
  --muted:       var(--geekui-text-mute);

  /* lines */
  --border:      var(--geekui-border);
  --border-soft: var(--geekui-border);

  /* type */
  --serif:       var(--geekui-font-title);
  --display:     var(--geekui-font-title);
  --sans:        var(--geekui-font-base);
  --mono:        var(--geekui-font-mono);
}

/* =====================================================================
 * Cabinet treatment for the ported widget cards.
 * The kit ships rounded, soft-shadowed cards; this theme is chunky pixel
 * frames with a hard offset shadow and zero radius. Restated here rather
 * than edited into homepage-widgets.css, so the port stays re-syncable.
 * ===================================================================== */
.gpg-home-widget-title,
.gh-title {
  font-family: var(--geekui-font-title);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(255, 46, 196, 0.35);
}
.gpg-home-widget-title::after,
.gh-title::after {
  background: linear-gradient(90deg, var(--geekui-accent), var(--geekui-accent-2), transparent);
}

/* Any kit surface that draws itself as a card gets the cabinet frame. */
.gpg-rr-card,
.gpg-review-card,
.gpg-critic-card,
.gpg-bt-card,
.gpg-author-card,
.gpg-author-list-card,
.gpg-top-card,
.gpg-poll-card,
.gpg-news-card {
  border-radius: 0 !important;
  border: 2px solid var(--geekui-border) !important;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}
[data-theme="light"] .gpg-rr-card,
[data-theme="light"] .gpg-review-card,
[data-theme="light"] .gpg-critic-card,
[data-theme="light"] .gpg-bt-card,
[data-theme="light"] .gpg-author-card,
[data-theme="light"] .gpg-author-list-card,
[data-theme="light"] .gpg-top-card,
[data-theme="light"] .gpg-poll-card,
[data-theme="light"] .gpg-news-card {
  box-shadow: 4px 4px 0 rgba(60, 30, 80, 0.18);
}

/* =====================================================================
 * Global search — cabinet chrome around the shared #gpgSearch hooks.
 * Markup: header.php.  Behaviour: assets/js/global-search.js + inc/global-search.php.
 * header-extras.css supplies the layout; this only re-dresses it, and the
 * rules are scoped to .topbar so they cannot leak into the plugin surfaces.
 * ===================================================================== */
/* The search slot itself: sized by its contents and allowed to shrink, rather
   than stretching across the bar (header-extras.css gives .gpg-search a border
   + background and a flex-filling field — here the select and the field carry
   their own cabinet frames, so the outer box must be neutral and bounded). */
.topbar-search { max-width: 460px; }
.topbar .gpg-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  border: 0;
  background: transparent;
  overflow: visible;
}
.topbar .gpg-search-type,
.topbar .gpg-search-field {
  background: var(--nc-bg-2, #140d22);
  border: 2px solid var(--geekui-border);
  border-radius: 0;
  color: var(--geekui-text-dim);
  font-family: var(--geekui-font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 10px;
  min-width: 0;
}
.topbar .gpg-search-type { appearance: none; cursor: pointer; }
.topbar .gpg-search-type:focus,
.topbar .gpg-search-field:focus-within {
  outline: none;
  border-color: var(--geekui-accent);
  box-shadow: 0 0 0 2px rgba(255, 46, 196, 0.25);
}
.topbar .gpg-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  /* not 1 1 auto (header-extras) — that stretches the field across the bar */
  flex: 0 1 auto;
  width: auto;
}
.topbar .gpg-search-field svg { flex: 0 0 14px; width: 14px; height: 14px; }
.topbar .gpg-search-input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--geekui-text);
  font-family: var(--geekui-font-mono);
  font-size: 13px;
  width: 100%;
  min-width: 0;
  max-width: 210px;
  flex: 1 1 auto;
}
.topbar .gpg-search-input::placeholder { color: var(--geekui-text-mute); }

/* dropdown */
.topbar .gpg-search-results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, 92vw);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 900;
  background: var(--geekui-modal-bg);
  border: 2px solid var(--geekui-border-strong);
  border-radius: 0;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55);
  padding: 6px;
}
.topbar .gpg-search-results[hidden] { display: none; }
.gpg-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 0;
  text-decoration: none;
  color: var(--geekui-text);
}
.gpg-search-item:hover { background: var(--geekui-surface-2); color: var(--geekui-text); }
.gpg-search-thumb {
  flex: 0 0 38px;
  width: 38px;
  height: 54px;
  border-radius: 0;
  background: var(--geekui-surface) center / cover no-repeat;
  border: 2px solid var(--geekui-border);
}
.gpg-search-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gpg-search-title {
  font-family: var(--geekui-font-title);
  font-size: 13px;
  text-transform: uppercase;
  color: var(--geekui-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gpg-search-year { color: var(--geekui-text-mute); }
.gpg-search-meta,
.gpg-search-badge {
  font-family: var(--geekui-font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--geekui-text-mute);
}
.gpg-search-empty {
  padding: 18px;
  text-align: center;
  font-family: var(--geekui-font-mono);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--geekui-text-mute);
}

@media (max-width: 900px) {
  .topbar .gpg-search-type { display: none; }
  .topbar .gpg-search-input { max-width: 130px; }
}

/* =====================================================================
 * Slide-out menu — cabinet re-dress over header-extras.css geometry.
 * (Geometry deliberately not restated: two competing menu systems is how the
 * panel ended up open-but-invisible during the port.)
 * ===================================================================== */
.menu-panel {
  border-top: 2px solid var(--geekui-accent);
  border-bottom: 2px solid var(--geekui-border);
  box-shadow: 0 14px 0 rgba(0, 0, 0, 0.45);
}
.menu-nav a,
.menu-nav .nav-menu li a {
  border: 2px solid var(--geekui-border) !important;
  border-radius: 0 !important;
  background: var(--geekui-surface);
  color: var(--geekui-text-dim);
  font-family: var(--geekui-font-title);
  letter-spacing: 0.06em;
  transition: transform 0.08s, box-shadow 0.08s, color 0.15s, border-color 0.15s;
}
.menu-nav a:hover,
.menu-nav .nav-menu li a:hover {
  color: var(--geekui-accent);
  border-color: var(--geekui-accent) !important;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--geekui-accent-d);
}
.menu-close { border-radius: 0; border-width: 2px; }
